#23356 [Opn->Bgs]: Segmentation fault using FreeType functions

From: Date: Mon, 28 Apr 2003 14:36:03 +0000
Subject: #23356 [Opn->Bgs]: Segmentation fault using FreeType functions
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38570@lists.php.net to get a copy of this message
ID: 23356 Updated by: sniper@php.net Reported By: steven at pyro dot eu dot org -Status: Open +Status: Bogus Bug Type: Reproducible crash Operating System: Linux PHP Version: 4.3.2RC1 New Comment: 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. Another one related/same as what reported in #23122 (basically same script) Please add your comments there. Previous Comments: ------------------------------------------------------------------------ [2003-04-25 21:05:20] steven at pyro dot eu dot org Upgraded to FreeType 2.1.4 and latest stable CVS (php4-STABLE-200304260130), still causes segmentation fault. Backtrace: #0 FT_Remove_Module (library=0x81357c0, module=0x8135818) at /root/webserver/freetype-2.1.4/src/base/ftobjs.c:2504 #1 0x4025aa10 in FT_Done_Library (library=0x81357c0) at /root/webserver/freetype-2.1.4/src/base/ftobjs.c:2624 #2 0x40255fdf in FT_Done_FreeType (library=0x0) at /root/webserver/freetype-2.1.4/src/base/ftinit.c:151 #3 0x40226eb5 in gdFreeFontCache () at gdft.c:760 #4 0x400cda09 in zm_deactivate_gd () from /usr/local/apache/libexec/libphp4.so #5 0x401bcf89 in module_registry_cleanup () from /usr/local/apache/libexec/libphp4.so #6 0x401bf589 in zend_hash_apply () from /usr/local/apache/libexec/libphp4.so #7 0x401b9d70 in zend_deactivate_modules () from /usr/local/apache/libexec/libphp4.so #8 0x4018c415 in php_request_shutdown () from /usr/local/apache/libexec/libphp4.so #9 0x401cd5f0 in apache_php_module_main () from /usr/local/apache/libexec/libphp4.so #10 0x401ce1bb in send_php () from /usr/local/apache/libexec/libphp4.so #11 0x401ce375 in send_parsed_php () from /usr/local/apache/libexec/libphp4.so #12 0x080697ec in ap_invoke_handler () #13 0x0807dbe2 in process_request_internal () #14 0x0807dc42 in ap_process_request () #15 0x08074f06 in child_main () #16 0x080750a6 in make_child () #17 0x0807520d in startup_children () #18 0x0807583a in standalone_main () #19 0x08076058 in main () #20 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6 This time, however the segmentation fault occurs in a different place... This is the configure line I used: ./configure \ --with-zlib \ --with-gd="/usr/local" \ --enable-gd-native-tt \ --with-png-dir="/usr" \ --with-jpeg-dir="/usr" \ --with-freetype-dir="/usr/local" \ --with-ttf \ --with-mysql \ --enable-sockets \ --with-apxs="/usr/local/apache/bin/apxs" \ --enable-memory-limit \ --disable-rpath \ --disable-posix The crash does not *always* occur - after restarting Apache it crashed the second time I accessed the script included above. ------------------------------------------------------------------------ [2003-04-25 20:11:13] steven at pyro dot eu dot org I seem to have found an intermittent, but reproducable segmentation fault when PHP 4.3.2RC1 uses functions from the FreeType library. The following script is enough to reproduce the error, but I've encountered this problem before in a larger script which also uses imagettftext: <?php header ("Content-type: image/png"); $im = imagecreate (500, 100); $black = imagecolorallocate ($im, 0, 0, 0); $white = imagecolorallocate ($im, 255, 255, 255); imagettftext ($im, 20, 0, 10, 20, $white, "/home/www/xfer/arial.ttf", "TEST!"); imagepng ($im); ?> (in case anyone suspects my arial.ttf may be involved somehow, the one I use has MD5 hash 8d223b3ad8d4819e9dcf22757e4cc2c4) On my server the script will sometimes cause a segmentation fault. I've produced this backtrace: #0 0x40253fed in FT_Free (memory=0x0, P=0xbfffec10) at /root/webserver/freetype-2.1.4rc2/src/base/ftutil.c:134 #1 0x4025883f in FT_Done_Library (library=0x8135590) at /root/webserver/freetype-2.1.4rc2/src/base/ftobjs.c:2616 #2 0x40253ecf in FT_Done_FreeType (library=0xbfffec10) at /root/webserver/freetype-2.1.4rc2/src/base/ftinit.c:151 #3 0x40224eb5 in gdFreeFontCache () at gdft.c:760 #4 0x400cd029 in zm_deactivate_gd () from /usr/local/apache/libexec/libphp4.so #5 0x401bbb69 in module_registry_cleanup () from /usr/local/apache/libexec/libphp4.so #6 0x401be129 in zend_hash_apply () from /usr/local/apache/libexec/libphp4.so #7 0x401b8950 in zend_deactivate_modules () from /usr/local/apache/libexec/libphp4.so #8 0x4018b3b5 in php_request_shutdown () from /usr/local/apache/libexec/libphp4.so #9 0x401cc160 in apache_php_module_main () from /usr/local/apache/libexec/libphp4.so #10 0x401ccd2b in send_php () from /usr/local/apache/libexec/libphp4.so #11 0x401ccee5 in send_parsed_php () from /usr/local/apache/libexec/libphp4.so #12 0x080697ec in ap_invoke_handler () #13 0x0807dbe2 in process_request_internal () #14 0x0807dff5 in ap_internal_redirect () #15 0x40097e8a in mod_gzip_redir1_handler () from /usr/local/apache/libexec/mod_gzip.so #16 0x40095fa5 in mod_gzip_handler () from /usr/local/apache/libexec/mod_gzip.so #17 0x080697ec in ap_invoke_handler () #18 0x0807dbe2 in process_request_internal () #19 0x0807dc42 in ap_process_request () #20 0x08074f06 in child_main () #21 0x080750a6 in make_child () #22 0x0807520d in startup_children () #23 0x0807583a in standalone_main () #24 0x08076058 in main () #25 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6 As you can see I am using FreeType 2.1.4RC2 in this example, and I suspect this is what's causing the problem, but I will try on the latest release. I'll keep playing around and add more info. if it's needed. Thanks! ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23356&edit=1

« previous php.bugs (#38570) next »