public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: murf@e-tools.com
To: gcc-gnats@gcc.gnu.org
Subject: c/5925: execs crash in shared lib destructor = do_global_dtors_aux
Date: Tue, 12 Mar 2002 10:16:00 -0000	[thread overview]
Message-ID: <20020312180956.25003.qmail@sources.redhat.com> (raw)


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


             reply	other threads:[~2002-03-12 18:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-12 10:16 murf [this message]
2002-05-29  1:06 Daniel van Vugt
2003-01-08  1:42 bangerth
2003-04-16 14:18 ehrhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020312180956.25003.qmail@sources.redhat.com \
    --to=murf@e-tools.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).