LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   user-define signal handler & coredump for signal 11(SIGSEGV) (https://www.linuxquestions.org/questions/linux-software-2/user-define-signal-handler-and-coredump-for-signal-11-sigsegv-727800/)

Alexlun 05-22-2009 08:50 AM

user-define signal handler & coredump for signal 11(SIGSEGV)
 
Hello,
As we know, the defaule behavor will be generate a coredump for a process/thread received a signal 11, However, if I change the behavior for it by development a new signal handler, I didn't get the core file. So my question is:
1)I'd like to design a signal handler, and in this handler, I printf some userful info for the thread reveived the signal 11, but the most important of this, I'd like to generate the coredump just as the default behavior. So how i could do it?

Thank you in advance.

Alexlun 05-24-2009 06:05 AM

Hello,all:
Could you give me some hints?
That's very kind of you.
thanks.

Valery Reznic 05-24-2009 06:37 AM

Quote:

Originally Posted by Alexlun (Post 3550953)
Hello,all:
Could you give me some hints?
That's very kind of you.
thanks.

When you done with your custom signal handler, do something, that will trigger
additional segfault, for example
Code:

*(int *)0 = 1
But I dodn't sure that core dump after segfault interception will do help you.
What do you need this core dump for ?


All times are GMT -5. The time now is 02:38 AM.