#21533 [Fbk->Opn]: Trouble building PHP w/ GD and including ImageTTFxxx functions
ID: 21533 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: GD related Operating System: RH 7.2 PHP Version: 4.3.0 New Comment: 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. Previous Comments: [2003-01-22 17:08:34] [EMAIL PROTECTED] If you change char *error; to char *error = NULL; does the segmentation fault you are seeing go away? [2003-01-22 13:57:11] [EMAIL PROTECTED] 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] [EMAIL PROTECTED] 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] [EMAIL PROTECTED] 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 [2003-01-20 17:11:22] [EMAIL PROTECTED] What was the configure line ? And exactly what freetype 1.x version was installed? And how? 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
#21533 [Fbk->Opn]: Trouble building PHP w/ GD and including ImageTTFxxx functions
ID: 21533 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: GD related Operating System: RH 7.2 PHP Version: 4.3.0 New Comment: 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 Previous Comments: [2003-01-20 17:11:22] [EMAIL PROTECTED] What was the configure line ? And exactly what freetype 1.x version was installed? And how? [2003-01-20 16:48:08] [EMAIL PROTECTED] I'm really not a Linux developer, and although what you are asking for sounds easy enough, I don't know how to give you what you want. I would like to reiterate that there are 2 issues here: 1. Configure incorrectly reporting my support for FreeType2 2. gd.c has code that given certain #if conditions, leaves the variable 'error' undefined. The crash is occuring because of the reference to this floating pointer. I assume you want a backtrace to determine the line of code that is crashing, but I'm *giving* you the line of code that is crashing. [2003-01-09 19:44:35] [EMAIL PROTECTED] Can you generate a backtrace from the core file and please provide the shortest possible version of the script that can be used to duplicate the crash. [2003-01-09 09:24:09] [EMAIL PROTECTED] I am using the bundled GD library. [2003-01-08 21:19:00] [EMAIL PROTECTED] Are you using bundled or non-bundled GD library? 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
#21533 [Fbk->Opn]: Trouble building PHP w/ GD and including ImageTTFxxx functions
ID: 21533 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: GD related Operating System: RH 7.2 PHP Version: 4.3.0 New Comment: I'm really not a Linux developer, and although what you are asking for sounds easy enough, I don't know how to give you what you want. I would like to reiterate that there are 2 issues here: 1. Configure incorrectly reporting my support for FreeType2 2. gd.c has code that given certain #if conditions, leaves the variable 'error' undefined. The crash is occuring because of the reference to this floating pointer. I assume you want a backtrace to determine the line of code that is crashing, but I'm *giving* you the line of code that is crashing. Previous Comments: [2003-01-09 19:44:35] [EMAIL PROTECTED] Can you generate a backtrace from the core file and please provide the shortest possible version of the script that can be used to duplicate the crash. [2003-01-09 09:24:09] [EMAIL PROTECTED] I am using the bundled GD library. [2003-01-08 21:19:00] [EMAIL PROTECTED] Are you using bundled or non-bundled GD library? [2003-01-08 17:52:16] [EMAIL PROTECTED] I had FreeType 1.x installed only, not FreeType 2.x. Problem #1 After extracting the tarball and running 'configure' (with various options), the output indicated that I had FreeType 2 support. Problem #2 So, I built PHP thinking everything was good to go. However, when I tried to use ImageTTFText(), I got a segmentaion fault. Looking at the code in gd.c, I noticed that there is a point in php_imagettftext_common() that looks like: #if HAVE_GD_STRINGFT error = gdImageStringFT(... #elif HAVE_GD_STRINGTTF error = gdImageStringTTF(... #endif ... if ( error ) ... This code is clearly risky at best since variable 'error' is undefined if neither HAVE_GD_STRINGFT or HAVE_GD_STRINGTTF is defined. I solved my issue of not having support for ImageTTFText() by installing FreeType 2.x. But the long term solution should include addressing these 2 issues. -- Edit this bug report at http://bugs.php.net/?id=21533&edit=1
#21533 [Fbk->Opn]: Trouble building PHP w/ GD and including ImageTTFxxx functions
ID: 21533 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Feedback +Status: Open Bug Type: GD related Operating System: RH 7.2 PHP Version: 4.3.0 New Comment: I am using the bundled GD library. Previous Comments: [2003-01-08 21:19:00] [EMAIL PROTECTED] Are you using bundled or non-bundled GD library? [2003-01-08 17:52:16] [EMAIL PROTECTED] I had FreeType 1.x installed only, not FreeType 2.x. Problem #1 After extracting the tarball and running 'configure' (with various options), the output indicated that I had FreeType 2 support. Problem #2 So, I built PHP thinking everything was good to go. However, when I tried to use ImageTTFText(), I got a segmentaion fault. Looking at the code in gd.c, I noticed that there is a point in php_imagettftext_common() that looks like: #if HAVE_GD_STRINGFT error = gdImageStringFT(... #elif HAVE_GD_STRINGTTF error = gdImageStringTTF(... #endif ... if ( error ) ... This code is clearly risky at best since variable 'error' is undefined if neither HAVE_GD_STRINGFT or HAVE_GD_STRINGTTF is defined. I solved my issue of not having support for ImageTTFText() by installing FreeType 2.x. But the long term solution should include addressing these 2 issues. -- Edit this bug report at http://bugs.php.net/?id=21533&edit=1