perlquestion
BrowserUk
<p>Update: The problem described in this post is fixed in GD v2.31 now on cpan.
<p>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?
<p>Does it occur on other platforms/versions?
<code>
#! 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\junk3.pl line 9, <STDIN> line 1.
</code>
<div class="pmsig"><div class="pmsig-171588">
<hr />
<font size=1 >
<div>Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.</div>
<div>Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?</div>
<div>"Science is about questioning the status quo. Questioning authority". </div>
<div>In the absence of evidence, opinion is indistinguishable from prejudice.</div>
</font>
</div></div>