php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53585 PNG support broken, Abort trap: 6 (core dumped)
Submitted: 2010-12-21 08:18 UTC Modified: 2010-12-21 11:03 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: serge dot sitnikov at gmail dot com Assigned:
Status: Not a bug Package: GD related
PHP Version: 5.3.4 OS: FreeBSD 8.1-RELEASE
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: serge dot sitnikov at gmail dot com
New email:
PHP Version: OS:

 

 [2010-12-21 08:18 UTC] serge dot sitnikov at gmail dot com
Description:
------------
PNG support broken, completely. If PHP runs under Apache that will lead to 
workers exhaustion.

PHP 5.3.4 on FreeBSD 8.1-RELEASE amd64

array (
  'GD Version' => 'bundled (2.0.34 compatible)',
  'FreeType Support' => true,
  'FreeType Linkage' => 'with freetype',
  'T1Lib Support' => true,
  'GIF Read Support' => true,
  'GIF Create Support' => true,
  'JPEG Support' => true,
  'PNG Support' => true,
  'WBMP Support' => true,
  'XPM Support' => true,
  'XBM Support' => true,
  'JIS-mapped Japanese Font Support' => false,
)

png-1.4.4           Library for manipulating PNG images

Test script:
---------------
$image = imagecreatefrompng('/path/to/my/png/file');

Expected result:
----------------
Image opened.

Actual result:
--------------
Abort trap: 6 (core dumped)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-21 08:49 UTC] eugene at krivoruchko dot info
In FreeBSD 8.0
After update all port:
#portmanager -u

This problem resolved...
 [2010-12-21 09:26 UTC] serge dot sitnikov at gmail dot com
Unfortunately, upgrading and reinstalling all of PHP related ports does not solve 
the problem.
 [2010-12-21 10:24 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2010-12-21 10:24 UTC] pajoye@php.net
Not a php problem then :)
 [2010-12-21 10:25 UTC] pajoye@php.net
-Status: Bogus +Status: Feedback
 [2010-12-21 10:25 UTC] pajoye@php.net
@serge dot sitnikov at gmail dot com

Please provide the PNG image you use as test.
 [2010-12-21 10:40 UTC] serge dot sitnikov at gmail dot com
@pajoye@php.net

Image does not matter. Any PNG image I have tested lead to the same result -- 
core dumped. Already tested that on two machines.
 [2010-12-21 10:48 UTC] serge dot sitnikov at gmail dot com
@pajoye@php.net

You may test on that image, for example:

http://upload.wikimedia.org/wikipedia/commons/7/7a/Basketball.png
 [2010-12-21 11:03 UTC] pajoye@php.net
-Status: Feedback +Status: Bogus
 [2010-12-21 11:03 UTC] pajoye@php.net
Then it is definitively not a PHP problem. The tests suite work just fine, and all PNGs I use for testing as well (from the PNG tests suite and some other). Please report the issue to FreeBSD or update it as suggested in the other comment.
 [2011-11-17 00:17 UTC] andy at fud dot org dot nz
I can reproduce this on  FreeBSD 8.2-RELEASE (amd64)

the test script is
<?php
$im = imagecreatefrompng("test.png");
echo 'ok';
?>

test.png can be found at https://gg.net.nz/X/test.png


If I have the pdf extension loaded before gd (in extensions.ini) then I get an abort
--- snip of extensions.ini ---
extension=pdf.so
extension=gd.so
---
% php test.php
zsh: abort (core dumped)  php t.php


If I load gd first then the issue goes away
--- snip of extensions.ini ---
extension=gd.so
extension=pdf.so
---
% php test.php
ok          


The software versions are:
php5-5.3.8
php5-gd-5.3.8
pdflib-7.0.4
pecl-pdflib-2.1.8
png-1.4.8
 [2012-02-13 13:55 UTC] erik at erik dot eu
By changing the order in extensions.ini the problem doesn't go away.
It's moved to the latter module.

with sequence;
--- snip of extensions.ini ---
extension=pdf.so
extension=gd.so
---
pdf_load_image($pdfObject,"png", 'someimage.png'); will work
But png functions from GD won't!

with sequence;
--- snip of extensions.ini ---
extension=gd.so
extension=pdf.so
---
GD works but pdf_load_image will segfault.

doing portupgrade will alter the sequence in extensions.ini so GD works and it looks like problems are solved. But loading png in pdf will fail.

Enviroment;
Freebsd 8.2-RELEASE php5.3.10
just did portmaster -r png (13-feb-2012)
 [2012-03-02 01:40 UTC] dave at jetcafe dot org
Confirmed and duplicated on FreeBSD 7.3-RELEASE. Moving a crashing extension to the top just moves the bug down. I am unable to find any determinism (which doesn't mean none exists) in this. 

I appreciate that both the FreeBSD camps and PHP camps are pointing at each other. It would be greatly appreciated by those of us having a problem if someone from both camps could take a cooperative look. Thank you. :)
 [2012-03-02 05:26 UTC] Serge dot Sitnikov at gmail dot com
I found that recompiling all pecl extensions solve the problem, so this is some 
kind of dependency problem.
 [2012-05-22 08:38 UTC] andy at fud dot org dot nz
Putting the following patch in /usr/ports/print/pdflib/files/patch-pngusr.h and 
recompiling pdflib fixes the issue. There was a namespace conflict between the 
static png lib inside libpdf and libpdf.so.

https://gg.net.nz/X/patch-pngusr.h

I will get this committed to the pdflib port.
 [2012-06-06 01:54 UTC] andy at fud dot org dot nz
Updating to print/pdflib to 7.0.5_1 will resolve this issue.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 17:01:34 2025 UTC