php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20995 gd.c:1345: structure has no member named `free'
Submitted: 2002-12-13 13:00 UTC Modified: 2002-12-14 03:34 UTC
From: tom at minnesota dot com Assigned:
Status: Closed Package: GD related
PHP Version: 4CVS-2002-12-13 (stable) OS: NetBSD/Alpha (64bit) - 1.6
Private report: No CVE-ID: None
 [2002-12-13 13:00 UTC] tom at minnesota dot com
/bin/sh libtool --silent --mode=compile gcc -I/usr/local/include -Iext/gd/ -I/usr/local_src
/php/php4-STABLE-200212131430/ext/gd/ -DPHP_ATOM_INC -I/usr/local_src/php/php4-STABLE-20021
2131430/include -I/usr/local_src/php/php4-STABLE-200212131430/main -I/usr/local_src/php/php
4-STABLE-200212131430 -I/usr/local_src/php/php4-STABLE-200212131430/Zend -I/usr/local/inclu
de -I/usr/pkg/include -I/usr/X11R6/include -I/usr/pkg/include/freetype2 -I/usr/pkg/include/
mysql -I/usr/local_src/php/php4-STABLE-200212131430/ext/xml/expat  -I/usr/pkg/include -I/us
r/local_src/php/php4-STABLE-200212131430/TSRM  -g -O2  -prefer-pic -c /usr/local_src/php/ph
p4-STABLE-200212131430/ext/gd/gd.c -o ext/gd/gd.lo
In file included from /usr/local_src/php/php4-STABLE-200212131430/ext/gd/gd.c:89:
/usr/local_src/php/php4-STABLE-200212131430/ext/gd/gd_ctx.c: In function `_php_image_output
_ctx':
/usr/local_src/php/php4-STABLE-200212131430/ext/gd/gd_ctx.c:73: structure has no member nam
ed `free'
/usr/local_src/php/php4-STABLE-200212131430/ext/gd/gd_ctx.c:105: structure has no member na
med `free'
/usr/local_src/php/php4-STABLE-200212131430/ext/gd/gd.c: In function `_php_image_type':
/usr/local_src/php/php4-STABLE-200212131430/ext/gd/gd.c:1156: structure has no member named
 `free'
/usr/local_src/php/php4-STABLE-200212131430/ext/gd/gd.c:1163: structure has no member named
 `free'
/usr/local_src/php/php4-STABLE-200212131430/ext/gd/gd.c: In function `_php_image_create_fro
m':
/usr/local_src/php/php4-STABLE-200212131430/ext/gd/gd.c:1345: structure has no member named
 `free'
gmake: *** [ext/gd/gd.lo] Error 1

--- 

I'm using gd-2.0.7

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-13 13:13 UTC] derick@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.
 [2002-12-13 13:15 UTC] msopacua@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 existing bug instead.

Thank you for your interest in PHP.

http://bugs.php.net/20083
 [2002-12-13 13:22 UTC] tom at minnesota dot com
I wished when you guys say that the bug was fixed in cvs, you should supply the date of the cvs version.

In my case, I compiled from cvs snapshot last night. So unless it was fixed this morning, I don't think it could be fixed in cvs.
 [2002-12-13 13:25 UTC] iliaa@php.net
I think the error you are seeing is due to your system having more then one gd library. Old gd versions by default went to /usr, while the new release go to /usr/local, the result is a header confusion responsible for the error you are seeing. To confirm this see if you have more then one copy of gd, by doing 'locate gd.h'.
 [2002-12-13 13:45 UTC] tom at minnesota dot com
I just checked, there is only one install of gd-2.0.7 and one gd.h ('locate gd.h' confirmed that).

in /usr/local_src/php/php4-STABLE-200212131430/ext/gd/gd.c:1345:

#if HAVE_LIBGD204
                io_ctx->gd_free(io_ctx);
#else
                io_ctx->free(io_ctx); <<<-- 1345
#endif

If it's doing line 1345 that means that configured failed to detect gd-2.0.7 being compatible with gd-2.0.4 to set the proper define.
 [2002-12-13 14:53 UTC] tom at minnesota dot com
checking config.log revealed:

configure:27284: gcc -c -g -O2  -I/usr/pkg/include conftest.c 1>&5
configure:27272: gd.h: No such file or directory
configure: failed program was:
#line 27270 "configure"
#include "confdefs.h"

#include <gd.h>
#include <stdlib.h>

int main() {

gdIOCtx *ctx;
ctx = malloc(sizeof(gdIOCtx));
ctx->gd_free = 1;

; return 0; }

seems like it can't find gd.h. very strange.

# locate gd.h
/usr/local/include/gd.h <<-- symlink
/usr/local_install/gd-2.0.7/include/gd.h
/usr/local_src/gd/gd-2.0.7/gd.h
/usr/local_src/php/php-4.2.2/ext/gd/php_gd.h
/usr/local_src/php/php4-STABLE-200212131430/ext/gd/libgd/gd.h
/usr/local_src/php/php4-STABLE-200212131430/ext/gd/php_gd.h
 [2002-12-13 14:59 UTC] msopacua@php.net
what's your configure line? (see config.nice)
 [2002-12-13 15:12 UTC] tom at minnesota dot com
config.nice:

'./configure' \
'--prefix=/usr/local_install/php-4.2.2' \
'--with-config-file-path=/usr/local/etc' \
'--with-gd=shared,/usr/local' \
'--with-curl=shared,/usr/local' \
'--with-system-regex' \
'--with-gettext=shared,/usr/pkg' \
'--with-pgsql=shared,/usr/local' \
'--with-mysql=shared,/usr/pkg' \
'--with-mcrypt=shared,/usr/pkg' \
'--with-pcre-regex' \
'--with-tiff-dir=/usr/pkg' \
'--with-jpeg-dir=/usr/pkg' \
'--with-png-dir=/usr/pkg' \
'--with-xpm-dir' \
'--with-ttf=/usr/pkg' \
'--with-freetype-dir=/usr/pkg' \
'--with-zlib-dir=shared,/usr' \
'--enable-dbase' \
'--enable-gd-native-ttf' \
'--enable-sysvsem' \
'--enable-sysvshm' \
'--enable-sockets' \
'--enable-xml' \
'--enable-trans-sid' \
'--enable-discard-path' \
'--enable-force-cgi-redirect' \
'--enable-memory-limit' \
'--enable-track-vars' \
'--without-t1lib' \
'--disable-static' \
'--enable-shared' \

Also note this snippet from 'configure':

 27268 cat > conftest.$ac_ext <<EOF
  27269 #line 27270 "configure"
  27270 #include "confdefs.h"
  27271
  27272 #include <gd.h>
  27273 #include <stdlib.h>
  27274
  27275 int main() {
  27276
  27277 gdIOCtx *ctx;
  27278 ctx = malloc(sizeof(gdIOCtx));
  27279 ctx->gd_free = 1;
  27280
  27281 ; return 0; }
  27282 EOF

---

27272 #include <gd.h>

my 'gd.h' is in '/usr/local/gd.h'. Seems like that include line is only looking in the system include path. It's not even using the path that was provided in --with-gd.
 [2002-12-14 03:34 UTC] sniper@php.net
Thank you for the good analysis. It's now fixed in CVS.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 18:01:36 2024 UTC