php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4873 Apache child crash when use ImagePng();
Submitted: 2000-06-07 18:55 UTC Modified: 2000-10-28 23:44 UTC
From: sitnikov at infonet dot ee Assigned:
Status: Closed Package: Reproducible Crash
PHP Version: 4.0.0 Release OS: Linux 2.2.14-5.0 #1 Tue Mar 7 21
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sitnikov at infonet dot ee
New email:
PHP Version: OS:

 

 [2000-06-07 18:55 UTC] sitnikov at infonet dot ee
<?
Header( "Content-type: image/png");

$im = ImageCreate(200, 200);
$black = ImageColorAllocate($im, 0, 0, 0);
$white = ImageColorAllocate($im, 255, 255, 255);

$blue  = ImageColorAllocate($im, 0, 0, 255);
$red   = ImageColorAllocate($im, 255, 0, 0);
$green = ImageColorAllocate($im, 0, 255, 0);

$blue1  = ImageColorAllocate($im, 100, 0, 255);
$red1   = ImageColorAllocate($im, 255,100, 0);
$green1 = ImageColorAllocate($im, 0, 255, 100);

ImageLine($im, 1, 1, 199, 199, $white);
ImageLine($im, 199, 1, 1, 199, $white);

ImageTTFText($im, 36, 0, 1, 30,$blue,  "TEXTBKB.TTF", "TEST TEST");

ImagePng($im);
ImageDestroy($im);
?>

gdb backtrace:

Program received signal SIGSEGV, Segmentation fault.
crc32 (crc=0x4, given_buf=0x400bf660, len=4) at crc32.c:107
107                     (*crc) = ((*crc) << 8) ^ crc32_table[((*crc) >> 24) ^ *p];
(gdb) bt
#0  crc32 (crc=0x4, given_buf=0x400bf660, len=4) at crc32.c:107
#1  0x40091a18 in png_calculate_crc () from /usr/local/lib/libpng.so.2
#2  0x400a2739 in png_write_chunk_start () from /usr/local/lib/libpng.so.2
#3  0x4009ce46 in png_write_IHDR () from /usr/local/lib/libpng.so.2
#4  0x400a53e5 in png_write_info_before_PLTE () from /usr/local/lib/libpng.so.2
#5  0x400a55c2 in png_write_info () from /usr/local/lib/libpng.so.2
#6  0x8145b50 in gdImagePngCtx ()
#7  0x81456c1 in gdImagePng ()
#8  0x809f07b in php_if_imagepng (ht=1, return_value=0x82ef72c, this_ptr=0x0, return_value_used=0) at gd.c:513
#9  0x80f179c in execute (op_array=0x821ced4) at ./zend_execute.c:1574
#10 0x808002b in php_execute_script (primary_file=0xbffff828) at main.c:1198
#11 0x809db20 in apache_php_module_main (r=0x822ad7c, fd=34, display_source_mode=0) at sapi_apache.c:93
#12 0x807c23a in send_php ()
#13 0x807c73b in send_parsed_php ()
#14 0x810eb11 in ap_invoke_handler ()
#15 0x811e011 in process_request_internal ()
#16 0x811e35f in ap_process_request ()
#17 0x8116a41 in child_main ()
#18 0x8116c47 in startup_children ()
#19 0x811745d in standalone_main ()
#20 0x8117dfb in main ()
#21 0x401969cb in __libc_start_main (main=0x81179c4 <main>, argc=2, argv=0xbffffa54, init=0x806373c <_init>, 
    fini=0x814653c <_fini>, rtld_fini=0x4000ae60 <_dl_fini>, stack_end=0xbffffa4c)
    at ../sysdeps/generic/libc-start.c:92

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-08 22:42 UTC] waldschrott@php.net
Please verify that it?s still happening using the latest version of PHP (release 4.0.1pl2 or CVS).
 [2000-08-14 07:24 UTC] waldschrott@php.net
user comment:

"This bug is present at the version release 4.0.1pl2. As I
have understood a problem In that in mhash-0.6.1 too have
function "crc32" and gd use this function. After removal
--with-mhash =/work/mhash-0.6.1 problem disappears."


 [2000-10-11 09:28 UTC] jmoore@php.net
Can you see if this has been fixed in latest RC, you can download this from http://www.php.net/~andi/, It looks like a version incompatibilty between mhash and gd to me, can you please update both of these as well and try with the new versions.

Thanks

James
 [2000-10-28 23:44 UTC] sniper@php.net
No feedback and should be fixed.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 01:01:33 2025 UTC