We observed a segmentation fault with LuaSandbox 4.1.0 on PHP 8.0.25, after upgrading from PHP 7.3.33. This occurs at a low rate (single digit frequence / day):
Core was generated by `php-fpm:'. Program terminated with signal SIGSEGV, Segmentation fault. #0 0x000055d84eb04838 in zend_objects_store_free_object_storage (objects=objects@entry=0x55d84f7830a8 <executor_globals+840>, fast_shutdown=fast_shutdown@entry=true) at /usr/src/php/Zend/zend_objects_API.c:102 102 if (obj->handlers->free_obj != zend_object_std_dtor) { [Current thread is 1 (Thread 0x7f58e6e83980 (LWP 768814))] (gdb) bt #0 0x000055d84eb04838 in zend_objects_store_free_object_storage (objects=objects@entry=0x55d84f7830a8 <executor_globals+840>, fast_shutdown=fast_shutdown@entry=true) at /usr/src/php/Zend/zend_objects_API.c:102 #1 0x000055d84ea6e5df in shutdown_executor () at /usr/src/php/Zend/zend_execute_API.c:339 #2 0x000055d84ea7db29 in zend_deactivate () at /usr/src/php/Zend/zend.c:1239 #3 0x000055d84ea18b49 in php_request_shutdown (dummy=dummy@entry=0x0) at /usr/src/php/main/main.c:1853 #4 0x000055d84e7a3ada in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/php/sapi/fpm/fpm/fpm_main.c:1942 (gdb) printf "%s\n", obj->ce->name->val LuaSandbox (gdb) print obj->handlers $1 = (const zend_object_handlers *) 0x0
Somehow obj->handlers is an apparent null pointer. I don't know if this is a PHP bug or a LuaSandbox bug and unfortunately have not yet managed to create a consistent reproducer.
https://github.com/php/php-src/commit/71d6899e535d960d9b43d75ed2b7073288c13b59 seems like a suspicious related commit that is only in PHP >= 7.4...