public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/5925: execs crash in shared lib destructor = do_global_dtors_aux
@ 2002-03-12 10:16 murf
  0 siblings, 0 replies; 4+ messages in thread
From: murf @ 2002-03-12 10:16 UTC (permalink / raw)
  To: gcc-gnats


>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=


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c/5925: execs crash in shared lib destructor = do_global_dtors_aux
@ 2003-04-16 14:18 ehrhardt
  0 siblings, 0 replies; 4+ messages in thread
From: ehrhardt @ 2003-04-16 14:18 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, murf, nobody

Synopsis: execs crash in shared lib destructor = do_global_dtors_aux

State-Changed-From-To: feedback->closed
State-Changed-By: cae
State-Changed-When: Wed Apr 16 14:18:37 2003
State-Changed-Why:
    No feedback in 3 months. The solaris problem is most likely due to
    a binutils/ld.so.1 one bug. Upgrade to at least binutils 2.13.1 and
    recompile gcc.
    
         regards Christian
    

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5925


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c/5925: execs crash in shared lib destructor = do_global_dtors_aux
@ 2003-01-08  1:42 bangerth
  0 siblings, 0 replies; 4+ messages in thread
From: bangerth @ 2003-01-08  1:42 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, murf, nobody

Synopsis: execs crash in shared lib destructor = do_global_dtors_aux

State-Changed-From-To: open->feedback
State-Changed-By: bangerth
State-Changed-When: Tue Jan  7 17:42:50 2003
State-Changed-Why:
    Both gcc2.95 and 3.0 are no longer supported. Can you say
    whether this have become better with gcc3.2?
    
    Thanks
      Wolfgang

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5925


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c/5925: execs crash in shared lib destructor = do_global_dtors_aux
@ 2002-05-29  1:06 Daniel van Vugt
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel van Vugt @ 2002-05-29  1:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/5925; it has been noted by GNATS.

From: Daniel van Vugt <dan@networkharmoni.com.au>
To: gcc-gnats@gcc.gnu.org, gcc-prs@gcc.gnu.org, murf@e-tools.com,
        gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: c/5925: execs crash in shared lib destructor = do_global_dtors_aux
Date: Wed, 29 May 2002 15:45:29 +0800

 With respect to GCC bug 5925;
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5925
 
 I seem to be getting the same problem with gcc 2.95.2 on SCO OpenServer 
 5.0.6. It only occurs with our proprietary code and I can't seem to 
 replicate the problem using hello.tar.gz. Stepping through in GDB, the 
 segfault always occurs somewhere in the __do_global_dtors_aux of one of 
 our shared libraries.
 
 - Daniel van Vugt
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-04-16 14:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-12 10:16 c/5925: execs crash in shared lib destructor = do_global_dtors_aux murf
2002-05-29  1:06 Daniel van Vugt
2003-01-08  1:42 bangerth
2003-04-16 14:18 ehrhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).