From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31971 invoked by alias); 12 Mar 2002 18:16:08 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 31823 invoked by uid 71); 12 Mar 2002 18:16:04 -0000 Resent-Date: 12 Mar 2002 18:16:04 -0000 Resent-Message-ID: <20020312181604.31822.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, murf@e-tools.com Received:(qmail 25010 invoked by uid 61); 12 Mar 2002 18:09:56 -0000 Message-Id:<20020312180956.25003.qmail@sources.redhat.com> Date: Tue, 12 Mar 2002 10:16:00 -0000 From: murf@e-tools.com Reply-To: murf@e-tools.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c/5925: execs crash in shared lib destructor = do_global_dtors_aux X-SW-Source: 2002-03/txt/msg00388.txt.bz2 List-Id: >Number: 5925 >Category: c >Synopsis: execs crash in shared lib destructor = do_global_dtors_aux >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue Mar 12 10:16:03 PST 2002 >Closed-Date: >Last-Modified: >Originator: murf@e-tools.com >Release: gcc-2.95.1,2,3 >Organization: >Environment: Solaris-2.5.1 installed binutils=2.11.2 >Description: We built a real simple test case. When you run it, it crashes in __do_global_dtors_aux() on exit. It only crashes when built on solaris-2.5.1 with 2.95.x; such execs crash on all other (eg. solaris 2.6, 2.7) platforms. Building with other gcc compiler versions on other platforms still works. Building with a cygnus 2.9 compiler on Sol. 2.6, generates an exec that doesn't crash on both 2.6 and 2.5.1; too bad we can't swith over to the other environment! Any hints as to what we are doing wrong? Here is a transcript of my build and run: [52]/mnt4/support/murf Yes, Master? make gcc -o hellomain.o -c -g hellomain.c -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/specs gcc version 2.95.2 19991024 (release) /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/cpp -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -g -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) hellomain.c /var/tmp/ccxbNhDY.i GNU CPP version 2.95.2 19991024 (release) (sparc) #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/../../../../sparc-sun-solaris2.5.1/include /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/include /usr/include End of search list. The following default directories have been omitted from the search path: /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/../../../../include/g++-3 End of omitted list. /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/cc1 /var/tmp/ccxbNhDY.i -quiet -dumpbase hellomain.c -g -version -o /var/tmp/ccixcsmS.s GNU C version 2.95.2 19991024 (release) (sparc-sun-solaris2.5.1) compiled by GNU C version 2.95.2 19991024 (release). /usr/local/sparc-sun-solaris2.5.1/bin/as -V -Qy -s -o hellomain.o /var/tmp/ccixcsmS.s GNU assembler version 2.11.2 (sparc-sun-solaris2.5.1) using BFD version 2.11.2 gcc -o hello_.o -g -c -fpic -DPIC hello.c -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/specs gcc version 2.95.2 19991024 (release) /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/cpp -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -Dsparc -Dsun -Dunix -D__svr4__ -D__SVR4 -D__sparc__ -D__sun__ -D__unix__ -D__svr4__ -D__SVR4 -D__sparc -D__sun -D__unix -Asystem(unix) -Asystem(svr4) -g -D__GCC_NEW_VARARGS__ -Acpu(sparc) -Amachine(sparc) -DPIC hello.c /var/tmp/ccgDKy5b.i GNU CPP version 2.95.2 19991024 (release) (sparc) #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/../../../../sparc-sun-solaris2.5.1/include /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/include /usr/include End of search list. The following default directories have been omitted from the search path: /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/../../../../include/g++-3 End of omitted list. /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/cc1 /var/tmp/ccgDKy5b.i -quiet -dumpbase hello.c -g -version -fpic -o /var/tmp/ccqcL1ah.s GNU C version 2.95.2 19991024 (release) (sparc-sun-solaris2.5.1) compiled by GNU C version 2.95.2 19991024 (release). /usr/local/sparc-sun-solaris2.5.1/bin/as -V -Qy -s -K PIC -o hello_.o /var/tmp/ccqcL1ah.s GNU assembler version 2.11.2 (sparc-sun-solaris2.5.1) using BFD version 2.11.2 gcc -o libhello.so -shared -g hello_.o -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/specs gcc version 2.95.2 19991024 (release) /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/collect2 -V -G -dy -z text -Y P,/usr/ccs/lib:/usr/lib -Qy -o libhello.so /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/crti.o /usr/ccs/lib/values-Xa.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/crtbegin.o -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2 -L/usr/local/sparc-sun-solaris2.5.1/lib -L/usr/ccs/bin -L/usr/ccs/lib -L/usr/local/lib hello_.o -lgcc -lgcc /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/crtend.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/crtn.o GNU ld version 2.11.2 (with BFD 2.11.2) Supported emulations: elf32_sparc gcc -g -o hello-exec hellomain.o -L. -lhello -v Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/specs gcc version 2.95.2 19991024 (release) /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/collect2 -V -Y P,/usr/ccs/lib:/usr/lib -Qy -o hello-exec /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/crt1.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/crti.o /usr/ccs/lib/values-Xa.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/crtbegin.o -L. -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2 -L/usr/local/sparc-sun-solaris2.5.1/lib -L/usr/ccs/bin -L/usr/ccs/lib -L/usr/local/lib hellomain.o -lhello -lgcc -lc -lgcc /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/crtend.o /usr/local/lib/gcc-lib/sparc-sun-solaris2.5.1/2.95.2/crtn.o GNU ld version 2.11.2 (with BFD 2.11.2) Supported emulations: elf32_sparc hello-exec About to call hello! Hello, World! make: *** [hello-run] Segmentation Fault (core dumped) [54]/mnt4/support/murf Yes, Master? gdb hello-exec GNU gdb 5.1.1 Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "sparc-sun-solaris2.5.1"... (gdb) run Starting program: /mnt4/support/murf/hello-exec About to call hello! Hello, World! Program received signal SIGSEGV, Segmentation fault. 0xef7905d0 in __do_global_dtors_aux () from ./libhello.so (gdb) where #0 0xef7905d0 in __do_global_dtors_aux () from ./libhello.so #1 0xef790750 in _fini () from ./libhello.so #2 0xef7dba2c in ?? () #3 0xef69784c in _exithandle () from /usr/lib/libc.so.1 (gdb) quit >How-To-Repeat: I've attached the test case. On a 2.5.1 system, run make. It will build the .o's, the shared object, do the link, and run the exec. If it can't find the .so, set the env LD_LIBRARY_PATH to . Then re-run. You should die in the destructors. Make sure you are on 2.5.1 of Solaris. Also, just tried 3.0 of gcc. Same crash. >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="hello.tar.gz" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="hello.tar.gz" H4sIAENAjjwAA+2VTU/jMBCGe61/xSxcCiLB+WgtAUJa7R5AAokbF6QqOG5rrRsjx6mQVvx3nK/W IFh2taW7h3kOzTievDPpeCYLoZQOrCjt8eCzoDSljI3d1Vnj9uror63N0jRJU+cQD2gUTVI2gPGn ZeRRlTYzAINlZWa/8jNa213ks2MWm/pfZz/ETCqx9Rg0onQySd+t/5ixrv4Jo7VflCSxqz/deiZv gPV39TdVAScA7UI8Ck6Gnk02tvNqFstMFqEGJe+bZVhqMpxzDsEcAu3pvPAOrkIIVHMHghV0ut2m L8w7Mf3y8Ube83IihHgp9BrTUK8F/O2gXGRG5GuVaS266tKYbnJ4Hb/xmzfxZw/S/X6/ufzWuzYK XImsOCFDs9w84Uf2X8P/Y8m/Lr/f/90LbT/GR/3vxn3f/xMWJXX/R3GC/b8L9mXBVZULOCttLnW4 OCdkpWXeHtNRbR6QnwQ6Hows7Gy0d1HvHsGtNir/clfsHZySp//hOCN/yOv+byfrdmN81P9xnK6/ /3Xju/5nzh37fwf8Tv+fEuK6HuqjMaqNzMz5EXD3MYXDQ7dYvTUhvt7ryoLVwDOlWjU3KNpR0fu2 MdyNoXiUdkRxiiAIgiAIgiAIgiAIgiAIgiAIgiDIX/EMrIlUYAAoAAA=