* back trace when a SIGSEGV
@ 2005-12-02 10:33 Redondo Garcia, Roberto
2005-12-02 14:27 ` Dustin Lang
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Redondo Garcia, Roberto @ 2005-12-02 10:33 UTC (permalink / raw)
To: linuxppc-dev
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 1457 bytes --]
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.
[-- Attachment #2: Type: text/html, Size: 2230 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: back trace when a SIGSEGV
2005-12-02 10:33 back trace when a SIGSEGV Redondo Garcia, Roberto
@ 2005-12-02 14:27 ` Dustin Lang
2005-12-04 22:14 ` Benjamin Herrenschmidt
2005-12-02 15:35 ` Wolfgang Denk
2005-12-04 22:16 ` Benjamin Herrenschmidt
2 siblings, 1 reply; 8+ messages in thread
From: Dustin Lang @ 2005-12-02 14:27 UTC (permalink / raw)
To: Redondo Garcia, Roberto; +Cc: linuxppc-dev
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: back trace when a SIGSEGV
2005-12-02 10:33 back trace when a SIGSEGV Redondo Garcia, Roberto
2005-12-02 14:27 ` Dustin Lang
@ 2005-12-02 15:35 ` Wolfgang Denk
2005-12-04 22:16 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Denk @ 2005-12-02 15:35 UTC (permalink / raw)
To: Redondo Garcia, Roberto; +Cc: linuxppc-dev
In message <6A28467355D2AD478D1F51C479415AE77B47E9@MADTORMAIL.indra.es> you wrote:
>
> 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.
Run the program under control of a debugger (gdb, or - if you're on a
resource-limited target - gdbserver).
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
Es ist nicht genug zu wissen, man muß auch anwenden; es ist nicht ge-
nug zu wollen, man muß auch tun. -- Goethe, Maximen und Reflexionen
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: back trace when a SIGSEGV
2005-12-02 14:27 ` Dustin Lang
@ 2005-12-04 22:14 ` Benjamin Herrenschmidt
2005-12-05 1:20 ` Dustin Lang
0 siblings, 1 reply; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2005-12-04 22:14 UTC (permalink / raw)
To: Dustin Lang; +Cc: linuxppc-dev, Redondo Garcia, Roberto
> 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.
>
> .../...
You don't need to play the cop on this list, nobody appointed you to
that position.
Ben.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: back trace when a SIGSEGV
2005-12-02 10:33 back trace when a SIGSEGV Redondo Garcia, Roberto
2005-12-02 14:27 ` Dustin Lang
2005-12-02 15:35 ` Wolfgang Denk
@ 2005-12-04 22:16 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2005-12-04 22:16 UTC (permalink / raw)
To: Redondo Garcia, Roberto; +Cc: linuxppc-dev
On Fri, 2005-12-02 at 11:33 +0100, Redondo Garcia, Roberto wrote:
> 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.
You can run your program under gdb, or you may want to have a look at
tridge' junk code directory for his segv_handler bit that you can put in
LD_PRELOAD
http://www.samba.org/junkcode/#segv_handler
Ben.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: back trace when a SIGSEGV
2005-12-04 22:14 ` Benjamin Herrenschmidt
@ 2005-12-05 1:20 ` Dustin Lang
2005-12-05 1:23 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 8+ messages in thread
From: Dustin Lang @ 2005-12-05 1:20 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Redondo Garcia, Roberto
Hi,
> You don't need to play the cop on this list, nobody appointed you to
> that position.
Fair enough. But do you think my reply, over all, was unreasonable?[1] I
made an attempt to answer his question, pointing out two of the most
useful resources. I also told him that his question wasn't really suited
to the list - I would have listed some better resources but I'm not
familiar with any - but I tried to write a balanced,
gentle-push-in-the-right-direction, sort of message. Re-reading the
snippet you highlighted, it does sound rude. It wasn't meant to be.
(Roberto, please accept my apologies!)
Anyway, I'll go back to my lurking now.
Cheers,
dstn.
[1] Rhetorical question. If you feel like replying, can I suggest we take
it off-list? (Not trying to be a list-cop or anything, of course... :)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: back trace when a SIGSEGV
2005-12-05 1:20 ` Dustin Lang
@ 2005-12-05 1:23 ` Benjamin Herrenschmidt
0 siblings, 0 replies; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2005-12-05 1:23 UTC (permalink / raw)
To: Dustin Lang; +Cc: linuxppc-dev, Redondo Garcia, Roberto
On Sun, 2005-12-04 at 17:20 -0800, Dustin Lang wrote:
> Hi,
>
> > You don't need to play the cop on this list, nobody appointed you to
> > that position.
>
> Fair enough. But do you think my reply, over all, was unreasonable?[1] I
> made an attempt to answer his question, pointing out two of the most
> useful resources. I also told him that his question wasn't really suited
> to the list - I would have listed some better resources but I'm not
> familiar with any - but I tried to write a balanced,
> gentle-push-in-the-right-direction, sort of message. Re-reading the
> snippet you highlighted, it does sound rude. It wasn't meant to be.
> (Roberto, please accept my apologies!)
The s/n ratio of this list is good enough to make such occasional
questions acceptable.
Ben.
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: back trace when a SIGSEGV
@ 2006-01-17 10:29 Redondo Garcia, Roberto
0 siblings, 0 replies; 8+ messages in thread
From: Redondo Garcia, Roberto @ 2006-01-17 10:29 UTC (permalink / raw)
Cc: linuxppc-dev
my final solution has been to capture signal SIGSEGV in my own program
with a signal handler: =20
signal(SIGSEGV, to segv_handler; =20
and after generate backtrace in my program with the functions
"backtrace()" and "backtrace_symbols()" and write it to file. =20
Thanks
example to generate backtrace: =20
http://www.delorie.com/gnu/docs/glibc/libc_665.html=20
-----Mensaje original-----
De: Dustin Lang [mailto:dalang@cs.ubc.ca]=20
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 =3D NULL; *x =3D 42;). To track this down, yo=
u
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=20=
> how debug this error, because I do not have ulimit for generate core=20=
> dump o examine a back trace.
>
> thanks
-------------------------------------------------------------------------=
------------------------------------------
Este correo electr=F3nico y, en su caso, cualquier fichero anexo al mismo=
, contiene informaci=F3n de car=E1cter confidencial exclusivamente dirigi=
da a su destinatario o destinatarios. Queda prohibida su divulgaci=F3n, c=
opia o distribuci=F3n a terceros sin la previa autorizaci=F3n escrita de =
Indra. En el caso de haber recibido este correo electr=F3nico por error, =
se ruega notificar inmediatamente esta circunstancia mediante reenv=EDo a=
la direcci=F3n electr=F3nica del remitente. POR FAVOR, ANTES DE IMPRIMIR=
ESTE CORREO ELECTR=D3NICO CONSIDERE SU APORTACI=D3N A LA CONSERVACI=D3N =
DEL MEDIO AMBIENTE POR LA REDUCCI=D3N 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 here=
by notified that any dissemination, distribution or copy of this communic=
ation is prohibited without the prior written consent of Indra. If you ha=
ve received this communication in error, please, notify the sender by rep=
ly e-mail. PLEASE CONSIDER YOUR ENVIRONMENTAL RESPONSIBILITY BEFORE PRINT=
ING THIS E-MAIL.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2006-01-17 10:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-02 10:33 back trace when a SIGSEGV Redondo Garcia, Roberto
2005-12-02 14:27 ` Dustin Lang
2005-12-04 22:14 ` Benjamin Herrenschmidt
2005-12-05 1:20 ` Dustin Lang
2005-12-05 1:23 ` Benjamin Herrenschmidt
2005-12-02 15:35 ` Wolfgang Denk
2005-12-04 22:16 ` Benjamin Herrenschmidt
-- strict thread matches above, loose matches on Subject: below --
2006-01-17 10:29 Redondo Garcia, Roberto
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 NNTP newsgroup(s).