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,start X-Google-Attributes: gid111c93,public X-Google-ArrivalTime: 2002-11-04 15:46:54 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!denver-snf1.gtei.net!news.gtei.net!coop.net!newsfeed1.global.lmco.com!svlnews.lmms.lmco.com!not-for-mail From: JMK Newsgroups: comp.os.linux.development.apps,comp.os.linux.alpha Subject: Re: segfault and gcc-2.96 Date: Mon, 04 Nov 2002 15:32:32 -0800 Organization: Lockheed Martin Corporation Message-ID: <3DC70390.3C7CDB89@lmco.nospam.com> References: <3DC324DA.4C495AEC@lmco.nospam.com> NNTP-Posting-Host: 129.197.49.226 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.61 [en] (WinNT; U) X-Accept-Language: en Xref: archiver1.google.com comp.os.linux.development.apps:27385 comp.os.linux.alpha:6567 Mark Swaanenburg wrote: > > "JMK" schreef in bericht > news:3DC324DA.4C495AEC@lmco.nospam.com... > > I was given a task to port a program written with Cygnus on an X86 box > > to a Suse Alpha. I am getting SEGMENTATION FAULTS also on code that > > works fine on the other computer. > > > > The existing code points to heavy use of stack vs heap memory and I've > > found a URL where someone details the porting issue that arises with > > such design. > > > > I'm trying to increase the heap size somehow, but can't find > > documentation on how to do it. I've got gcc version 2.95.2 20000220 > > (Debian GNU/Linux) compiler. I've read other material that says > > setting stack size can't be done. I'm hoping its not this compiler. > > > > Can it be done? If so, it could be the same problem you are facing and > > answer would benefit us both. > > > > Otherwise I need to go through my core dump. Tips on analyzing a core > > dump appreciated. > > I am also not very familiar with analyzing core dumps, but what I always do > is to start with a backtrace (bt). That shows you in which function the > segfault occured. It also displays the values of the arguments which were > passed to the functions. I hope this will give you something to start with. > > Mark > > > > > Jeff Mark, Thanks for getting back with me. When it crashed, (I have DDD to work with - a fairly good tool!) I did some returns and a back trace and it appears that it doesn't like // Global char *f1 = "default.str"; . . . { { char pfix[12] cin.getline(pfix,12,'\n'); ... strcpy (f1, pfix); <-------- Program received signal SIGSEGV, Segmentation fault. __stxcpy () at ../sysdeps/alpha/stxcpy.S:246 246 ../sysdeps/alpha/stxcpy.S: No such file or directory Current language\: auto; currently asm ... } } uname -a Linux xxx01 2.2.17 #1 Thu Jun 29 13:33:28 EDT 2000 alpha unknown gcc version 2.95.2 20000220 (Debian GNU/Linux) compiler The code was developed on a Cygnus equipped PC and is being ported to a Linux Alpha. I compiled with -Wall and the only error is a function that has a loop in it with no return -- warning control reaches end of non-void function 'func'. The portion it complains about never gets reached. Is there a way to tell if I'm choking the stack with memory demands on the Alpha v. the PC? Is there a known bug in __stxcpy? I checked the web, but if so, documentation isn't wasn't forthcoming. Any help appreciated, Jeff