BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:

Update: The problem described in this post is fixed in GD v2.31 now on cpan.

Is there anything obvious as to why the "free to wrong pool" and segfault should happen, but only on the second call to this sub?

Does it occur on other platforms/versions?

#! perl -slw use strict; use GD; sub x{ my( $x, $y ) = @_; GD::Image->trueColor( 1 ); my $gd = GD::Image->new( $x, $y ); my $raw = $gd->gd; my $img = GD::Image->newFromGdData( $raw ) or die "$!, $^E"; return $img->jpeg; } print "Perl:$]; $GD::VERSION"; my $cap = x( 100, 100 ); printf 'Waiting'; <STDIN>; $cap = x( 100, 100 ); __END__ C:\Perl\test>junk3 Perl:5.008007; 2.28 Waiting Free to wrong pool 2227b0 not a797469 at C:\Perl\test\ line 9, + <STDIN> line 1.

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.