[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: [LI] Catching SIGSEGV
On Mon, Jan 17, 2000 at 02:55:42PM +0530, Vimal Mathew wrote:
> Hi,
> A program I wrote used a signal handler for SIGSEGV. I originally
> compiled it without any extra flags. When any instruction in the
> program seg. faulted, it would get a large no. of Segmentation
> fault signals (I checked with strace and ltrace), and the program
> would exit. The same program, if compiled with optimization flags
> (-O2) would work as expected. I tried compiling with both gcc
> and egcs under RH5.2 and egcs in RH6.1. The program fragment is
> given below
It sounds like a compiler issue with restoring the state with longjmp.
If longjmp returns to setjmp with value 0 instead of value 1, you can
get into the endless SIGSEGV loop.
longjmp can return 0, if there is a compiler/libc bug that doesn't
restore the state properly from jmp_buf.
You may want to mail this to egcs or glibc mailing list. I came across
a similar problem on a different architecture.
-Arun
--------------------------------------------------------------------
The Linux India Mailing List Archives are now available. Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.