Two sides:
  1. I know, in old versions of Perl, including 5.6.1, there were problems with signal+memory access.

    For example, I have a test case, in which I have one parent process and one forked child process. The parent process keep sending signals to the child, and the child just write to some random position in a big sparse array, each time it receives signal.

    In the past, when I tested it with 5.6.1, I first saw "perl in free(): warning: recursive call" repeating several times, then came this "perl in malloc(): warning: recursive call", and crashed.

    I just tested it again with 5.8.0, it appeared to have been fixed already.

    SO UPGRADE TO 5.8.0
  2. So all the memory problems are gone? NO, and this probably will never happen, although we will see Perl become more and more stable, and less problems with memory access. Remember the purpose of testing is not to prove the application is 100% correct, but to find bugs. Especially with any c based application, memory related problems are the most naughty ones.

    I also tested the following case with 5.8.0 + win32, and it still crashed, complaining "free to wrong pool".
    my %hash = map {$_,"Merry Christmas!"} (1..100); foreach my $value (values %hash) { crash_it(\%hash, $value); } sub crash_it { my ($hash, $value) = @_; delete $hash->{1}; }

In reply to Re: malloc crash by pg
in thread malloc crash by Nygeve

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.