libunwind-devel
[Top][All Lists]
Advanced

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

Re: [libunwind] unwinding from signal handler


From: David Mosberger
Subject: Re: [libunwind] unwinding from signal handler
Date: Wed, 14 Apr 2004 13:57:18 -0700

>>>>> On Wed, 14 Apr 2004 13:36:41 -0700, Max Asbock <address@hidden> said:

  Max> Here is a question about unwinding from within a signal
  Max> handler: The architecture is either x86 or x86_64 where dwarf2
  Max> frame info is used. By looking at elf files it looks like gcc
  Max> only produces dwarf info for the function prologues, but not
  Max> the epilogues. If a signal is received in the epilogue of a
  Max> function just after the stack pointer has been restored and the
  Max> signal handler tries to unwind from there we could get funny
  Max> results because the IP still points to the current function but
  Max> the stack pointer points to the frame for the previous
  Max> function.  Any thoughts?

Hmmh, in the case you're looking at, I assume the CFA is equivalent to
the frame-pointer, so poping the stack-frame wouldn't affect that
part.  Perhaps the problem exists because something got saved in the
stack-frame and the unwinder wasn't told that this something has been
restored?  If so, perhaps there are some missng CFA_restore
directives?

FYI, on IA-64, this is handled with the "epilogue" directive.  It
tells the unwinder that the stack frame has been popped and that it
should assume that all save-locations inside the popped frame have
been restored.

        --david


reply via email to

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