public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35179]  New: execs crash in shared lib destructor = do_global_dtors_aux
@ 2008-02-13 15:06 lakshmivaraganm at hcl dot in
  2008-02-13 15:38 ` [Bug c++/35179] " lakshmivaraganm at hcl dot in
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: lakshmivaraganm at hcl dot in @ 2008-02-13 15:06 UTC (permalink / raw)
  To: gcc-bugs

+++ This bug was initially created as a clone of Bug #5925 +++
The same bug happens in gcc version 3.4.3 too:
Given below are the details:

The same problem is experienced in gcc version given below:

Reading specs from /VOBS/sol10tools/gcc/lib/gcc/i386-pc-solaris2.10/3.4.3/specs
Configured with: /root/tmp/gcc-3.4.3/configure --prefix=/VOBS/sol10tools/gcc
--with-as=/VOBS/sol10tools/gcc/bin/gas --with-gnu-as --with-ld=/usr/ccs/bin/ld
--without-gnu-ld --enable-languages=c,c++ --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)

Back trace:
~~~~~~~~~~~
#0  ~uppglob (this=0x827e220) at sysunixthreadcs.h:63
#1  0x080a6254 in __static_initialization_and_destruction_0 (__initialize_p=0,
__priority=0) at lax/main.cpp:27
#2  0x080924b7 in __do_global_dtors_aux ()
#3  0x08166685 in _fini () at iostream:77
#4  0xfd35126d in _exithandle () from /lib/libc.so.1
#5  0xfd343f22 in exit () from /lib/libc.so.1
#6  0x08092402 in _start ()

Regards,
Lax

Bug #5925 follows:
~~~~~~~~~~~~~~~~~~
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

Release:
gcc-2.95.1,2,3

Environment:
Solaris-2.5.1
installed binutils=2.11.2

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.


-- 
           Summary: execs crash in shared lib destructor =
                    do_global_dtors_aux
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: lakshmivaraganm at hcl dot in


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35179


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

end of thread, other threads:[~2009-05-31  1:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-13 15:06 [Bug c++/35179] New: execs crash in shared lib destructor = do_global_dtors_aux lakshmivaraganm at hcl dot in
2008-02-13 15:38 ` [Bug c++/35179] " lakshmivaraganm at hcl dot in
2008-02-13 15:47 ` rguenth at gcc dot gnu dot org
2008-02-13 16:59 ` [Bug target/35179] " pinskia at gcc dot gnu dot org
2008-02-18 12:09 ` lakshmivaraganm at hcl dot in
2009-05-31  1:53 ` radu dot gcc at ohmi dot org
2009-05-31  1:55 ` radu dot gcc at ohmi dot org

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).