#23122 [Com]: ImageTTFText causes segmentation fault while under Apache

From: Date: Wed, 20 Aug 2003 16:24:25 +0000
Subject: #23122 [Com]: ImageTTFText causes segmentation fault while under Apache
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-46324@lists.php.net to get a copy of this message
 ID:               23122
 Comment by:       paul at cactusltd dot co dot uk
 Reported By:      1413 at blargh dot com
 Status:           Closed
 Bug Type:         GD related
 Operating System: Debian Linux
 PHP Version:      4.3.2-RC
 New Comment:

I too get Apache segfaults when using the imagettftext function
(scripts do other image things and works fine when not calling
imagettftext - plus have tried many options/fonts in that func with
same results).

PHP Version 4.3.2
Slackware 9

Configure options:
'./configure' '--prefix=/opt/php-4.3.2' '--without-pear'
'--enable-exif' '--with-freetype-dir=/opt/freetype-2.1.4'
'--with-gd=/opt/gd-2.0.15' '--enable-gd-native-ttf'
'--with-mysql=/opt/mysql-3.23.57'
'--with-apxs=/opt/apache-1.3.28/bin/apxs'

I just upgraded to Apache 1.3.28 from .27 but get the same results:

[Wed Aug 20 12:33:30 2003] [notice] child pid 12542 exit signal
Segmentation fault (11)
[Wed Aug 20 12:33:30 2003] [notice] child pid 12530 exit signal
Segmentation fault (11)
[Wed Aug 20 12:33:30 2003] [notice] child pid 12529 exit signal
Segmentation fault (11)
[Wed Aug 20 12:33:30 2003] [notice] child pid 12528 exit signal Illegal
instruction (4)
[Wed Aug 20 12:33:31 2003] [notice] child pid 12546 exit signal
Segmentation fault (11)
[Wed Aug 20 12:33:31 2003] [notice] child pid 12545 exit signal
Segmentation fault (11)
[Wed Aug 20 12:33:32 2003] [notice] child pid 12549 exit signal
Segmentation fault (11)
[Wed Aug 20 12:33:45 2003] [notice] child pid 12551 exit signal
Segmentation fault (11)

Note the 
[Wed Aug 20 12:33:30 2003] [notice] child pid 12528 exit signal Illegal
instruction (4)

Which appears every 20th line or so.  Page after page of segfault
error.  I just grabbed the latest versions of Free Type, GD and PHP as
well as Apache but the bug's still there I'm afraid Rasmus.


Previous Comments:
------------------------------------------------------------------------

[2003-07-06 05:21:21] igor at gelios dot net

This bug is not completly closed. ;(

I have same troubles with PHP _4.3.2_

Linux RH9, Apache 1.3.27, gd 2.0.15, freetype 2.14

PHP Configure options:

'./configure' '--with-apxs=/usr/local/apache/bin/apxs'
'--with-mysql=/usr/local/mysql'  '--with-gd=../GD/gd-2.0.15'
'--with-zlib-dir=../zlib.1.1.4' '--with-jpeg-dir=../jpeg-6b'
'--with-png-dir=../libpng-1.2.5'
'--with-freetype-dir=../freetype-2.1.4' '--enable-gd-native-ttf' 


test script (see below) draw test line correctly, but apache child
crashes with log message:

[Sun Jul  6 14:14:24 2003] [notice] child pid 28704 exit signal
Segmentation fault (11)


test script:

<?
$Width=500;
$Height=200;

$Image = ImageCreateTrueColor($Width, $Height);

$BgColorHandle = ImageColorAllocate($Image, 200,200,200);
$TextColorHandle = ImageColorAllocate($Image, 0,0,0);

ImageFilledRectangle($Image, 1, 1, $Width-2, $Height-2,
$BgColorHandle);

$Font = '/usr/home/httpd/misc/admin/syscounters/verdana.ttf';
ImageTTFText($Image, 8, 0, 100, 50, $TextColorHandle, $Font, 'Test GD
string');


Header("Content-type: image/jpeg");
Header("Content-disposition: inline");

ImageJpeg($Image);

ImageColorDeallocate($Image, $BgColorHandle);
ImageColorDeallocate($Image, $TextColorHandle);

ImageDestroy($Image);
?>

------------------------------------------------------------------------

[2003-04-30 12:15:05] eru@php.net

This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.



------------------------------------------------------------------------

[2003-04-30 12:06:50] eru@php.net

Works for me now, no more segfaults.


------------------------------------------------------------------------

[2003-04-30 11:44:03] rasmus@php.net

I think I just fixed this issue.  The bt doesn't look the same, but the
fact that it only happens on the second request would indicate that it
was getting a bogus cache pointer which is what I fixed.  Someone
please verify that this doesn't happen under current CVS.

------------------------------------------------------------------------

[2003-04-25 05:48:34] sniper@php.net

Note: This happens on the 2nd run on same apache child.


------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/23122

-- 
Edit this bug report at http://bugs.php.net/?id=23122&edit=1



Thread (20 messages)

« previous php.bugs (#46324) next »