public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* BUG? -fomit-frame-pointer and exceptions or setjmp/longjmp
@ 2002-06-02 14:31 Denis Zaitsev
  2002-06-02 15:11 ` Richard Henderson
  0 siblings, 1 reply; 28+ messages in thread
From: Denis Zaitsev @ 2002-06-02 14:31 UTC (permalink / raw)
  To: gcc

If gcc is built with the -fomit-frame-pointer in the environment's
CXXFLAGS, then we have a dead exception handling mechanics - a c++
program, compiled with such a gcc, can't catch any of an exceptions it
throws.  All the exceptions leak thru the catch (...) chain and
program finishes by kill() itself.  It's because something becomes
wrong with a thrown object's type recognition.  And the reason is the
absence of the ebp register set to a stack frame at the moment when
the exception is thrown.  The ill function here -
libsupc++/eh_throw.cc/__cxa_throw (and, very probably, __cxa_rethrow
as well).  The problem vanishes, if we recompile eh_throw.cc with
-fno-omit-frame-pointer.  But it's not the real cure.  As I
understand, FRAME_POINTER_REQUIRED must give true for such a function
(by the reason of calling _Unwind_RaiseException inside of it?), but
gcc fails to do that.

The other similar problem is with glibc/linuxthreads.  If
libpthread.so is compiled with -fomit-frame-pointer in CFLAGS, then
any threaded app finishes with SIGSEGV just after the start.  It
seems, that the problem here is in an absence of ebp correctly set
around setjmp/longjmp calls.  There are -fno-omit-frame-pointer flags
especially set for some files in the glibc/linuxthreads tree, but this
doesn't help.

I assume gcc 3.0.4, 3.1 and glibc 2.2.5.

Do I understand right, that it's a gcc's care to set up the stack
frame register when it's necessary, regardless of the
-fomit-frame-pointer flag?

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2002-07-04  0:24 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-02 14:31 BUG? -fomit-frame-pointer and exceptions or setjmp/longjmp Denis Zaitsev
2002-06-02 15:11 ` Richard Henderson
2002-06-02 15:45   ` Denis Zaitsev
2002-06-02 19:46     ` Richard Henderson
2002-06-10 14:17   ` Nix
2002-06-13 17:15     ` Denis Zaitsev
2002-06-14 12:45       ` Nix
2002-06-14 13:21         ` Andrew Haley
2002-06-14 15:35           ` Nix
2002-06-14 16:19             ` Richard Henderson
2002-06-17 15:46         ` Denis Zaitsev
2002-06-17 17:25           ` Daniel Berlin
2002-07-01 16:10         ` PATCH: " Denis Zaitsev
2002-07-02  3:20           ` Paolo Carlini
2002-07-03  3:50             ` Denis Zaitsev
2002-07-02 19:45           ` Richard Henderson
2002-07-02 20:18             ` Richard Henderson
2002-07-03  2:32             ` Denis Zaitsev
2002-07-03 10:45             ` Denis Zaitsev
2002-07-03 13:26               ` Richard Henderson
2002-07-03 15:43                 ` Mark Mitchell
2002-07-03 16:03                 ` Denis Zaitsev
2002-07-03 16:16                   ` Richard Henderson
2002-07-03 17:05                     ` Denis Zaitsev
2002-07-03 17:24                       ` Richard Henderson
2002-07-03 21:28                         ` Denis Zaitsev
2002-07-03 23:39                           ` Richard Henderson
2002-07-03 23:42                             ` Denis Zaitsev

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).