#21533 [Opn->Csd]: Trouble building PHP w/ GD and including ImageTTFxxx functions
| From: | iliaa@php.net | Date: | Fri, 24 Jan 2003 19:24:22 +0000 |
| Subject: | #21533 [Opn->Csd]: Trouble building PHP w/ GD and including ImageTTFxxx functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-31176@lists.php.net to get a copy of this message | ||
ID: 21533
Updated by: iliaa@php.net
Reported By: jeffabruce@hotmail.com
-Status: Open
+Status: Closed
Bug Type: GD related
Operating System: RH 7.2
PHP Version: 4.3.0
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2003-01-22 17:30:55] jeffabruce@hotmail.com
I would like to help you, but it would take some time to get my server
back in the state where the error was occurring. I have since installed
FreeType 2.x so that now things do build and work correctly.
So, I can't confirm the fact that the crash would go away. But, since
variable "error" is undefined, it easily could cause a crash. Certainly
initializing it to NULL would improve the "random" nature of undefined
variables.
My original post was meant to help out the development of PHP by
relaying my experience and pointing to specific lines of code that seem
problematic. There is clearly a mistake in the gd.c code. You may
choose not to do anything about it. And, it may not affect too many
installations, but any decent software engineer would say that the code
is risky at best.
------------------------------------------------------------------------
[2003-01-22 17:08:34] iliaa@php.net
If you change char *error; to char *error = NULL; does the segmentation
fault you are seeing go away?
------------------------------------------------------------------------
[2003-01-22 13:57:11] jeffabruce@hotmail.com
The version of gd.c that I have is supposed to be 4.3.0. I still
believe it is incorrect.
If you are referring to the statement:
Line 2951: #else /* !USE_GD_IMGSTRTTF */
that 'else' is related to a "USE_GD_IMGSTRTTF" and is not the same as
any "HAVE_GD_STRINGxxx" defines.
I'm saying that if USE_GD_IMGSTRTTF *is* defined, but neither
HAVE_GD_STRINGFT nor HAVE_GD_STRINGTTF is defined, it will leave the
variable 'error' undefined, and then try to use it (resulting in the
possibility of a crash).
Do you still disagree?
------------------------------------------------------------------------
[2003-01-21 14:20:13] iliaa@php.net
The ifdef is correct, because no matter what the value will be assigned
to error. There is another ifdef surrounding this code which has an
else condition that is used to set a value to error. So the crash you
are seeing comes from elsewhere.
------------------------------------------------------------------------
[2003-01-21 09:28:38] jeffabruce@hotmail.com
PHP build:
configure --with-apxs=/usr/local/apache/bin/apxs
--with-mysql=/usr/local/mysql --enable-track-vars
--with-imap=/usr/local/imap --with-gd --enable-ftp --enable-sysvsem
--enable-sysvshm --enable-sockets --with-gettext
--with-mm=/usr/local/lib/mm --with-jpeg-dir=/usr/lib
--with-zlib-dir=/usr/local --with-openssl=/usr/local/ssl --with-ttf
--enable-gd-native-ttf --enable-gd-imgstrttf
--with-freetype-dir=/usr/local --with-dom
FreeType:
freetype-1.3.1.tar.gz was untarred and built and installed with:
configure
make
make install
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/21533
--
Edit this bug report at http://bugs.php.net/?id=21533&edit=1