back trace when a SIGSEGV

Redondo Garcia, Roberto rredondo at indra.es
Tue Jan 17 21:29:50 EST 2006


my final solution has been to capture signal SIGSEGV in my own program
with a signal handler:  

signal(SIGSEGV, to segv_handler;  

and after generate backtrace in my program with the functions
"backtrace()" and "backtrace_symbols()" and write it to file.  

Thanks

example to generate backtrace:  
http://www.delorie.com/gnu/docs/glibc/libc_665.html 

-----Mensaje original-----
De: Dustin Lang [mailto:dalang at cs.ubc.ca] 
Enviado el: viernes, 02 de diciembre de 2005 15:28
Para: Redondo Garcia, Roberto
CC: linuxppc-dev
Asunto: Re: back trace when a SIGSEGV


Hi,

SIGSEGV (also known as a "segmentation fault" or "segfault") usually
means your program is doing something wrong like trying to dereference a
null pointer.  (ie, int* x = NULL; *x = 42;).  To track this down, you
can use "gdb" (the gnu debugger) - gnu.org.  Another option is
"valgrind" - valgrind.org - there is a PowerPC port (thanks, Paul!).

However, this mailing list is for _development_ of the linux _kernel_ on
PowerPC.  Your question is not about kernel development so it doesn't
belong here.  (Unless you are sure that your program is correct and
somehow the kernel is unfairly giving you a segfault - which doesn't
seem to be the case, based on your message.)  Find a mailing list or
message board about userspace programming and ask your question there.

Also, you should learn how to write a bug report.  Go to google.com,
type in "how to write a bug report", and read the first ten results.
(For
example: What program are you running?  Something you wrote?  What OS
are you using?  Why do you think the SIGSEGV is something caused by
someone else's code and not your own?  Why does it matter how long the
program runs before it crashes?  Why didn't you type "debug" into google
and see what came up?  (GDB is number 6!  Come on, get with it!))

Happy debugging!
dustin.

> hello,
> I have a program that when it has been several hours running, it has a

> problem and falls and it produces a SIGSEGV.  I would like to know to 
> how debug this error, because I do not have ulimit for generate core 
> dump o examine a back trace.
>
> thanks
-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente. POR FAVOR, ANTES DE IMPRIMIR ESTE CORREO ELECTRÓNICO CONSIDERE SU APORTACIÓN A LA CONSERVACIÓN DEL MEDIO AMBIENTE POR LA REDUCCIÓN DE CONSUMO DE PAPEL.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail. PLEASE CONSIDER YOUR ENVIRONMENTAL RESPONSIBILITY BEFORE PRINTING THIS E-MAIL.



More information about the Linuxppc-dev mailing list