[php-src] Issue #8064: imagettfbbox call causes Apache segfault

From: Date: Wed, 09 Feb 2022 08:44:39 +0000
Subject: [php-src] Issue #8064: imagettfbbox call causes Apache segfault
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-239565@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8064 Author: epsilot ### Description ### Description We faced the segfault issue after we upgraded to php 8.1. The segfault happens only when imagettfbbox is called under Apache. We were unable to reproduce this issue in cli. Problem occurs occasionally. When imagettfbbox is called, one of the following happens: * php warning: imagettfbbox(): Problem loading glyph in ... * correct result * segfault We use httpd 2.4.6. ### Code which produces the issue ```php <?php $font = './Lobster.ttf'; $fontsize = 24; $text = 'walle'; $mas1 = imagettfbbox($fontsize, 0, $font, $nick1); ``` ### gdb core dump ``` Thread 1 (Thread 0x7f7f27bd7880 (LWP 1062)): #0 0x00007f7f0d400ddd in gdImageStringFTEx () from /lib64/libgd.so.103 No symbol table info available. #1 0x00007f7f0d401c5b in gdImageStringFT () from /lib64/libgd.so.103 No symbol table info available. #2 0x00007f7f27a28390 in php_imagettftext_common.isra.0 () from /usr/lib64/php/modules/gd.so No symbol table info available. #3 0x00007f7f1aad7402 in execute_ex () from /etc/httpd/modules/libphp.so No symbol table info available. #4 0x00007f7f1aa61e24 in zend_call_function () from /etc/httpd/modules/libphp.so No symbol table info available. #5 0x00007f7f1a9a04df in zif_call_user_func_array () from /etc/httpd/modules/libphp.so No symbol table info available. #6 0x00007f7f1aada63a in execute_ex () from /etc/httpd/modules/libphp.so No symbol table info available. #7 0x00007f7f1aa61e24 in zend_call_function () from /etc/httpd/modules/libphp.so No symbol table info available. #8 0x00007f7f1a9a04df in zif_call_user_func_array () from /etc/httpd/modules/libphp.so No symbol table info available. #9 0x00007f7f1aada63a in execute_ex () from /etc/httpd/modules/libphp.so No symbol table info available. #10 0x00007f7f1aa61e24 in zend_call_function () from /etc/httpd/modules/libphp.so No symbol table info available. #11 0x00007f7f1a9a04df in zif_call_user_func_array () from /etc/httpd/modules/libphp.so No symbol table info available. #12 0x00007f7f1aada63a in execute_ex () from /etc/httpd/modules/libphp.so No symbol table info available. #13 0x00007f7f1aa61e24 in zend_call_function () from /etc/httpd/modules/libphp.so No symbol table info available. #14 0x00007f7f1a9a04df in zif_call_user_func_array () from /etc/httpd/modules/libphp.so No symbol table info available. #15 0x00007f7f1aada63a in execute_ex () from /etc/httpd/modules/libphp.so No symbol table info available. #16 0x00007f7f1aa61e24 in zend_call_function () from /etc/httpd/modules/libphp.so No symbol table info available. #17 0x00007f7f1a9a04df in zif_call_user_func_array () from /etc/httpd/modules/libphp.so No symbol table info available. #18 0x00007f7f1aada63a in execute_ex () from /etc/httpd/modules/libphp.so No symbol table info available. #19 0x00007f7f1aa61e24 in zend_call_function () from /etc/httpd/modules/libphp.so No symbol table info available. #20 0x00007f7f1a9a04df in zif_call_user_func_array () from /etc/httpd/modules/libphp.so No symbol table info available. #21 0x00007f7f1aada63a in execute_ex () from /etc/httpd/modules/libphp.so No symbol table info available. #22 0x00007f7f1aa61e24 in zend_call_function () from /etc/httpd/modules/libphp.so No symbol table info available. #23 0x00007f7f1a9a04df in zif_call_user_func_array () from /etc/httpd/modules/libphp.so No symbol table info available. #24 0x00007f7f1aada63a in execute_ex () from /etc/httpd/modules/libphp.so No symbol table info available. #25 0x00007f7f1aa61e24 in zend_call_function () from /etc/httpd/modules/libphp.so No symbol table info available. #26 0x00007f7f1a9a04df in zif_call_user_func_array () from /etc/httpd/modules/libphp.so No symbol table info available. #27 0x00007f7f1aada63a in execute_ex () from /etc/httpd/modules/libphp.so No symbol table info available. #28 0x00007f7f1aa61e24 in zend_call_function () from /etc/httpd/modules/libphp.so ``` ### PHP Version PHP 8.1.2 ### Operating System CentOS 7

« previous php.bugs (#239565) next »