segfault in perl

M

Mike

I am testing a program that is not yet in production that after a
while the program will segfault. There is no core left behind when
the segfault happens. How can I get a core from the segfault or is
there another way to diagnose the situation?

Mike

Fedora Core 5
perl 5.8.8
 
M

Mike

Assuming you're using bash or something similar to start the program,
type "help ulimit" and set the max core size to something larger than 0.


I like valgrind. http://valgrind.org/

example: valgrind myprogram.pl

Cheers,
Joost.

I didn't think about ulimit, thanks.
I'm running as a non-root user. I'll reset the core size and see what happens.

Mike

[recvmail@viper ~]$ ulimit
unlimited
[recvmail@viper ~]$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
max nice (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 16380
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
max rt priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 16380
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[recvmail@viper ~]$
 
M

Mike

<snip>
strace the process and
see what is happening just before the seg fault. Or maybe something like
<snip>

Oh, strace(8) is a really good idea, thanks.

Mike
 
J

Joost Diepenmaat

Mike said:
I am testing a program that is not yet in production that after a
while the program will segfault. There is no core left behind when
the segfault happens. How can I get a core from the segfault

Assuming you're using bash or something similar to start the program,
type "help ulimit" and set the max core size to something larger than 0.
or is
there another way to diagnose the situation?

I like valgrind. http://valgrind.org/

example: valgrind myprogram.pl

Cheers,
Joost.
 
X

xhoster

Mike said:
I am testing a program that is not yet in production that after a
while the program will segfault. There is no core left behind when
the segfault happens. How can I get a core from the segfault or is

On my system I also don't get a core dumps by default. That is because
my default limit (tcsh) or ulimit (bash) for coredumpsize is 0. Could
that be your issue as well?

there another way to diagnose the situation?

There are so many it is hard to know where to start without knowing more
about your code. Step through with the debugger; or strace the process and
see what is happening just before the seg fault. Or maybe something like
the below:

use Carp;
$SIG{SEGV}=sub {Carp::croak @_; };

(You probably need to set Environment variable PERL_SIGNALS to "unsafe"
in order to make this work)


Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top