Bug #18303: PHP crashes when ImagePNG() is used
| From: | thx dot 79 at schweiz dot org | Date: | Fri, 12 Jul 2002 10:53:02 +0000 |
| Subject: | Bug #18303: PHP crashes when ImagePNG() is used | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-13955@lists.php.net to get a copy of this message | ||
From: thx.79@schweiz.org
Operating system: Linux (Kernel 2.4.4-4GB)
PHP version: 4.2.1
PHP Bug Type: GD related
Bug description: PHP crashes when ImagePNG() is used
This report is a follow up for http://bugs.php.net/bug.php?id=17659 which
was set to Status 'Bogus' because the original reporter didn't provide the
requested feeback.
So once more: PHP crashes with 'Segmentation Fault' when I use
ImagePNG().
My System:
* SuSE Linux 7.2 (Kernel 2.4.4-4GB)
* Apache 1.3.24
* PHP-4.3.0-dev -> 'php4-200207111200', which was 'php4-latest' last night
(July 11th 2002).
=> But it's the same with PHP-4.2.1 & PHP-4.2.2-dev
* GD 2.0.1
* zlib-1.1.4
* libpng-1.2.4
The Script:
8<--------------------------------------------------------
<?php
$dstWidth = 100 ;
$dstHeight = 100 ;
$dstImg = ImageCreate( $dstWidth, $dstHeight );
$bgCol = ImageColorAllocate( $dstImg, 0, 0, 0 );
$col = ImageColorAllocate( $dstImg, 255, 255, 0 );
ImageString( $dstImg, 4, 5, 5, "TEST" ,$col );
header( "Content-type: image/png" );
ImagePNG( $dstImg );
ImagePNG( $dstImg, "test.png" );
ImageDestroy( $dstImg );
?>
8<--------------------------------------------------------
The Backtrace:
8<--------------------------------------------------------
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X
Program received signal SIGSEGV, Segmentation fault.
0xa01 in ?? ()
(gdb) bt
#0 0xa01 in ?? ()
#1 0x405039d9 in png_create_write_struct_2 () from
/usr/local/lib/libpng12.so.0
#2 0x40504e42 in png_create_write_struct () from
/usr/local/lib/libpng12.so.0
#3 0x4058e13e in gdImagePngCtx () from /usr/local/lib/libgd.so
#4 0x40249360 in _php_image_output_ctx (ht=1, return_value=0x811aaf4,
this_ptr=0x0, return_value_used=0, image_type=2,
tn=0x403dc36d "PNG", func_p=0x4058e0d0 <gdImagePngCtx>) at
/usr/local/src/php4-200207111200/ext/gd/gd_ctx.c:94
#5 0x4024e27f in zif_imagepng (ht=1, return_value=0x811aaf4,
this_ptr=0x0, return_value_used=0)
at /usr/local/src/php4-200207111200/ext/gd/gd.c:1432
#6 0x403c0a67 in execute (op_array=0x81158a4) at
/usr/local/src/php4-200207111200/Zend/zend_execute.c:1587
#7 0x403adb84 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
at /usr/local/src/php4-200207111200/Zend/zend.c:810
#8 0x403765d1 in php_execute_script (primary_file=0xbffff458) at
/usr/local/src/php4-200207111200/main/main.c:1388
#9 0x403c5d90 in apache_php_module_main (r=0x810a9f4,
display_source_mode=0)
at /usr/local/src/php4-200207111200/sapi/apache/sapi_apache.c:55
#10 0x403c6d40 in send_php (r=0x810a9f4, display_source_mode=0,
filename=0x810b474 "/home/www/thx/htdocs/image-png.php")
at /usr/local/src/php4-200207111200/sapi/apache/mod_php4.c:550
#11 0x403c6dc3 in send_parsed_php (r=0x810a9f4) at
/usr/local/src/php4-200207111200/sapi/apache/mod_php4.c:565
#12 0x8054799 in ap_invoke_handler ()
#13 0x806a96f in process_request_internal ()
#14 0x806a9e2 in ap_process_request ()
#15 0x8061336 in child_main ()
#16 0x80614f5 in make_child ()
#17 0x8061676 in startup_children ()
#18 0x8061d1d in standalone_main ()
#19 0x806257c in main ()
#20 0x400b2c6f in __libc_start_main () from /lib/libc.so.6
8<--------------------------------------------------------
If you need anything else, I'd be delighted to help.
Bye, Thomas
--
Edit bug report at http://bugs.php.net/?id=18303&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=18303&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=18303&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=18303&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=18303&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18303&r=support
Expected behavior: http://bugs.php.net/fix.php?id=18303&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=18303&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=18303&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=18303&r=globals