[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [libunwind] libunwind issue on x86

From: M K Saravanan-A19831
Subject: RE: [libunwind] libunwind issue on x86
Date: Thu, 1 Sep 2005 22:55:59 +0530

__libc_sigaction is a signal frame, though I am not sure if is replacing the last frame. The example I gave has one frame missing though I had seen some other examples on x86 where the last 1-3 frames missing.
Anyone else has faced this issue with x86 libunwind?  Also, I had faced some unw_get_proc_name() failure with errno = 0 on x86, even after successful unw_step and unw_get_reg calls. Not sure what could be the issue here?

From: Nemura Blake-BNEMURA1
Sent: Thursday, September 01, 2005 9:59 PM
To: address@hidden
Cc: M K Saravanan-A19831
Subject: RE: [libunwind] libunwind issue on x86

I tried a function call sequence main()->funca()->funcb()->funcc()->funcd()->funce(). The last function funce() causes exception and causes the exception handler to run which does the unwind. The problem here is the last function funce()'s frame is missing. Here after funcd() there is the frame for __libc_sigaction().
#03 [0x009daec0] __libc_sigaction() +0x110 in /lib/tls/ (+27ec0)
#04 [0x08049195] funcd(int) +0x11 in ./Exception.out (+1195)
#05 [0x080491a9] funcc(int) +0x11 in ./Exception.out (+11a9)
#06 [0x080491bd] funcb(int) +0x11 in ./Exception.out (+11bd)
#07 [0x080491d1] funca(int) +0x11 in ./Exception.out (+11d1)
#08 [0x080491fb] main() +0x27 in ./Exception.out (+11fb) 
It looks like __libc_sigaction (signal frame?) is replacing the actual user context that caused the exception signal. That happens on powerpc too.
Might be able to workaround by using EIP from uc_mcontext instead of unw_get_regs() when unw_is_signal_frame() is true. That's basically what we do on powerpc with backtrace(). Although then you can't use unw_get_proc_name() :(
Still, would be nice if there were some way to have the signal frame /not/ replace the user context.
Any ideas on options for that? Not sure if its a libc or kernel thing.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]