c/8350: segmentation fault when using -shared-libgcc on Solaris2.9

boulier@lifl.fr boulier@lifl.fr
Fri Oct 25 06:46:00 GMT 2002


>Number:         8350
>Category:       c
>Synopsis:       segmentation fault when using -shared-libgcc on Solaris2.9
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 25 06:46:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     boulier@lifl.fr
>Release:        gcc 3.2
>Organization:
>Environment:
SunOS troismonts 5.9 Generic sun4u sparc SUNW,Sun-Blade-100
>Description:
A program linked with the shared version of libgcc on a 
Sun Blade 100 under Solaris 2.9, gives a segmentation 
fault. The compiler is gcc 3.2.

Version of gcc
--------------
{troismonts-boulier-~/TOTO } gcc --version
gcc (GCC) 3.2
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

{troismonts-boulier-~/TOTO } cat /export/GCC/gcc-3.2-install-2/config.status
#!/bin/sh
# This file was generated automatically by configure.  Do not edit.
# This directory was configured as follows:
/export/GCC/gcc-3.2/configure --with-gcc-version-trigger=/export/GCC/gcc-3.2/gcc
/version.c --host=sparc-sun-solaris2.9 --with-gnu-ld --with-gnu-as --enable-thre
ads --enable-shared --enable-languages=c,c++ --norecursion
# using "mh-frag" and "mt-frag"

Test file
---------
{troismonts-boulier-~/TOTO } cat a.c
main ()
{
}

The bug
-------
{troismonts-boulier-~/TOTO } gcc -g -shared-libgcc a.c
{troismonts-boulier-~/TOTO } a.out
Segmentation Fault (core dumped)
{troismonts-boulier-~/TOTO } ldd a.out
        libgcc_s.so.1 =>         /usr/local/lib/libgcc_s.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        /usr/platform/SUNW,Sun-Blade-100/lib/libc_psr.so.1
With gdb
--------
{troismonts-boulier-~/TOTO } gdb a.out
GNU gdb 5.2.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.9"...
(gdb) run
Starting program: /home/calforme/boulier/TOTO/a.out

Program received signal SIGSEGV, Segmentation fault.
__register_frame_info_bases (begin=0xff380000, ob=0xff380000, tbase=0x0,
    dbase=0x0) at /export/GCC/gcc-3.2/gcc/unwind-dw2-fde.c:83
83        ob->tbase = tbase;

I have tried to rebuild gcc without any optimization.
The bug is still there. The bug location may be more
accurate but I do not understand why a SIGSEGV. With gdb :

(gdb) run
Starting program: /home/calforme/boulier/TOTO/a.out 

Program received signal SIGSEGV, Segmentation fault.
0xff37a2b4 in __register_frame_info_bases (begin=0xff370000, ob=0xff370000, 
    tbase=0x0, dbase=0x0) at /export/GCC/gcc-3.2/gcc/unwind-dw2-fde.c:82
82        ob->pc_begin = (void *)-1;
(gdb) print ob
$1 = (struct object *) 0xff370000
(gdb) print *ob
$2 = {pc_begin = 0x7f454c46, tbase = 0x1020100, dbase = 0x0, u = {
    single = 0x0, array = 0x0, sort = 0x0}, s = {b = {sorted = 0, 
      from_array = 0, mixed_encoding = 0, encoding = 0, count = 196610}, 
    i = 196610}, next = 0x1}





>How-To-Repeat:
See description
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-prs mailing list