segfault in perl

Discussion in 'Perl Misc' started by Mike, Mar 19, 2008.

  1. Mike

    Mike Guest

    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

    --
    Posted via a free Usenet account from http://www.teranews.com
    Mike, Mar 19, 2008
    #1
    1. Advertising

  2. Mike

    Mike Guest

    In article <>, Joost Diepenmaat wrote:
    > Mike <> writes:
    >
    >> 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.
    >


    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 ~]$


    --
    Posted via a free Usenet account from http://www.teranews.com
    Mike, Mar 19, 2008
    #2
    1. Advertising

  3. Mike

    Mike Guest

    In article <20080319124937.495$>, wrote:
    > <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

    --
    Posted via a free Usenet account from http://www.teranews.com
    Mike, Mar 19, 2008
    #3
  4. Mike <> writes:

    > 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.

    --
    Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
    Joost Diepenmaat, Mar 19, 2008
    #4
  5. Mike

    Guest

    Mike <> wrote:
    > 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.
    , Mar 19, 2008
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vedran Vyroubal

    STL string segfault

    Vedran Vyroubal, Mar 3, 2004, in forum: C++
    Replies:
    5
    Views:
    1,308
    Vedran Vyroubal
    Mar 4, 2004
  2. Arthur J. O'Dwyer

    multiset segfault

    Arthur J. O'Dwyer, Jun 17, 2004, in forum: C++
    Replies:
    10
    Views:
    706
    Dave Townsend
    Jun 18, 2004
  3. Jim Strathmeyer

    istream segfault

    Jim Strathmeyer, Jul 22, 2004, in forum: C++
    Replies:
    4
    Views:
    416
    Mike Wahler
    Jul 23, 2004
  4. Andrey Vul
    Replies:
    8
    Views:
    670
    Richard Bos
    Jul 30, 2010
  5. James Harris

    perl segfault - how to troubleshoot

    James Harris, Dec 2, 2008, in forum: Perl Misc
    Replies:
    39
    Views:
    568
    James Harris
    Dec 9, 2008
Loading...

Share This Page