ID: 28263 Comment by: scottmacvicar at ntlworld dot com Reported By: Rich dot West at wesmo dot com Status: Open Bug Type: GD related Operating System: Fedora Core 1 PHP Version: 4.3.6 New Comment:
I had the same problem using the latest releases of libpng and had to go back to an older version. It would happen for any png image. Was using Red Hat Enterprise Previous Comments: ------------------------------------------------------------------------ [2004-05-06 16:54:14] Rich dot West at wesmo dot com Any PNG image will do it. I woul attach it, but there's no interface here to attach the images that I tested with. ------------------------------------------------------------------------ [2004-05-06 14:40:31] [EMAIL PROTECTED] Please provide the source image. ------------------------------------------------------------------------ [2004-05-03 19:22:22] Rich dot West at wesmo dot com Description: ------------ After upgrading from PHP 4.3.3 to 4.3.5, and then again to 4.3.6, I discovered that image generation calls to create PNG files were producing zero length images. I dug through it further by testing with the CLI version of PHP, and it appears that if a PNG image is being created, the process with segfault. I was able to compile PHP 4.3.3 on this machine using the configure options below, and, after running the test script through php, it would properly output a PNG file. Using the same configure options for PHP 4.3.5 and PHP 4.3.6, the operation segfaults (and creates a core file) when creating a PNG file. It works just fine when creating a JPEG file. I can consistently get things to work for PHP 4.3.3 and I can consistently get it to NOT work for PHP 4.3.5 and PHP 4.3.6... Oh, and, yes, my GD and libpng10/libpng libraries are linked properly.. >From phpinfo(): './configure' '--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4=/usr' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-dom=shared,/usr' '--with-dom-xslt=/usr' '--with-dom-exslt=/usr' '--with-xmlrpc=shared' '--with-pcre=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-ldap=shared' '--with-pdflib' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' '--enable-mbregex' '--with-apxs2=/usr/sbin/apxs' Reproduce code: --------------- <?php header("Content-type: image/png"); $string = "Test"; $im = imagecreatefrompng("image.png"); $orange = imagecolorallocate($im, 220, 210, 60); $px = (imagesx($im) - 7.5 * strlen($string)) / 2; imagestring($im, 3, $px, 9, $string, $orange); imagepng($im); imagedestroy($im); ?> Expected result: ---------------- Result should have been a PNG image. Actual result: -------------- #0 0x00002009 in ?? () #1 0x00f1d850 in png_create_struct_2 () from /usr/lib/libpdf.so.1 #2 0x00997dcd in png_create_info_struct () from /usr/lib/libpng12.so.0 #3 0x080c1b72 in gdImageCreateFromPngCtx () #4 0x080c1a61 in gdImageCreateFromPng () #5 0x080af917 in zif_imagecreatefromstring () #6 0x080afbea in zif_imagecreatefrompng () #7 0x0a11aa34 in ?? () ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=28263&edit=1