in reply to malloc crash

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}; }

Replies are listed 'Best First'.
Re: Re: malloc crash
by Nygeve (Acolyte) on Dec 25, 2002 at 07:58 UTC
    "I first saw "perl in free(): warning: recursive call" repeating several times, then came this "perl in malloc(): warning: recursive call", and crash"
    I have exactly this stuff.

    "SO UPGRADE TO 5.8.0"
    I'm using standart FreeBSD4.7 perl. It has 5.005 version number. I always wanted to know: what is the 5.00x branch and the 5.x.x branch? Is 5.005 === 5.8.0?

      Nope 5.005 < 5.8.0

      For one big difference. 5.8 has threads and 5.005 does not.

        5.8 has threads and 5.005 does not.

        Well, actually support for threads was added in 5.005. Of course it was very experimental and it have changed significantly since this version.

        --
        Ilya Martynov, ilya@iponweb.net
        CTO IPonWEB (UK) Ltd
        Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
        Personal website - http://martynov.org

      GOK but this is how the version numbering goes with Perl 5

      5.004 == 5.4 5.005 == 5.5 5.6 == 5.6 (5.006) 5.8 == 5.8 (5.008)
      cheers

      tachyon

      s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print