Article View: comp.unix.programmer
Article #3368ar core dump
From: Shane McDaniel
Date: Thu, 17 Jan 2002 17:56
Date: Thu, 17 Jan 2002 17:56
34 lines
2226 bytes
2226 bytes
I am using ar to make a static library, and previously have had no trouble doing so with this particular code. Now though, I get a core dump when running ar. Also, this code compiles and links fine on Sun Solaris 8, but not on x86 Solaris 8 using the same versions of g++ and ar. I have compiled ETCP.o and PO.o using g++ 2.95.3 with the flag "-g" when I run ar r libETCP.a.2.0 PO.o ETCP.o ar core dumps because of PO.o, I know this because removing PO.o from the above command runs fine, but vice versa doesn't. I've included ETCP.o simply for completeness. running 'gdb ar core' I see the following backtrace #0 0xdfb16110 in realloc () from /usr/lib/libc.so.1 #1 0x8052be0 in trim () #2 0x8053621 in writefile () #3 0x805285c in trim () #4 0x8052e0e in writefile () #5 0x8051cfc in main () #6 0x8051a20 in _start () The change in my source are very simplistic. I simply added another paramater to a function pointer prototype everywhere it was used in both of the ETCP and PO classes. and since ETCP doesn't crash ar I don't see why the same changes for PO should crash ar. I would have thought that if my code compiled fine in g++ then ar shouldn't care. If anyone has any information that might assist me I would appreciate it.
Technical Details
Message-ID:
<Pine.WNT.4.33.0201171148080.304-100000@bunnyhop.llan.ll.mit.edu>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!llslave.llan.ll.mit.edu!bunnyhop!shanemShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc89c,fafa024acbe9c8d2,start X-Google-Attributes: gidfc89c,public X-Google-Thread: 10ba33,fafa024acbe9c8d2,start X-Google-Attributes: gid10ba33,public X-Google-ArrivalTime: 2002-01-17 09:54:53 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!llslave.llan.ll.mit.edu!bunnyhop!shanem Newsgroups: comp.unix.programmer,gnu.g++.help From: Shane McDaniel <shanem@ll.mit.edu> Subject: ar core dump Message-ID: <Pine.WNT.4.33.0201171148080.304-100000@bunnyhop.llan.ll.mit.edu> X-X-Sender: shanem@llinfo.llan.ll.mit.edu MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Lines: 35 Date: Thu, 17 Jan 2002 12:56:19 -0500 NNTP-Posting-Host: 155.34.61.26 X-Complaints-To: news@ll.mit.edu X-Trace: llslave.llan.ll.mit.edu 1011290092 155.34.61.26 (Thu, 17 Jan 2002 12:54:52 EST) NNTP-Posting-Date: Thu, 17 Jan 2002 12:54:52 EST