php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #17653 FAQ: use same png libraries with PHP and GD.
Submitted: 2002-06-08 07:12 UTC Modified: 2004-04-01 02:58 UTC
Votes:6
Avg. Score:4.7 ± 0.7
Reproduced:4 of 5 (80.0%)
Same Version:1 (25.0%)
Same OS:4 (100.0%)
From: huberfelix at web dot de Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.0CVS-2002-06-08 OS: Linux
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: huberfelix at web dot de
New email:
PHP Version: OS:

 

 [2002-06-08 07:12 UTC] huberfelix at web dot de
Hi,

I used 4.1.2 and everythings works fine - with Freetype 2.1 and GD 2.0.1 (Beta).

But now i tried 4.2.1 (and cvs 08.06.02) with the same config, and php segfaults. Other php pages (phpinfo() etc) are working fine with 4.2.1 - but no gd functions.


)
[Sat Jun  8 13:00:06 2002] [notice] child pid 29410 exit signal Segmentation fault (11)
[Sat Jun  8 13:00:14 2002] [notice] child pid 9319 exit signal Segmentation fault (11)
[Sat Jun  8 13:00:14 2002] [notice] child pid 16736 exit signal Segmentation fault (11)
[Sat Jun  8 13:00:14 2002] [notice] child pid 30265 exit signal Segmentation fault (11)
[Sat Jun  8 13:00:15 2002] [notice] child pid 6633 exit signal Segmentation fault (11)
[Sat Jun  8 13:00:15 2002] [notice] child pid 11331 exit signal Segmentation fault (11)
[Sat Jun  8 13:00:15 2002] [notice] child pid 4859 exit signal Segmentation fault (11)
[Sat Jun  8 13:00:16 2002] [notice] child pid 2575 exit signal Segmentation fault (11)
[Sat Jun  8 13:00:16 2002] [notice] child pid 2112

I can't understand this error, and compiled 4.1.2 again - and 4.1.2 still works fine.


./configure \
--with-apxs=/usr/local/apache/current/bin/apxs \
--with-xpm-dir=/usr/X11R6/lib \
--with-tiff-dir=/usr/lib \
--with-gif \
--with-jpeg-dir=/usr/lib \
--with-png-dir=/usr/lib \
--with-zlib-dir=/usr/lib \
--with-freetype-dir=/usr/local/include/freetype2 \
--with-bz2 \
--with-gdbm=/usr/local/lib \
--with-mysql=/usr/local/mysql/current \
--with-mcrypt \
--with-mhash \
--with-pear \
--with-openssl \
--with-cpdflib \
--with-pdflib \
--with-curl \
--with-expat \
--with-mm \
--with-xslt-sablot \
--with-gettext \
--with-db \
--with-db3 \
--with-dom \
--with-gd=/tmp/gd-2.0.1 \
--enable-gd-native-ttf \
--enable-gd-imgstrttf \
--enable-ftp \
--enable-versioning \
--enable-track-vars=yes \
--enable-url-includes \
--enable-sysvshm=yes \
--enable-sysvsem=yes \
--enable-ctype \
--enable-wddx \
--enable-xslt \
--with-config-file-path=/etc \
--with-imap=/tmp/imap-2001a \
--with-imap-ssl \
--with-zip


I use following script to test the config:

<?
header ("Content-type: image/png");
$im = imagecreate (500, 100);
$black = imagecolorallocate ($im, 0, 0, 0);
$white = imagecolorallocate ($im, 255, 255, 255);
imagettftext ($im, 20, 0, 10, 20, $white, "/usr/local/fonts/ttf/verdana.ttf", "UFOs are real!");
imagepng ($im);
imagedestroy ($im);
?>

Any hints?

Thanks for your help

Felix

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-08 08:07 UTC] sander@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-06-08 08:50 UTC] rasmus@php.net
Which version of libpng are you using?  Anything newer than 1.08 doesn't work.  Haven't looked into why yet.
 [2002-06-08 20:25 UTC] sniper@php.net
libpng 1.2.0 works just fine here (with GD 2.0.1)

 [2002-06-09 06:58 UTC] huberfelix at web dot de
I use libpng 1.2.1 - works fine with php 4.1.2

Here is the backtrace:

(gdb) bt
#0  0x00000049 in ?? ()
#1  0x00a33f49 in png_create_write_struct_2 () from /usr/lib/libpng.so.3
#2  0x00a35371 in png_create_write_struct () from /usr/lib/libpng.so.3
#3  0x00aa6d59 in gdImagePngCtx (im=0x8172630, outfile=0x8172604) at gd_png.c:461
#4  0x0047ee60 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#5  0x004838da in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#6  0x005f8ae7 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#7  0x005e5db4 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#8  0x005aec85 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#9  0x005fdde0 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#10 0x005fed58 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#11 0x005fede2 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#12 0x08055fd9 in ap_invoke_handler ()
#13 0x0806bb4f in ap_some_auth_required ()
#14 0x0806bbba in ap_process_request ()
#15 0x08062756 in ap_child_terminate ()
#16 0x08062935 in ap_child_terminate ()
#17 0x08062ab6 in ap_child_terminate ()
#18 0x0806314d in ap_child_terminate ()
#19 0x080639cc in main ()
#20 0x0019b571 in __libc_start_main () from /lib/libc.so.6
(gdb) 

png seems to be the problem ... i downloaded 1.0.8 now. will --with-png-dir=/tmp/libpng-1.0.8 help?

thanks
 [2002-06-09 06:58 UTC] huberfelix at web dot de
open
 [2002-06-09 07:27 UTC] huberfelix at web dot de
hmm i compiled cvs of today with --with-png-dir=/tmp/libpng-1.0.8

and still finds the newer libpng in /usr

0x00000049 in ?? ()
(gdb) bt
#0  0x00000049 in ?? ()
#1  0x00a33f49 in png_create_write_struct_2 () from /usr/lib/libpng.so.3
#2  0x00a35371 in png_create_write_struct () from /usr/lib/libpng.so.3
#3  0x00aa6d59 in gdImagePngCtx (im=0x8172318, outfile=0x81722ec) at gd_png.c:461
#4  0x0047ee80 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#5  0x004838fa in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#6  0x005f8b07 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#7  0x005e5dd4 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#8  0x005aeca5 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#9  0x005fde00 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#10 0x005fed78 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#11 0x005fee02 in object.11 () from /usr/local/apache/current/libexec/libphp4.so
#12 0x08055fd9 in ap_invoke_handler ()
#13 0x0806bb4f in ap_some_auth_required ()
#14 0x0806bbba in ap_process_request ()
#15 0x08062756 in ap_child_terminate ()
#16 0x08062935 in ap_child_terminate ()
#17 0x08062ab6 in ap_child_terminate ()
#18 0x0806314d in ap_child_terminate ()
#19 0x080639cc in main ()
#20 0x0019b571 in __libc_start_main () from /lib/libc.so.6
 [2002-06-09 10:40 UTC] sniper@php.net
I just tried with libpng-1.2.0, latest PHP (4.3.0-dev) and gd 2.0.1 (the 'original' without our fixes) and could not 
reproduce this segfault. 

Please try the latest (non stable!) snapshot from http://snaps.php.net/

--Jani

 [2002-06-09 10:41 UTC] sniper@php.net
Forgot..make sure your GD library is linked with the SAME
libpng as PHP is.

--Jani

 [2002-06-13 09:46 UTC] huberfelix at web dot de
Correct with libpng-1.0.8 as GD and PHP source it works fine... 

an entry for the faq?
 [2002-06-13 09:48 UTC] mfischer@php.net
Yup, good idea, reclassifying.
 [2004-04-01 02:58 UTC] irchtml@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 [2020-02-07 06:12 UTC] phpdocbot@php.net
Automatic comment on behalf of jan
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=bb61017173990fb6fbcf8149960b0c24d62ded46
Log: - fix #17653
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 06:01:30 2024 UTC