-
Notifications
You must be signed in to change notification settings - Fork 8k
PHP 8.3.30 - CLI Segmentation Fault Signal 11 when script finishes (core dumped) #21600
Copy link
Copy link
Open
Description
Description
The following code:
<?php
#!/usr/bin/env php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
if (PHP_SAPI !== 'cli') {
echo 'bin/magento must be run as a CLI application';
exit(1);
}
try {
require __DIR__ . '/../app/bootstrap.php';
} catch (\Exception $e) {
echo 'Autoload error: ' . $e->getMessage();
exit(1);
}
try {
$handler = new \Magento\Framework\App\ErrorHandler();
set_error_handler([$handler, 'handler']);
$application = new Magento\Framework\Console\Cli('Magento CLI');
$application->run();
} catch (\Throwable $e) {
while ($e) {
if ($e->getFile()) {
echo sprintf("\nThere is an error in %s", $e->getFile());
if ($e->getLine()) {
echo sprintf(" at line: %d", $e->getLine());
}
echo "\n";
}
echo $e->getMessage();
echo $e->getTraceAsString();
echo "\n\n";
$e = $e->getPrevious();
}
exit(Magento\Framework\Console\Cli::RETURN_FAILURE);
}
?>
Resulted in this output:
Flushed cache types:
config
layout
block_html
collections
reflection
db_ddl
compiled_config
eav
customer_notification
config_integration
config_integration_api
graphql_query_resolver_result
full_page
config_webservice
translate
Segmentation fault <------------ NOTE ------------<<<
But I expected this output instead:
No segfault when done running the script.
Note that the script finishes successfully - problem shutting down in right order?
GDB
Reading symbols from /usr/local/bin/php...
(No debugging symbols found in /usr/local/bin/php)
[New LWP 100537]
Core was generated by `php: /usr/local/bin/php /usr/local/www/webroot/bin/magento c'.
Program terminated with signal SIGSEGV, Segmentation fault.
Address not mapped to object.
#0 0x000000082759a8fd in ?? () from /lib/libc.so.7
(gdb) bt
#0 0x000000082759a8fd in ?? () from /lib/libc.so.7
#1 0x000000082759196d in ?? () from /lib/libc.so.7
#2 0x0000000825e24cd8 in xmlHashFree () from /usr/local/lib/libxml2.so.16
#3 0x000000085d1eae0e in xsltCleanupGlobals () from /usr/local/lib/libxslt.so.1
#4 0x000000085bac5549 in zm_shutdown_xsl () from /usr/local/lib/php/20230831/xsl.so
#5 0x00000000005ddeda in ?? ()
#6 0x00000000005eac45 in zend_hash_graceful_reverse_destroy ()
#7 0x00000000005d2b18 in ?? ()
#8 0x00000000005619d9 in php_module_shutdown ()
#9 0x00000000006c18fa in ?? ()
#10 0x000000082749f37f in __libc_start1 () from /lib/libc.so.7
#11 0x00000000003f08c4 in _start ()
(gdb)
PHP Version
PHP 8.3.30 (cli) (built: Mar 31 2026 19:06:24) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.30, Copyright (c) Zend Technologies
with Zend OPcache v8.3.30, Copyright (c), by Zend Technologies
Operating System
FreeBSD 15
Reactions are currently unavailable