php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2814 Crashes on GD calls
Submitted: 1999-11-24 02:36 UTC Modified: 2000-07-20 00:29 UTC
From: jmat at firewind dot net Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0 Latest CVS (24/11/1999) OS: Linux 2.2.13
Private report: No CVE-ID: None
 [1999-11-24 02:36 UTC] jmat at firewind dot net
This code:

<?php
Header("Content-type: image/gif");
$im = imagecreate(400,30);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
ImageTTFText($im, 20, 0, 10, 20, $white, "/web/a/ttf/arial.ttf", "Testing... Omega: &#937;");
ImageGif($im);
ImageDestroy($im);
?>

Kills PHP with a segmentation fault.  It didn't do this prior to 11/9/99 CVS's... it worked fine, without any problems.. I can't go back to CVS before 11/9, as there is a big problem with $a="hello";$a[1]="E"; :)

The backtrace looks useless, but maybe it will help y'all:

[root@kodiak src]# gdb /usr/local/apache/bin/httpd
GNU gdb 4.17.0.11 with Linux support
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...(no debugging symbols found)...
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X

Program received signal SIGSEGV, Segmentation fault.
0x8089be4 in strcpy ()
(gdb) bt
#0  0x8089be4 in strcpy ()
#1  0x0 in ?? ()
(gdb)

GD Library:  GD 1.3, using the redhat gd-1.3-5 RPMs
Compiler: gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
C Library: glibc 2.1.1
Apache version: 1.3.9
Kernel version: 2.2.13 x86

PHP configure line:
./configure --enable-debug --enable-trans-sid --with-mysql --with-gd --with-ttf --with-apache=/usr/s
rc/apache --enable-track-vars --enable-sysvshm --enable-sysvsem --with-config-file-path=/usr/local/l
ib

Apache configure line:

./configure --with-layout=Apache --prefix=/usr/local/apache --activate-module=src/modules/auth_mysql
/libauth_mysql.a --activate-module=src/modules/php4/libphp4.a --enable-module=rewrite --enable-module=status --enable-module=expires --enable-module=unique_id


These are 100% clean installs. I rm'd everything, re-checked-out the CVS, redownloaded the GD libraries, and the apache source.  Same results.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-24 17:43 UTC] jmat at firewind dot net
I've now compiled and installed GD 1.7.3 using the patches from http://www.list2.com/software/gd173_gif-1.tar.gz.  Also compiled and installed Freetype 1.3.

Same results, same crash, same backtrace.
 [2000-07-20 00:29 UTC] hholzgra at cvs dot php dot net
can't reproduce this with latest cvs, 
please reopen if it still crashes for you
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 20:00:02 2026 UTC