Perl:5.008007; 2.30Waiting *** glibc detected *** free(): invalid pointer: 0x08281410 ***
Curiously, if I put the second call in a separate sub, it runs error free.
#!/usr/bin/perl use warnings; use strict; use GD; print "Perl:$]; $GD::VERSION"; my $cap = x( 100, 100 ); printf 'Waiting'; <STDIN>; $cap = zz( 100, 100 ); ################################################# 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; } sub zz{ 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; }
In reply to Re: Segfault on second (identical) call to a sub
by zentara
in thread Segfault on second (identical) call to a sub
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |