From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10c696,d10848107276edee X-Google-Attributes: gid10c696,public X-Google-Thread: 111c93,6331f57d343c4816 X-Google-Attributes: gid111c93,public X-Google-ArrivalTime: 2002-11-04 16:40:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-han1.dfn.de!news-nue1.dfn.de!uni-erlangen.de!news.uni-erlangen.de!weigand From: Ulrich Weigand Newsgroups: comp.os.linux.development.apps,comp.os.linux.alpha Subject: Re: segfault and gcc-2.96 Date: 5 Nov 2002 00:35:02 GMT Organization: University of Erlangen, Germany Message-ID: References: <3DC324DA.4C495AEC@lmco.nospam.com> <3DC70390.3C7CDB89@lmco.nospam.com> NNTP-Posting-Host: weigand@faui11.informatik.uni-erlangen.de X-Trace: rznews2.rrze.uni-erlangen.de 1036456502 15742 131.188.31.2 (5 Nov 2002 00:35:02 GMT) X-Complaints-To: news@uni-erlangen.de NNTP-Posting-Date: 5 Nov 2002 00:35:02 GMT User-Agent: nn/6.6.3 Xref: archiver1.google.com comp.os.linux.development.apps:27388 comp.os.linux.alpha:6569 JMK writes: >// Global >char *f1 = "default.str"; > strcpy (f1, pfix); <-------- Program received signal SIGSEGV, You are trying to overwrite a string constant, which may reside in read-only memory. Thus the crash. You should fix your application to avoid doing that. As a workaround, you could also use the -fwritable-strings flag that tell gcc to allow writing to string "constants". -- Dr. Ulrich Weigand weigand@informatik.uni-erlangen.de