Bug #18303 Updated: PHP crashes when ImagePNG() is used
| From: | thx dot 79 at schweiz dot org | Date: | Tue, 23 Jul 2002 01:29:26 +0000 |
| Subject: | Bug #18303 Updated: PHP crashes when ImagePNG() is used | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-14835@lists.php.net to get a copy of this message | ||
ID: 18303
Updated by: thx.79@schweiz.org
Reported By: thx.79@schweiz.org
-Status: Feedback
+Status: Open
Bug Type: GD related
Operating System: Linux (Kernel 2.4.4-4GB)
PHP Version: 4.2.1
New Comment:
Ok, you were right. Downgrading to libpng-1.0.14 was the right thing to
do.
But I still think this is a little bit odd and the problem still seems
to be somehow PHP-related, because if I compile GD with libpng-1.2.4
(which crashes in PHP) and then run 'make test', all PNG-Images are
generated without _any_ problem at all!
And, aren't there any functionalities missing, when I just have the
older version of libpng??
Bye, Thomas
Previous Comments:
------------------------------------------------------------------------
[2002-07-12 08:06:40] sniper@php.net
And make sure you really have compiled both PHP and GD with SAME
libraries (libpng, zlib..etc.)
------------------------------------------------------------------------
[2002-07-12 07:00:22] sander@php.net
I'm using libpng 1.0.12 and I don't have any problems. As Jani (sniper)
said on the orginal bugreport, libpng 1.2.x is reported to work badly
with libgd. You might try downgrading libpng to 1.0.x. If the problem
goes away, then it's probably not a bug in PHP.
------------------------------------------------------------------------
[2002-07-12 06:53:01] thx.79@schweiz.org
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 this bug report at http://bugs.php.net/?id=18303&edit=1