This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libgcc_s.so.1 ASIS won't work with glibc.


On Tue, Jul 03, 2001 at 04:24:36PM -0700, Richard Henderson wrote:
> On Tue, Jul 03, 2001 at 11:23:41AM -0700, H . J . Lu wrote:
> > But it does have __throw and its friends from libgcc.a in g++ v2.
> 
> So what?  That doesn't affect __register_frame_info et al.
> The v2 __throw uses only __frame_state_for.  Nothing else.

The v2 __throw may only call __frame_state_for. But DSO compiled with
g++ v2 will call __register_frame_info to register unwind frame. Unless
I am mistaken, __register_frame_info in g++ v2 has a different way
to register unwind frame than __register_frame_info in g++ v3.

> 
> > My proposal is:
> 
> Stop proposing.  You've yet to show the problem.  Please
> show me the problem first.

I did.

> 
> That test case plus test instructions you just gave was
> obviously bogus -- it can't have failed for the reasons
> you said it would.  I'd bet you didn't try it yourself.

Have you tried it? I got

(gdb) r
Starting program: /home/hjl/bugs/gcc/frame/main 

Program received signal SIGABRT, Aborted.
0x4004d4a1 in __kill ()
   from /export/build/gnu/glibc-gcc-3.0/build-i686-linux/libc.so.6
(gdb) bt
#0  0x4004d4a1 in __kill ()
   from /export/build/gnu/glibc-gcc-3.0/build-i686-linux/libc.so.6
#1  0x4004d106 in raise (sig=6) at ../sysdeps/posix/raise.c:27
#2  0x4004eb92 in abort () at ../sysdeps/generic/abort.c:88
#3  0x4001964b in __default_terminate () at ../../gcc/libgcc2.c:3034
#4  0x4001966a in __terminate () at ../../gcc/libgcc2.c:3034
#5  0x4001a585 in __throw () at ../../gcc/libgcc2.c:3168
#6  0x400195d7 in bar () at bar.cc:8
#7  0x0804856b in main () at main.c:3
#8  0x4003c633 in __libc_start_main (main=0x8048560 <main>, argc=1, 
    ubp_av=0xbffffa24, init=0x80483f4 <_init>, fini=0x80485b0 <_fini>, 
    rtld_fini=0x4000c6f4 <_dl_fini>, stack_end=0xbffffa1c)
    at ../sysdeps/generic/libc-start.c:129

The problem is the wrong __register_frame_info is called. I will
try to verify it. But it will take a while.


> > Now we have 2 versions of those frame functions. The one in libc.so.6
> > is for the binaries compiled with gcc v2 and the one in libgcc_s.so.1
> > is for the binaries compiled with gcc v3.
> 
> This won't work.  If you build glibc with gcc3, then glibc will
> use the pc-relative FDE format, which the gcc2 libgcc routines
> do not support.  If you use the gcc2 routines and unwind through
> qsort, you'll crash.

Why does glibc have to use the gcc2 EH routines itself? As I said,
the gcc2 EH routines are for exist binaries compiled with g++
v2. Of course, we need to patch glibc to do it.


H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]