[php-maint] php5-suhosin: T1Lib Error: Rasterization Aborted
Jan Wagner
waja at cyconet.org
Mon Apr 12 19:40:20 UTC 2010
tags 539307 + unreproducible
thanks
Hi Vladimir,
On Tuesday, 16. March 2010, Vladimir Stavrinov wrote:
> On Tue, Mar 16, 2010 at 10:54:45AM +0100, Jan Wagner wrote:
> > Anyways ... indicating from your backtrace, your crashing function seems
> > imagepsfreefont() and not imagepstext(), as you mentioned ealier.
>
> I have found the source of problem. It is chain of errors. It is right
> that imagepstext() fail. Why? Because it take boolean "FALSE" instead of
> image resource as first parameter. This value is returned by
> imagecreate() where height and width is calculated from imagepsbbox(),
> but this last function return wrong value for left x-coordinate if
> mt_rand() is used to generate random angle. Don't understand why. Here
> is short example:
>
> <?php
> $size = 64;
> $code = ($argv[1]) ? $argv[1] : date("r");
> $angle = 0;
> $angle = mt_rand(20,40)*((mt_rand(0,1)) ? 1 : -1);
> print "\$angle = " . $angle . "\n";
> $font = imagepsloadfont("/usr/share/fonts/type1/gsfonts/c059036l.pfb");
> print_r(imagepsbbox( $code, $font, $size, 0, 0, $angle ));
> ?>
>
> But when purge suhosin this problem go away. Thus there are something
> wrong in mt_rand() in conjunction with suhosin.
root at test:~# vi /etc/php5/
apache2/ cli/ conf.d/
root at test:~# vi /etc/php5/conf.d/suhosin.ini
root at test:~# cat /var/www/test.php
<?php
$size = 64;
$code = ($argv[1]) ? $argv[1] : date("r");
$angle = 0;
$angle = mt_rand(20,40)*((mt_rand(0,1)) ? 1 : -1);
print "\$angle = " . $angle . "\n";
$font = imagepsloadfont("/usr/share/fonts/type1/gsfonts/c059036l.pfb");
print_r(imagepsbbox( $code, $font, $size, 0, 0, $angle ));
?>
root at test:~# php5 /var/www/test.php
PHP Notice: Undefined offset: 1 in /var/www/test.php on line 3
$angle = -24
Array
(
[0] => -137438953
[1] => -416
[2] => 954
[3] => 43
)
root at test:~# dpkg -l |grep php5-suhosin
ii php5-suhosin 0.9.29-1+b1 advanced
protection module for php5
root at test:~# dpkg -l |grep php5-common
ii php5-common 5.3.2-1 Common files
for packages built from the php
Now purging php5-suhosin:
root at test:~# php5 /var/www/test.php
PHP Notice: Undefined offset: 1 in /var/www/test.php on line 3
$angle = -25
Array
(
[0] => -1
[1] => -434
[2] => 951
[3] => 43
)
root at test:~# dpkg -l |grep php5-suhosin
root at test:~#
I can't reproduce your problem, sorry.
With kind regards, Jan.
--
Never write mail to <waja at spamfalle.info>, you have been warned!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT d-- s+: a C+++ UL++++ P+ L+++ E--- W+++ N+++ o++ K++ w--- O M V- PS PE Y++
PGP++ t-- 5 X R tv- b+ DI D+ G++ e++ h---- r+++ y++++
------END GEEK CODE BLOCK------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-php-maint/attachments/20100412/14afe44e/attachment.pgp>
More information about the pkg-php-maint
mailing list