Skip to content

Segmentation fault (EXC_BAD_ACCESS) when running make test on PHP 8.6-dev (macOS ARM64) #21720

@arshidkv12

Description

@arshidkv12

Description

make test TESTS="tests/basic/001.phpt"                


Build complete.
Don't forget to run 'make test'.


=====================================================================
PHP         : /Users/arshid/Downloads/php-src/sapi/cli/php
PHP_SAPI    : cli
PHP_VERSION : 8.6.0-dev
ZEND_VERSION: 4.6.0-dev
PHP_OS      : Darwin - Darwin Arshids-MacBook-Air.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:01:41 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_ARM64_T8132 arm64
INI actual  : /Users/arshid/Downloads/php-src/tmp-php.ini
More .INIs  :
---------------------------------------------------------------------
PHP         : /Users/arshid/Downloads/php-src/sapi/cgi/php-cgi
PHP_SAPI    : cgi-fcgi
PHP_VERSION : 8.6.0-dev
ZEND_VERSION: 4.6.0-dev
PHP_OS      : Darwin - Darwin Arshids-MacBook-Air.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:01:41 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_ARM64_T8132 arm64
INI actual  : /Users/arshid/Downloads/php-src/tmp-php.ini
More .INIs  :
---------------------------------------------------------------------
---------------------------------------------------------------------
PHP         : /Users/arshid/Downloads/php-src/sapi/phpdbg/phpdbg
PHP_SAPI    : phpdbg
PHP_VERSION : 8.6.0-dev
ZEND_VERSION: 4.6.0-dev
PHP_OS      : Darwin - Darwin Arshids-MacBook-Air.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:01:41 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_ARM64_T8132 arm64
INI actual  : /Users/arshid/Downloads/php-src/tmp-php.ini
More .INIs  :
---------------------------------------------------------------------
CWD         : /Users/arshid/Downloads/php-src
Extra dirs  :
VALGRIND    : Not used
=====================================================================
Running selected tests.
/bin/sh: line 1: 25648 Segmentation fault: 11  TEST_PHP_EXECUTABLE=/Users/arshid/Downloads/php-src/sapi/cli/php TEST_PHP_SRCDIR=/Users/arshid/Downloads/php-src CC="cc" /Users/arshid/Downloads/php-src/sapi/cli/php -n -c /Users/arshid/Downloads/php-src/tmp-php.ini -d 'open_basedir=' -d 'output_buffering=0' -d 'memory_limit=-1' /Users/arshid/Downloads/php-src/run-tests.php -n -c /Users/arshid/Downloads/php-src/tmp-php.ini -d extension_dir=/Users/arshid/Downloads/php-src/modules/ ` if test "x" != "x"; then for i in ""; do . $i; if test "x$dlname" != "xdl_test.so"; then /Users/arshid/Downloads/php-src/build/shtool echo -n -- " -d extension=$dlname"; fi; done; fi; if test "x" != "x"; then for i in ""; do . $i; /Users/arshid/Downloads/php-src/build/shtool echo -n -- " -d zend_extension=/Users/arshid/Downloads/php-src/modules/$dlname"; done; fi` tests/basic/001.phpt
make: *** [test] Error 139 
sudo lldb -b -o "run" -o "frame select 0" -o "source list" -o "quit" -- ./sapi/cli/php run-tests.php tests/basic/001.phpt
Password:
(lldb) target create "./sapi/cli/php"
Current executable set to '/Users/arshid/Downloads/php-src/sapi/cli/php' (arm64).
(lldb) settings set -- target.run-args  "run-tests.php" "tests/basic/001.phpt"
(lldb) run

=====================================================================
PHP         : /Users/arshid/Downloads/php-src/sapi/cli/php
PHP_SAPI    : cli
PHP_VERSION : 8.6.0-dev
ZEND_VERSION: 4.6.0-dev
PHP_OS      : Darwin - Darwin Arshids-MacBook-Air.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:01:41 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_ARM64_T8132 arm64
INI actual  : /Users/arshid/Downloads/php-src
More .INIs  :
---------------------------------------------------------------------
PHP         : /Users/arshid/Downloads/php-src/sapi/cgi/php-cgi
PHP_SAPI    : cgi-fcgi
PHP_VERSION : 8.6.0-dev
ZEND_VERSION: 4.6.0-dev
PHP_OS      : Darwin - Darwin Arshids-MacBook-Air.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:01:41 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_ARM64_T8132 arm64
INI actual  : /Users/arshid/Downloads/php-src
More .INIs  :
---------------------------------------------------------------------
---------------------------------------------------------------------
PHP         : /Users/arshid/Downloads/php-src/sapi/phpdbg/phpdbg
PHP_SAPI    : phpdbg
PHP_VERSION : 8.6.0-dev
ZEND_VERSION: 4.6.0-dev
PHP_OS      : Darwin - Darwin Arshids-MacBook-Air.local 24.6.0 Darwin Kernel Version 24.6.0: Mon Jan 19 22:01:41 PST 2026; root:xnu-11417.140.69.708.3~1/RELEASE_ARM64_T8132 arm64
INI actual  : /Users/arshid/Downloads/php-src
More .INIs  :
---------------------------------------------------------------------
CWD         : /Users/arshid/Downloads/php-src
Extra dirs  :
VALGRIND    : Not used
=====================================================================
Running selected tests.
Process 25731 launched: '/Users/arshid/Downloads/php-src/sapi/cli/php' (arm64)
Process 25731 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000000000000
error: memory read failed for 0x0
Target 0: (php) stopped.
(lldb) frame select 0
frame #0: 0x0000000000000000
error: memory read failed for 0x0
(lldb) list
   1299                 }
   1300
   1301                 descriptors[ndesc].index = (int)nindex;
   1302
   1303                 ZVAL_DEREF(descitem);
   1304                 if (Z_TYPE_P(descitem) == IS_RESOURCE) {
   1305                         if (set_proc_descriptor_from_resource(descitem, &descriptors[ndesc], ndesc) == FAILURE) {
(lldb) 
   1306                                 goto exit_fail;
   1307                         }

Configure

 bison --version                 
 bison (GNU Bison) 3.8.2
./configure  --disable-all --enable-debug

Cli

sapi/cli/php -r 'proc_open("ls", [], $pipes);' // it is working 

PHP Version

PHP 8.6.0-dev (cli) (built: Apr 11 2026 08:56:25) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.6.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.6.0-dev, Copyright (c), by Zend Technologies

Operating System

Mac OS

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions