php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20069 GD 2.0.4 support broken in PHP 4.2.3, 4.3.x (maybe all)
Submitted: 2002-10-24 13:36 UTC Modified: 2002-10-24 13:39 UTC
From: matt at rp6 dot net Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 4.2.3 OS: GNU/Linux 2.4.19
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: matt at rp6 dot net
New email:
PHP Version: OS:

 

 [2002-10-24 13:36 UTC] matt at rp6 dot net
Compile Reproduction
--------------------
Compile with GD 2.0.4
Will fail out with:
---
In file included from gd.c:83:
gd_ctx.c: In function `_php_image_output_ctx':
gd_ctx.c:70: structure has no member named `free'
gd_ctx.c:98: structure has no member named `free'
gd.c: In function `_php_image_type':
gd.c:1014: structure has no member named `free'
gd.c:1017: structure has no member named `free'
gd.c: In function `_php_image_create_from':
gd.c:1209: structure has no member named `free'
make[3]: *** [gd.lo] Error 1
make[3]: Leaving directory `/home/pub/system/daemons/apache/24102002/mods/php-4.2.3/ext/gd'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/pub/system/daemons/apache/24102002/mods/php-4.2.3/ext/gd'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/pub/system/daemons/apache/24102002/mods/php-4.2.3/ext'
make: *** [all-recursive] Error 1
---

Compile arguments
-----------------
./configure --with-apache=../../apache_1.3.27 --enable-track-var         --with-mysql --with-gd=/usr/local         --with-jpeg-dir=/usr/local --with-zlib --with-zlib-dir=/usr/local --with-png-dir=/usr/local

DIFFs
-----
# `diff ext/gd/gd.c ext/gd/gd.c-4.2.3`:
1014c1014
<                               io_ctx->gd_free(io_ctx);
---
>                               io_ctx->free(io_ctx);
1017c1017
<                               io_ctx->gd_free(io_ctx);
---
>                               io_ctx->free(io_ctx);
1209c1209
<               io_ctx->gd_free(io_ctx);
---
>               io_ctx->free(io_ctx);

# `diff ext/gd/gd_ctx.c ext/gd/gd_ctx.c-4.2.3`
70c70
<               ctx->gd_free = _php_image_output_ctxfree;
---
>               ctx->free = _php_image_output_ctxfree;
98c98
<       ctx->gd_free(ctx);
---
>       ctx->free(ctx);

Solution
--------
The diff changes allowed the compile to go through. Apparently, the  method free() was renamed to gd_free().

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-24 13:39 UTC] derick@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the original bug instead.

Thank you for your interest in PHP.
 [2002-10-24 14:04 UTC] matt at rp6 dot net
Sorry. This is indeed a duplicate.
 [2002-10-24 14:06 UTC] matt at rp6 dot net
Also,

The original bug report only references 4.3.x. I'm saying this bug exists in all PHP versions. That should be noted by developers.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 10:01:33 2025 UTC