php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17659 Problems with ImagePNG.
Submitted: 2002-06-08 17:09 UTC Modified: 2002-07-11 14:18 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: tux at devel dot ee Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.2.1 OS: linux (2.4.17)
Private report: No CVE-ID: None
 [2002-06-08 17:09 UTC] tux at devel dot ee
Problems with ImagePNG.

I installed 4.2.1, but all scripts using ImagePNG() crashed. Apache generates this message:
[Fri Jun 7 10:01:25 2002] [notice] child pid 28042 exit signal Segmentation fault (11)

I tested same imagescripts with ImageJPEG(), and everything works fine...

Since this is an production server, i had to install 4.1.2 back (there's no problems with 4.1.2), and couldn't test things more...

my conf is:

./configure  --with-apache=../apache_1.3.24 \
                --enable-track-vars \
                --with-mysql \
                --enable-ftp \
                --enable-sockets \
                --with-zlib-dir=shared \
                --with-zip=/usr/local/lib \
                --with-gd=/home/tux/filez/gd-2.0.1 \
                --with-pdflib=/usr/local/lib \
                --with-freetype-dir=/usr/local/lib \
                --with-t1lib=/usr/local/lib \
                --enable-gd-native-ttf \
                --with-jpeg-dir=/usr/local/lib \
                --with-png-dir=/usr/local/lib \
                --with-tiff-dir=/usr/local/lib \
                --with-openssl \
                --with-curl=/usr/local/lib \
                --with-mcrypt=/usr/local/lib \
                --enable-ctype \
                --enable-exif \

im using libpng 1.2.1, zlib 1.1.4, jpeg-6b, gd 2.0.1, freetype 2.0.9

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-08 20:45 UTC] sniper@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
 [2002-07-02 03:11 UTC] thx dot 79 at schweiz dot org
Hello

I can reproduce the described Bug.
My System:
* SuSE Linux 7.3 (Kernel 2.4.4-4GB)
* Apache 1.3.24
* PHP 4.2.2-dev (http://snaps.php.net/php4-STABLE-200207010300.tar.gz)
  => but it's the same with PHP 4.2.1

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<---------------------------------------------------------

Backtrace:
8<---------------------------------------------------------
(gdb) run -X
Starting program: /usr/local/apache/bin/httpd -X

Program received signal SIGSEGV, Segmentation fault.
0x111 in ?? ()
(gdb) bt
#0  0x111 in ?? ()
#1  0x404a93a9 in png_create_write_struct_2 () from /usr/local/lib/libpng.so.3
#2  0x404aa802 in png_create_write_struct () from /usr/local/lib/libpng.so.3
#3  0x40536581 in gdImagePngCtx (im=0x8112448, outfile=0x811241c) at gd_png.c:461
#4  0x40295720 in _php_image_output_ctx (ht=1, return_value=0x81173cc, this_ptr=0x0, return_value_used=0, image_type=2,
    tn=0x403a48cb "PNG", func_p=0x40536520 <gdImagePngCtx>) at gd_ctx.c:94
#5  0x4029a30f in zif_imagepng (ht=1, return_value=0x81173cc, this_ptr=0x0, return_value_used=0) at gd.c:1480
#6  0x40243157 in execute (op_array=0x81179e4) at ./zend_execute.c:1598
#7  0x402550d4 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at zend.c:810
#8  0x40268d05 in php_execute_script (primary_file=0xbffff4b8) at main.c:1381
#9  0x40263280 in apache_php_module_main (r=0x8100fbc, display_source_mode=0) at sapi_apache.c:90
#10 0x40264200 in send_php (r=0x8100fbc, display_source_mode=0, filename=0x8101a94 "/home/www/thx/htdocs/image-png.php")
    at mod_php4.c:575
#11 0x40264283 in send_parsed_php (r=0x8100fbc) at mod_php4.c:590
#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.

Greetings
Thomas
 [2002-07-09 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2002-07-11 14:18 UTC] sniper@php.net
Try the LATEST snapshot, not the stable snapshot.
Also, libpng 1.2.x are reported to not work very well
with GD.

No use to reopen this unless the original reporter gives
feedback, edin..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 07:01:30 2024 UTC