Ask a Question related to UNIX Programming, Design and Development.
-
jason #1
How to ignore SIGSEGV signal
hi there,
how to ignore SIGSEGV signal, 'cause i tried to handle or ignore that
signal on the code but it keep raised signal. is this one-shot signal?
any ideas.?
i used siganl or sigaction both of'em
cheers.
jason Guest
-
unknown sigsegv code 0
These SIGSEGV signal messages have been determined to be sent from debugging code that was not disabled. Note that all Mac users of CS4 applications,... -
DBD::PgSPI crashes the database server (SIGSEGV)?
Hi, I have tried to use "plperlu" to write server functions to encapsulate some common functionality such as "copy an entity"(and all its... -
SIGSEGV in memcpy() when starting a n application
Hello, I am getting SIGSEGV immedaitely in the initialization of my app. by GDB I see that it happens in memcpy() when starting a n application ... -
signal
/* function declarations */ int func1(void*); int func2(void*); .... int funcn(void*); /* table of names and pointers */ struct { ... -
Errno 25 ENOTTY then SIGSEGV, socket on accept call? Help.
Hi All, I have been scouring newsgroups for ages now trying to find a solution to my problem. Have to resort to posting the question: I am writing... -
joe@invalid.address #2
Re: How to ignore SIGSEGV signal
[email]iryna7@yahoo.com[/email] (jason) writes:
Don't ignore that. Once you get SIGSEGV, nothing can be relied on in> how to ignore SIGSEGV signal, 'cause i tried to handle or ignore
> that signal on the code but it keep raised signal. is this one-shot
> signal? any ideas.?
your program. Just let it core dump, and figure out the problem from
there.
Joe
--
There are 10 kinds of engineers, those who understand binary and those
who don't.
joe@invalid.address Guest
-
David Schwartz #3
Re: How to ignore SIGSEGV signal
"jason" <iryna7@yahoo.com> wrote in message
news:7247d407.0307211636.386f8d8e@posting.google.c om...> hi there,> how to ignore SIGSEGV signal, 'cause i tried to handle or ignore that
> signal on the code but it keep raised signal. is this one-shot signal?
> any ideas.?I'm puzzled why you'd want to ignore a SIGSEGV signal. If you could do> i used siganl or sigaction both of'em
it, you would have changed nothing, so whatever generated the SIGSEGV would
just generate another one, which you'd also ignore, ad infinitum.
If your SIGSEGV handler can eliminate the cause of the SIGSEGV, you can
continue execution. But with no handler, you'd be in an infinite loop.
What are you trying to do?
DS
David Schwartz Guest
-
Marc Rochkind #4
Re: How to ignore SIGSEGV signal
On 21 Jul 2003 17:36:00 -0700, jason <iryna7@yahoo.com> wrote:
For this signal and a few others that can be generated by a fault detected> hi there,
>
> how to ignore SIGSEGV signal, 'cause i tried to handle or ignore that
> signal on the code but it keep raised signal. is this one-shot signal?
> any ideas.?
>
> i used siganl or sigaction both of'em
>
> cheers.
>
by hardware, if they are genuinely generated by a fault, as opposed to
being generated synthetically by, say, kill, a special rule applies: You
can catch them or ignore them, but one thing you can't do it execute the
instruction that follows the one that caused the fault. In other words,
returning from a signal handler or a direct SIG_IGN both result in program
termination.
--Marc
Marc Rochkind Guest
-
Michael Kerrisk #5
Re: How to ignore SIGSEGV signal
On Mon, 21 Jul 2003 21:15:43 -0700, "David Schwartz"
<davids@webmaster.com> wrote:
I think it depends on the implementation. In some cases, if we return>
>"Marc Rochkind" <rochkind@basepath.com> wrote in message
>news:oprsoyjezvojfyi9@den.news.speakeasy.net...
>>>> For this signal and a few others that can be generated by a fault detected
>> by hardware, if they are genuinely generated by a fault, as opposed to
>> being generated synthetically by, say, kill, a special rule applies: You
>> can catch them or ignore them, but one thing you can't do it execute the
>> instruction that follows the one that caused the fault. In other words,
>> returning from a signal handler or a direct SIG_IGN both result in program
>> termination.
> Really? Even if you reset the signal handler?
from the handler, then the signal is again delivered, and so on...
If one wants to continue execution, a more typical approach I> My understanding about what's supposed to happen is that when you return
>from the signal handler, it should resume executing exactly where it
>stopped, thus generating another segmentation violation. This allows code to
>'fix' the circumstances that caused the segmentation violation (if it can
>and wants to) and then resume execution.
think would be to longjmp() somewhere else, thus side-stepping
the faulting instruction.
Not necesarily unportable though - for example, if the SIGSEGV> Obviously, that's not going to be portable.
is caused by a memory protection violation, we could use mprotect()
to repair the error and then return (though mprotect() isn't in
SUSv3's list of async-signal-safe funtions...).
Cheers,
Michael
Michael Kerrisk Guest
-
David Schwartz #6
Re: How to ignore SIGSEGV signal
"Michael Kerrisk" <michael.kerrisk@freenet.de> wrote in message
news:r5kphvok3ucgkmr4l0evcr7j99474kophb@4ax.com...
return> > My understanding about what's supposed to happen is that when youto> >from the signal handler, it should resume executing exactly where it
> >stopped, thus generating another segmentation violation. This allows code> >'fix' the circumstances that caused the segmentation violation (if it can
> >and wants to) and then resume execution.Unless one can repait the 'problem' by calling 'mmap' or 'mprotect' or> If one wants to continue execution, a more typical approach I
> think would be to longjmp() somewhere else, thus side-stepping
> the faulting instruction.
even by modifying the code.
> > Obviously, that's not going to be portable.You can even, unportably of course, build your own jmp_buf to jump past> Not necesarily unportable though - for example, if the SIGSEGV
> is caused by a memory protection violation, we could use mprotect()
> to repair the error and then return (though mprotect() isn't in
> SUSv3's list of async-signal-safe funtions...).
the faulting instruction after doing whatever processing is required.
One typical application of this is optimizing spinlocks for UP machines
on x86. In the initial spinlock code, you specifically put an illegal
instruction where the LOCK prefix would go. In the SIGILL handler, you
replace the illegal instruction with either a LOCK prefix or a nop,
depending upon whether you're on a UP or SMP machine.
DS
David Schwartz Guest
-
Marc Rochkind #7
Re: How to ignore SIGSEGV signal
On Mon, 21 Jul 2003 21:15:43 -0700, David Schwartz <davids@webmaster.com>
wrote:
I was overly specific... all the standard says is that the behavior is>
> "Marc Rochkind" <rochkind@basepath.com> wrote in message
> news:oprsoyjezvojfyi9@den.news.speakeasy.net...
>>>> For this signal and a few others that can be generated by a fault
>> detected
>> by hardware, if they are genuinely generated by a fault, as opposed to
>> being generated synthetically by, say, kill, a special rule applies: You
>> can catch them or ignore them, but one thing you can't do it execute the
>> instruction that follows the one that caused the fault. In other words,
>> returning from a signal handler or a direct SIG_IGN both result in
>> program
>> termination.
> Really? Even if you reset the signal handler?
>
> My understanding about what's supposed to happen is that when you return
> from the signal handler, it should resume executing exactly where it
> stopped, thus generating another segmentation violation. This allows code
> to
> 'fix' the circumstances that caused the segmentation violation (if it can
> and wants to) and then resume execution.
>
> Obviously, that's not going to be portable.
>
> DS
>
>
>
undefined.
--Marc
Marc Rochkind Guest



Reply With Quote

