php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81666 Random error 1 ext/opcache/jit/zend_jit.lo when building on Mac ARM64
Submitted: 2021-11-27 12:07 UTC Modified: 2021-11-28 18:13 UTC
Votes:9
Avg. Score:4.1 ± 1.0
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:2 (33.3%)
From: ruudk at mphuis dot com Assigned:
Status: Open Package: Compile Failure
PHP Version: 8.1.0 OS: macOS Monterey (12)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: ruudk at mphuis dot com
New email:
PHP Version: OS:

 

 [2021-11-27 12:07 UTC] ruudk at mphuis dot com
Description:
------------
We're seeing random failures on Apple Silicon / ARM64 machines.

Sometimes it works fine, and PHP compiles successfully, but often it fails with `make: *** [ext/opcache/jit/zend_jit.lo] Error 1`.

Test script:
---------------
See https://github.com/Homebrew/homebrew-core/pull/89973

git clone git@github.com:ruudk/homebrew-core.git --depth=1 -b bump-php-8.1.0 /tmp/brew-php8.1
COUNTER=1; while brew reinstall --formula --build-from-source Formula/php.rb; do COUNTER=$[$COUNTER +1]; echo "Iteration $COUNTER"; done;
rm -rf /tmp/brew-php8.1

After a few iterations the build fails. 

Actual result:
--------------
Generating phar.php
Generating phar.phar
PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.
directorytreeiterator.inc
clicommand.inc
directorygraphiterator.inc
phar.inc
invertedregexiterator.inc
pharcommand.inc
/bin/sh /private/tmp/php-20211127-88887-1owqr35/php-8.1.0/libtool --silent --preserve-dup-deps --tag CC --mode=compile clang -Iext/opcache/ -I/private/tmp/php-20211127-88887-1owqr35/php-8.1.0/ext/opcache/ -I/private/tmp/php-20211127-88887-1owqr35/php-8.1.0/include -I/private/tmp/php-20211127-88887-1owqr35/php-8.1.0/main -I/private/tmp/php-20211127-88887-1owqr35/php-8.1.0 -I/private/tmp/php-20211127-88887-1owqr35/php-8.1.0/ext/date/lib -I/opt/homebrew/Cellar/openssl@1.1/1.1.1l_1/include -I/opt/homebrew/Cellar/pcre2/10.39/include -I/opt/homebrew/Cellar/sqlite/3.36.0/include -I/opt/homebrew/Cellar/curl/7.80.0_1/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/ffi -I/opt/homebrew/Cellar/gd/2.3.3_1/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/gmp/include -I/opt/homebrew/Cellar/icu4c/69.1/include -I/opt/homebrew/opt/openldap/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/sasl -I/opt/homebrew/Cellar/oniguruma/6.9.7.1/include -I/private/tmp/php-20211127-88887-1owqr35/php-8.1.0/ext/mbstring/libmbfl -I/private/tmp/php-20211127-88887-1owqr35/php-8.1.0/ext/mbstring/libmbfl/mbfl -I/opt/homebrew/Cellar/unixodbc/2.3.9_1/include -I/opt/homebrew/opt/freetds/include -I/opt/homebrew/opt/libpq/include -I/opt/homebrew/opt/aspell/include/pspell -I/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/editline -I/opt/homebrew/Cellar/libsodium/1.0.18_1/include -I/opt/homebrew/Cellar/argon2/20190702_1/include -I/opt/homebrew/opt/tidy-html5/include -I/opt/homebrew/Cellar/libzip/1.8.0_1/include -I/private/tmp/php-20211127-88887-1owqr35/php-8.1.0/TSRM -I/private/tmp/php-20211127-88887-1owqr35/php-8.1.0/Zend    -fno-common -Wstrict-prototypes -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -DZEND_SIGNALS   -prefer-pic -Wno-implicit-fallthrough -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /private/tmp/php-20211127-88887-1owqr35/php-8.1.0/ext/opcache/jit/zend_jit.c -o ext/opcache/jit/zend_jit.lo  -MMD -MF ext/opcache/jit/zend_jit.dep -MT ext/opcache/jit/zend_jit.lo
make: *** [ext/opcache/jit/zend_jit.lo] Error 1

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-11-27 13:55 UTC] contact at shivammathur dot com
This crash randomly happens while Compiling PHP-8.1 opcache on macOS arm64 on both Big Sur and Monterey.

Crash Report

Process:               clang [99845]
Path:                  /Applications/Xcode_13.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
Identifier:            clang
Version:               13.0.0 (1300.0.29)
Code Type:             ARM-64 (Native)
Parent Process:        clang [99844]
Responsible:           Terminal [1141]
User ID:               501

Date/Time:             2021-11-27 04:43:10.620 -0800
OS Version:            macOS 11.6 (20G165)
Report Version:        12
Anonymous UUID:        356B8802-1477-1905-8226-D014EE69A76E


Time Awake Since Boot: 2700000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0xe000000000000010 -> 0x0000000000000010 (possible pointer authentication failure)
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [99845]

VM Regions Near 0x10:
--> 
    __TEXT                      100868000-104328000    [ 58.8M] r-x/r-x SM=COW  /Applications/Xcode_13.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

Application Specific Information:
dyld2 mode

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   clang                         	0x0000000100d93b5c (anonymous namespace)::CodeGenPrepare::tryToPromoteExts((anonymous namespace)::TypePromotionTransaction&, llvm::SmallVectorImpl<llvm::Instruction*> const&, llvm::SmallVectorImpl<llvm::Instruction*>&, unsigned int) + 172
1   clang                         	0x0000000100d8c9bc (anonymous namespace)::CodeGenPrepare::optimizeInst(llvm::Instruction*, bool&) + 17484
2   clang                         	0x0000000100d8c9bc (anonymous namespace)::CodeGenPrepare::optimizeInst(llvm::Instruction*, bool&) + 17484
3   clang                         	0x0000000100d82d68 (anonymous namespace)::CodeGenPrepare::runOnFunction(llvm::Function&) + 5356
4   clang                         	0x0000000101018690 llvm::FPPassManager::runOnFunction(llvm::Function&) + 460
5   clang                         	0x000000010101d0e4 llvm::FPPassManager::runOnModule(llvm::Module&) + 52
6   clang                         	0x0000000101018ec0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 552
7   clang                         	0x0000000101563404 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream> >) + 6728
8   clang                         	0x00000001016cbcec clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 604
9   clang                         	0x00000001020c5860 clang::ParseAST(clang::Sema&, bool, bool) + 348
10  clang                         	0x00000001018246d0 clang::FrontendAction::Execute() + 60
11  clang                         	0x00000001017da020 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1300
12  clang                         	0x000000010186cab4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1212
13  clang                         	0x000000010086e960 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 1424
14  clang                         	0x000000010086d568 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) + 692
15  clang                         	0x000000010086d2ac driver_main(int, char const**) + 4056
16  clang                         	0x000000010086c2b4 main + 108
17  libdyld.dylib                 	0x000000018abb5430 start + 4

Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000118b91fd0   x1: 0x000000016f592d08   x2: 0x000000016f592c80   x3: 0x000000016f592cb8
    x4: 0x0000000000000000   x5: 0x000000010cf70880   x6: 0x0000000000000000   x7: 0x00000001186e0f00
    x8: 0xe000000000000000   x9: 0x000000016f592c90  x10: 0x0000000118b92150  x11: 0x0000000118b91fd0
   x12: 0x0000000000000000  x13: 0xfffffffffffff000  x14: 0x0000000000000002  x15: 0x0000000118b921e0
   x16: 0x0000000118b92278  x17: 0x0000000000000098  x18: 0x0000000000000000  x19: 0x000000010ea72330
   x20: 0x000000016f592d08  x21: 0x000000016f592c98  x22: 0x0000000118b92128  x23: 0x000000016f592aa8
   x24: 0x000000016f592c90  x25: 0x000000016f592dc8  x26: 0x000000010ea72330  x27: 0x000000016f592bc0
   x28: 0x0000000118b9209c   fp: 0x000000016f592b30   lr: 0x0000000100d8c9bc
    sp: 0x000000016f592a00   pc: 0x0000000100d93b5c cpsr: 0x60000000
   far: 0xe000000000000010  esr: 0x92000006


Binary Images:
       0x100868000 -        0x104327fff +clang (13.0.0 - 1300.0.29) <EED6AF36-6DD3-34BF-BF11-1376B4FA633D> /Applications/Xcode_13.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
       0x10615c000 -        0x1061dbfff  dyld (852.2) <38657979-1ABE-3C9A-BF64-EF3B746216AB> /usr/lib/dyld
       0x18a8f2000 -        0x18a8f3fff  libsystem_blocks.dylib (79) <BA713F79-1620-38B2-8717-79849B8E897E> /usr/lib/system/libsystem_blocks.dylib
       0x18a8f4000 -        0x18a92bfff  libxpc.dylib (2038.120.1) <0E990C5D-C4F7-304A-9714-4409647CC2EF> /usr/lib/system/libxpc.dylib
       0x18a92c000 -        0x18a943fff  libsystem_trace.dylib (1277.120.1) <7A6B4800-8D94-3091-AC78-2D6B97A9B496> /usr/lib/system/libsystem_trace.dylib
       0x18a944000 -        0x18a9b7fff  libcorecrypto.dylib (1000.140.4) <FAF9B49D-2583-34EF-850B-047F050ED996> /usr/lib/system/libcorecrypto.dylib
       0x18a9b8000 -        0x18a9e3fff  libsystem_malloc.dylib (317.140.5) <A454F3F2-7BC4-3808-A60F-F5F4BC55577F> /usr/lib/system/libsystem_malloc.dylib
       0x18a9e4000 -        0x18aa28fff  libdispatch.dylib (1271.120.2) <4EDD5F72-2296-3891-B2A1-6741DB6C05C9> /usr/lib/system/libdispatch.dylib
       0x18aa29000 -        0x18aa62fff  libobjc.A.dylib (824) <252C93CC-2D39-3C15-87F6-1336658B2F49> /usr/lib/libobjc.A.dylib
       0x18aa63000 -        0x18aa65fff  libsystem_featureflags.dylib (28.60.1) <61A79E0B-1836-376D-AC24-171B40A9FAE7> /usr/lib/system/libsystem_featureflags.dylib
       0x18aa66000 -        0x18aae7fff  libsystem_c.dylib (1439.141.1) <9B3C0AD0-1E0B-39D1-BE25-B97F8EA7E623> /usr/lib/system/libsystem_c.dylib
       0x18aae8000 -        0x18ab43fff  libc++.1.dylib (905.6) <BED05B96-CCAE-365A-B3F5-F8D72F5E77E1> /usr/lib/libc++.1.dylib
       0x18ab44000 -        0x18ab5bfff  libc++abi.dylib (905.6) <3C5176E2-CE48-312B-97F6-23D4E7AFA43F> /usr/lib/libc++abi.dylib
       0x18ab5c000 -        0x18ab8ffff  libsystem_kernel.dylib (7195.141.6) <FA7E835C-CB30-3D98-9331-30CE6584423D> /usr/lib/system/libsystem_kernel.dylib
       0x18ab90000 -        0x18ab9cfff  libsystem_pthread.dylib (454.120.2) <BDC1C5DA-9499-3580-9588-2928DE2440DD> /usr/lib/system/libsystem_pthread.dylib
       0x18ab9d000 -        0x18abdefff  libdyld.dylib (852.2) <BE0B539A-2EDF-3A99-9632-731C5928BBAC> /usr/lib/system/libdyld.dylib
       0x18abdf000 -        0x18abe5fff  libsystem_platform.dylib (254.80.2) <2CC11FAD-1E31-3533-B1D8-9CDDF5DFE595> /usr/lib/system/libsystem_platform.dylib
       0x18abe6000 -        0x18ac11fff  libsystem_info.dylib (542.40.3) <3B5B9F97-ECFB-3F6E-9B85-D8C62A8B3205> /usr/lib/system/libsystem_info.dylib
       0x18cfa7000 -        0x18cfb1fff  libsystem_darwin.dylib (1439.141.1) <9BF54A49-874D-3D91-B319-6B2F676FE42D> /usr/lib/system/libsystem_darwin.dylib
       0x18d3ea000 -        0x18d3f5fff  libsystem_notify.dylib (279.40.4) <FA85C044-99A5-352D-B7AD-45FB31B295FF> /usr/lib/system/libsystem_notify.dylib
       0x18f3c9000 -        0x18f3d8fff  libsystem_networkextension.dylib (1295.140.3) <0FFACDE5-D546-306D-B9FA-06EC8FCAEEF9> /usr/lib/system/libsystem_networkextension.dylib
       0x18f42e000 -        0x18f445fff  libsystem_asl.dylib (385) <7F462B8A-541F-3195-9BAE-CDEDFA3BA8A4> /usr/lib/system/libsystem_asl.dylib
       0x19099f000 -        0x1909a6fff  libsystem_symptoms.dylib (1431.140.1) <0B4FC817-CC87-31F2-872B-BD505D29F5EE> /usr/lib/system/libsystem_symptoms.dylib
       0x1927fb000 -        0x19280cfff  libsystem_containermanager.dylib (318.100.4) <FCE2D8EA-A9D8-3A5D-A908-3E9C0AFFB941> /usr/lib/system/libsystem_containermanager.dylib
       0x193479000 -        0x19347dfff  libsystem_configuration.dylib (1109.140.1) <9BC511C4-6613-3F1D-8592-7D3971B24921> /usr/lib/system/libsystem_configuration.dylib
       0x19347e000 -        0x193482fff  libsystem_sandbox.dylib (1441.141.4) <CABF63A0-DDAF-3A54-8447-1256DFFD2907> /usr/lib/system/libsystem_sandbox.dylib
       0x193e3f000 -        0x193e41fff  libquarantine.dylib (119.40.2) <DE9BFFD7-62ED-38ED-BF58-388F192BE6FC> /usr/lib/system/libquarantine.dylib
       0x1943a2000 -        0x1943a6fff  libsystem_coreservices.dylib (127.1) <F107780A-EFAD-3DC8-A62F-825DD954128E> /usr/lib/system/libsystem_coreservices.dylib
       0x19458c000 -        0x19459dfff  libz.1.dylib (76) <4838F5D2-C9BB-366A-9745-209A80BCC426> /usr/lib/libz.1.dylib
       0x19459e000 -        0x1945cbfff  libsystem_m.dylib (3186.100.3) <092A6565-3BE3-3EEF-844E-B846793A4115> /usr/lib/system/libsystem_m.dylib
       0x1945cd000 -        0x1945d2fff  libmacho.dylib (980) <F6CBC87D-DC83-3E5F-A7C0-B0115E7D1BC1> /usr/lib/system/libmacho.dylib
       0x1945eb000 -        0x1945f8fff  libcommonCrypto.dylib (60178.120.3) <146E6A52-3060-32A1-9119-C3D6F8B5C57B> /usr/lib/system/libcommonCrypto.dylib
       0x1945f9000 -        0x194603fff  libunwind.dylib (201) <2A01EF92-F92D-35F7-B638-8CBC6896DCAA> /usr/lib/system/libunwind.dylib
       0x194604000 -        0x19460bfff  liboah.dylib (203.58) <6802DEC1-9ED5-3667-BFE0-3BDDE8BB40E1> /usr/lib/liboah.dylib
       0x19460c000 -        0x194614fff  libcopyfile.dylib (173.40.2) <8477DD43-56AA-3422-BF23-4ADC7B98462F> /usr/lib/system/libcopyfile.dylib
       0x194615000 -        0x194618fff  libcompiler_rt.dylib (102.2) <50E8F23E-3E63-31BF-BFC3-EE75D281B151> /usr/lib/system/libcompiler_rt.dylib
       0x194619000 -        0x19461bfff  libsystem_collections.dylib (1439.141.1) <EA89016C-2C72-3531-84D9-2A696F2DAC85> /usr/lib/system/libsystem_collections.dylib
       0x19461c000 -        0x19461efff  libsystem_secinit.dylib (87.60.1) <836B23E3-DF08-31C8-98AD-4A9B12A4B404> /usr/lib/system/libsystem_secinit.dylib
       0x19461f000 -        0x194621fff  libremovefile.dylib (49.120.1) <687A6E36-0460-30BC-A675-7F83059AE2D9> /usr/lib/system/libremovefile.dylib
       0x194622000 -        0x194622fff  libkeymgr.dylib (31) <C5D64EE9-AB76-3D4C-BC4F-2BE8415DC21A> /usr/lib/system/libkeymgr.dylib
       0x194623000 -        0x19462bfff  libsystem_dnssd.dylib (1310.140.1) <DEE0783F-DDC9-35A6-9F6E-6B8FE94FBF0A> /usr/lib/system/libsystem_dnssd.dylib
       0x19462c000 -        0x194631fff  libcache.dylib (83) <2EA812B3-0565-35FA-BF54-DF98EF3DB5DE> /usr/lib/system/libcache.dylib
       0x194632000 -        0x194633fff  libSystem.B.dylib (1292.120.1) <1E75FCDF-2357-30FE-AAAD-5290BA722464> /usr/lib/libSystem.B.dylib
       0x197a51000 -        0x197a51fff  liblaunch.dylib (2038.120.1) <AA4E8477-1B82-357E-8275-FFED1F957AF9> /usr/lib/system/liblaunch.dylib
       0x199f05000 -        0x199f05fff  libsystem_product_info_filter.dylib (8.40.1) <14136F56-3690-3346-90A0-31FC34DF3E1B> /usr/lib/system/libsystem_product_info_filter.dylib
       0x1aa625000 -        0x1aa655fff  libncurses.5.4.dylib (57) <0300C82B-7239-32FD-8A28-45A25D89EAAC> /usr/lib/libncurses.5.4.dylib

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=577.7M resident=0K(0%) swapped_out_or_unallocated=577.7M(100%)
Writable regions: Total=1.3G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.3G(100%)
 
                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                   32K        1 
MALLOC                           402.2M      164 
MALLOC guard page                   96K        5 
MALLOC_MEDIUM (reserved)         864.0M        8         reserved VM address space (unallocated)
STACK GUARD                         16K        1 
Stack                             64.0M        1 
VM_ALLOCATE                        1.0G        1 
__AUTH                              45K       12 
__AUTH_CONST                        76K       40 
__DATA                             789K       39 
__DATA_CONST                      4446K       40 
__DATA_DIRTY                        73K       21 
__LINKEDIT                       514.2M        4 
__OBJC_CONST                        10K        5 
__OBJC_RO                         75.1M        1 
__OBJC_RW                         2576K        1 
__TEXT                            63.6M       46 
mapped file                       9232K       32 
shared memory                       16K        1 
===========                     =======  ======= 
TOTAL                              3.0G      423 
TOTAL, minus reserved VM space     2.1G      423
 [2021-11-27 21:47 UTC] dc dot link at yahoo dot fr
Does it happen also with other compilers than the Xcode's one ? gcc or clang from homebrew for ex.
 [2021-11-28 09:53 UTC] ruudk at mphuis dot com
I'll see if I can try that.

This is the crash report btw:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               clang [44565]
Path:                  /Library/Developer/CommandLineTools/usr/bin/clang
Identifier:            clang
Version:               ???
Code Type:             ARM-64 (Native)
Parent Process:        clang [44564]
Responsible:           iTerm2 [48100]
User ID:               501

Date/Time:             2021-11-28 10:42:19.7112 +0100
OS Version:            macOS 12.0.1 (21A559)
Report Version:        12
Anonymous UUID:        F82FC68E-C189-30B4-71C6-4A55461189EA

Sleep/Wake UUID:       F91BB4FC-8C1D-420E-9312-C3B35CBA85A1

Time Awake Since Boot: 76000 seconds
Time Since Wake:       1126 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x00000ae6bc41a8f0
Exception Codes:       0x0000000000000001, 0x00000ae6bc41a8f0
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [44565]

VM Region Info: 0xae6bc41a8f0 is not in any region.  Bytes after previous region: 11505080838385  Bytes before following region: 93566999090960
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      commpage (reserved)        1000000000-7000000000   [384.0G] ---/--- SM=NUL  ...(unallocated)
--->  GAP OF 0x5f9000000000 BYTES
      MALLOC_NANO              600000000000-600008000000 [128.0M] rw-/rwx SM=PRV  

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   clang                         	       0x101367b5c (anonymous namespace)::CodeGenPrepare::tryToPromoteExts((anonymous namespace)::TypePromotionTransaction&, llvm::SmallVectorImpl<llvm::Instruction*> const&, llvm::SmallVectorImpl<llvm::Instruction*>&, unsigned int) + 172
1   clang                         	       0x1013609bc (anonymous namespace)::CodeGenPrepare::optimizeInst(llvm::Instruction*, bool&) + 17484
2   clang                         	       0x1013609bc (anonymous namespace)::CodeGenPrepare::optimizeInst(llvm::Instruction*, bool&) + 17484
3   clang                         	       0x101356d68 (anonymous namespace)::CodeGenPrepare::runOnFunction(llvm::Function&) + 5356
4   clang                         	       0x1015ec690 llvm::FPPassManager::runOnFunction(llvm::Function&) + 460
5   clang                         	       0x1015f10e4 llvm::FPPassManager::runOnModule(llvm::Module&) + 52
6   clang                         	       0x1015ecec0 llvm::legacy::PassManagerImpl::run(llvm::Module&) + 552
7   clang                         	       0x101b37404 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream> >) + 6728
8   clang                         	       0x101c9fcec clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) + 604
9   clang                         	       0x102699860 clang::ParseAST(clang::Sema&, bool, bool) + 348
10  clang                         	       0x101df86d0 clang::FrontendAction::Execute() + 60
11  clang                         	       0x101dae020 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 1300
12  clang                         	       0x101e40ab4 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1212
13  clang                         	       0x100e42960 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) + 1424
14  clang                         	       0x100e41568 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) + 692
15  clang                         	       0x100e412ac driver_main(int, char const**) + 4056
16  clang                         	       0x100e402b4 main + 108
17  dyld                          	       0x1066490f4 start + 520


Thread 0 crashed with ARM Thread State (64-bit):
    x0: 0x0000000140759d50   x1: 0x000000016efbc828   x2: 0x000000016efbc7a0   x3: 0x000000016efbc7d8
    x4: 0x0000000000000000   x5: 0x000060001caa4ec0   x6: 0x0000000000000000   x7: 0x00006000022b76f0
    x8: 0x00000ae6bc41a8e0   x9: 0x000000016efbc7b0  x10: 0x0000000140759ed0  x11: 0x0000000140759d50
   x12: 0x0000000000000000  x13: 0xfffffffffffff000  x14: 0x0000000000000001  x15: 0x0000000140759f60
   x16: 0x0000000140759ff8  x17: 0x0000000000000098  x18: 0x0000000000000000  x19: 0x000060001caaa900
   x20: 0x000000016efbc828  x21: 0x000000016efbc7b8  x22: 0x0000000140759ea8  x23: 0x000000016efbc5c8
   x24: 0x000000016efbc7b0  x25: 0x000000016efbc8e8  x26: 0x000060001caaa900  x27: 0x000000016efbc6e0
   x28: 0x0000000140759e1c   fp: 0x000000016efbc650   lr: 0x00000001013609bc
    sp: 0x000000016efbc520   pc: 0x0000000101367b5c cpsr: 0x60000000
   far: 0x00000ae6bc41a8f0  esr: 0x92000005 (Data Abort) byte read Translation fault

Binary Images:
       0x100e3c000 -        0x1048fbfff clang (*) <eed6af36-6dd3-34bf-bf11-1376b4fa633d> /Library/Developer/CommandLineTools/usr/bin/clang
       0x106644000 -        0x1066a3fff dyld (*) <86a8ba48-8bb4-3b30-9cda-051f73c74f44> /usr/lib/dyld
               0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=658.1M resident=0K(0%) swapped_out_or_unallocated=658.1M(100%)
Writable regions: Total=1.3G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.3G(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                   32K        1 
MALLOC                           746.2M       58 
MALLOC guard page                   96K        5 
MALLOC_MEDIUM (reserved)         512.0M        5         reserved VM address space (unallocated)
STACK GUARD                         16K        1 
Stack                             64.0M        1 
VM_ALLOCATE                        1.0G        1 
__AUTH                              46K       12 
__AUTH_CONST                        68K       40 
__DATA                             591K       40 
__DATA_CONST                      4477K       42 
__DATA_DIRTY                        73K       21 
__LINKEDIT                       594.7M        3 
__OBJC_CONST                        10K        5 
__OBJC_RO                         81.8M        1 
__OBJC_RW                         3088K        1 
__TEXT                            63.5M       45 
dyld private memory               1024K        1 
mapped file                       9328K       32 
shared memory                       16K        1 
===========                     =======  ======= 
TOTAL                              3.0G      316 
TOTAL, minus reserved VM space     2.5G      316 



-----------
Full Report
-----------

{"app_name":"clang","timestamp":"2021-11-28 10:42:19.00 +0100","app_version":"","slice_uuid":"eed6af36-6dd3-34bf-bf11-1376b4fa633d","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 12.0.1 (21A559)","incident_id":"4C3DEC23-9E3F-4EAE-8F8D-7B6A22F8F831","name":"clang"}
{
  "uptime" : 76000,
  "procLaunch" : "2021-11-28 10:42:13.8030 +0100",
  "procRole" : "Unspecified",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "MacBookPro18,1",
  "procStartAbsTime" : 1843642538443,
  "coalitionID" : 618,
  "osVersion" : {
    "train" : "macOS 12.0.1",
    "build" : "21A559",
    "releaseType" : "User"
  },
  "captureTime" : "2021-11-28 10:42:19.7112 +0100",
  "incident" : "4C3DEC23-9E3F-4EAE-8F8D-7B6A22F8F831",
  "bug_type" : "309",
  "pid" : 44565,
  "procExitAbsTime" : 1843784325857,
  "translated" : false,
  "cpuType" : "ARM-64",
  "procName" : "clang",
  "procPath" : "\/Library\/Developer\/CommandLineTools\/usr\/bin\/clang",
  "parentProc" : "clang",
  "parentPid" : 44564,
  "coalitionName" : "com.googlecode.iterm2",
  "crashReporterKey" : "F82FC68E-C189-30B4-71C6-4A55461189EA",
  "responsiblePid" : 48100,
  "responsibleProc" : "iTerm2",
  "wakeTime" : 1126,
  "sleepWakeUUID" : "F91BB4FC-8C1D-420E-9312-C3B35CBA85A1",
  "sip" : "enabled",
  "vmRegionInfo" : "0xae6bc41a8f0 is not in any region.  Bytes after previous region: 11505080838385  Bytes before following region: 93566999090960\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      commpage (reserved)        1000000000-7000000000   [384.0G] ---\/--- SM=NUL  ...(unallocated)\n--->  GAP OF 0x5f9000000000 BYTES\n      MALLOC_NANO              600000000000-600008000000 [128.0M] rw-\/rwx SM=PRV  ",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000001, 0x00000ae6bc41a8f0","rawCodes":[1,11986117175536],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x00000ae6bc41a8f0"},
  "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":44565},
  "vmregioninfo" : "0xae6bc41a8f0 is not in any region.  Bytes after previous region: 11505080838385  Bytes before following region: 93566999090960\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      commpage (reserved)        1000000000-7000000000   [384.0G] ---\/--- SM=NUL  ...(unallocated)\n--->  GAP OF 0x5f9000000000 BYTES\n      MALLOC_NANO              600000000000-600008000000 [128.0M] rw-\/rwx SM=PRV  ",
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":10517512,"threadState":{"x":[{"value":5376417104},{"value":6156961832},{"value":6156961696},{"value":6156961752},{"value":0},{"value":105553597189824},{"value":0},{"value":105553152669424},{"value":11986117175520},{"value":6156961712},{"value":5376417488},{"value":5376417104},{"value":0},{"value":18446744073709547520},{"value":1},{"value":5376417632},{"value":5376417784},{"value":152},{"value":0},{"value":105553597212928},{"value":6156961832},{"value":6156961720},{"value":5376417448},{"value":6156961224},{"value":6156961712},{"value":6156962024},{"value":105553597212928},{"value":6156961504},{"value":5376417308}],"flavor":"ARM_THREAD_STATE64","lr":{"value":4315285948},"cpsr":{"value":1610612736},"fp":{"value":6156961360},"sp":{"value":6156961056},"esr":{"value":2449473541,"description":"(Data Abort) byte read Translation fault"},"pc":{"value":4315315036,"matchesCrashFrame":1},"far":{"value":11986117175536}},"queue":"com.apple.main-thread","frames":[{"imageOffset":5421916,"symbol":"(anonymous namespace)::CodeGenPrepare::tryToPromoteExts((anonymous namespace)::TypePromotionTransaction&, llvm::SmallVectorImpl<llvm::Instruction*> const&, llvm::SmallVectorImpl<llvm::Instruction*>&, unsigned int)","symbolLocation":172,"imageIndex":0},{"imageOffset":5392828,"symbol":"(anonymous namespace)::CodeGenPrepare::optimizeInst(llvm::Instruction*, bool&)","symbolLocation":17484,"imageIndex":0},{"imageOffset":5392828,"symbol":"(anonymous namespace)::CodeGenPrepare::optimizeInst(llvm::Instruction*, bool&)","symbolLocation":17484,"imageIndex":0},{"imageOffset":5352808,"symbol":"(anonymous namespace)::CodeGenPrepare::runOnFunction(llvm::Function&)","symbolLocation":5356,"imageIndex":0},{"imageOffset":8062608,"symbol":"llvm::FPPassManager::runOnFunction(llvm::Function&)","symbolLocation":460,"imageIndex":0},{"imageOffset":8081636,"symbol":"llvm::FPPassManager::runOnModule(llvm::Module&)","symbolLocation":52,"imageIndex":0},{"imageOffset":8064704,"symbol":"llvm::legacy::PassManagerImpl::run(llvm::Module&)","symbolLocation":552,"imageIndex":0},{"imageOffset":13612036,"symbol":"clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream> >)","symbolLocation":6728,"imageIndex":0},{"imageOffset":15088876,"symbol":"clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&)","symbolLocation":604,"imageIndex":0},{"imageOffset":25548896,"symbol":"clang::ParseAST(clang::Sema&, bool, bool)","symbolLocation":348,"imageIndex":0},{"imageOffset":16500432,"symbol":"clang::FrontendAction::Execute()","symbolLocation":60,"imageIndex":0},{"imageOffset":16195616,"symbol":"clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)","symbolLocation":1300,"imageIndex":0},{"imageOffset":16796340,"symbol":"clang::ExecuteCompilerInvocation(clang::CompilerInstance*)","symbolLocation":1212,"imageIndex":0},{"imageOffset":26976,"symbol":"cc1_main(llvm::ArrayRef<char const*>, char const*, void*)","symbolLocation":1424,"imageIndex":0},{"imageOffset":21864,"symbol":"ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&)","symbolLocation":692,"imageIndex":0},{"imageOffset":21164,"symbol":"driver_main(int, char const**)","symbolLocation":4056,"imageIndex":0},{"imageOffset":17076,"symbol":"main","symbolLocation":108,"imageIndex":0},{"imageOffset":20724,"symbol":"start","symbolLocation":520,"imageIndex":1}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "arm64",
    "base" : 4309893120,
    "size" : 61603840,
    "uuid" : "eed6af36-6dd3-34bf-bf11-1376b4fa633d",
    "path" : "\/Library\/Developer\/CommandLineTools\/usr\/bin\/clang",
    "name" : "clang"
  },
  {
    "source" : "P",
    "arch" : "arm64e",
    "base" : 4402200576,
    "size" : 393216,
    "uuid" : "86a8ba48-8bb4-3b30-9cda-051f73c74f44",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 7446134784,
  "size" : 3072180224,
  "uuid" : "a6162d66-93e3-3251-93cc-b11f7c8c830e"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=658.1M resident=0K(0%) swapped_out_or_unallocated=658.1M(100%)\nWritable regions: Total=1.3G written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=1.3G(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nKernel Alloc Once                   32K        1 \nMALLOC                           746.2M       58 \nMALLOC guard page                   96K        5 \nMALLOC_MEDIUM (reserved)         512.0M        5         reserved VM address space (unallocated)\nSTACK GUARD                         16K        1 \nStack                             64.0M        1 \nVM_ALLOCATE                        1.0G        1 \n__AUTH                              46K       12 \n__AUTH_CONST                        68K       40 \n__DATA                             591K       40 \n__DATA_CONST                      4477K       42 \n__DATA_DIRTY                        73K       21 \n__LINKEDIT                       594.7M        3 \n__OBJC_CONST                        10K        5 \n__OBJC_RO                         81.8M        1 \n__OBJC_RW                         3088K        1 \n__TEXT                            63.5M       45 \ndyld private memory               1024K        1 \nmapped file                       9328K       32 \nshared memory                       16K        1 \n===========                     =======  ======= \nTOTAL                              3.0G      316 \nTOTAL, minus reserved VM space     2.5G      316 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "60da5e84ab0ca017dace9abf",
      "factorPackIds" : {

      },
      "deploymentId" : 240000008
    },
    {
      "rolloutId" : "607844aa04477260f58a8077",
      "factorPackIds" : {
        "SIRI_MORPHUN_ASSETS" : "6103050cbfe6dc472e1c982a"
      },
      "deploymentId" : 240000066
    },
    {
      "rolloutId" : "5ffde50ce2aacd000d47a95f",
      "factorPackIds" : {

      },
      "deploymentId" : 240000076
    },
    {
      "rolloutId" : "601d9415f79519000ccd4b69",
      "factorPackIds" : {
        "SIRI_TEXT_TO_SPEECH" : "6194416dea7ed64a7812a429"
      },
      "deploymentId" : 240000322
    },
    {
      "rolloutId" : "602ad4dac86151000cf27e46",
      "factorPackIds" : {
        "SIRI_DICTATION_ASSETS" : "6181ebb28763315b9604755e"
      },
      "deploymentId" : 240000271
    },
    {
      "rolloutId" : "5fc94383418129005b4e9ae0",
      "factorPackIds" : {

      },
      "deploymentId" : 240000162
    }
  ],
  "experiments" : [

  ]
}
}
 [2021-11-28 13:24 UTC] ruudk at mphuis dot com
Turns out that it only happens with xcode's compiler.

When using Homebrew's compiler it works without issues.
 [2021-11-28 18:13 UTC] ruudk at mphuis dot com
Submitting this comment from fxcoudert (Homebrew):

1. I can reproduce the bug:
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin21.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /private/tmp/zend_jit-3d5f64.c
clang: note: diagnostic msg: /private/tmp/zend_jit-3d5f64.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg: /private/tmp/php-20211128-45522-9y0ena/php-8.1.0/.brew_home/Library/Logs/DiagnosticReports/clang_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang: note: diagnostic msg: 

********************

2. I've filed a bug report with Apple, it is FB9785205.

3. I've attached the crash files for reproducing the issue: https://www.dropbox.com/s/79c1nnerg3f8miq/zend_jit.zip?dl=0
 [2022-06-23 06:39 UTC] dixyes at gmail dot com
still not fix in newer macOS / even worse: It always happen on my ci:

/bin/sh /Users/dixyes/builder/php/php-8.1.7nts/libtool --silent --preserve-dup-
deps --tag CC --mode=compile cc -Iext/opcache/ -I/Users/dixyes/builder/php/php-8.1.7nts/ext/opcache/ -I/Users/dixyes/builder/php/php-8.1.7nts/include -I/Users/dixyes/builder/php/php-8.1.7nts/main -I/Users/dixyes/builder/php/php-8.1.7nts -I/Users/dixyes/builder/php/php-8.1.7nts/ext/date/lib -I/opt/homebrew/Cellar/openssl@1.1/1.1.1p/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/ffi -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/Cellar/oniguruma/6.9.8/include -I/Users/dixyes/builder/php/php-8.1.7nts/ext/mbstring/libmbfl -I/Users/dixyes/builder/php/php-8.1.7nts/ext/mbstring/libmbfl/mbfl -I/opt/homebrew/Cellar/libzip/1.9.0/include -I/Users/dixyes/builder/php/php-8.1.7nts/TSRM -I/Users/dixyes/builder/php/php-8.1.7nts/Zend    -fno-common -Wstrict-prototypes -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -g -O2 -fvisibility=hidden -DZEND_SIGNALS    -Wno-implicit-fallthrough -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DZEND_COMPILE_DL_EXT=1 -c /Users/dixyes/builder/php/php-8.1.7nts/ext/opcache/jit/zend_jit.c -o ext/opcache/jit/zend_jit.lo  -MMD -MF ext/opcache/jit/zend_jit.dep -MT ext/opcache/jit/zend_jit.lo
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
clang: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/zz/zyxvpxvq6csfxvn_ngzzzzzvzzzzzy/T/zend_jit-485428.c
clang: note: diagnostic msg: /var/folders/zz/zyxvpxvq6csfxvn_ngzzzzzvzzzzzy/T/zend_jit-485428.sh
clang: note: diagnostic msg: Crash backtrace is located in
clang: note: diagnostic msg: /var/empty/Library/Logs/DiagnosticReports/clang_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
clang: note: diagnostic msg:

********************
make: *** [ext/opcache/jit/zend_jit.lo] Error 1
nobody@dixmacmini php-8.1.7nts % clang -v
Apple clang version 13.0.0 (clang-1300.0.29.3)
Target: arm64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin


apple's ticket is in private, have apple replied anything useful?

Should I just disable jit to avoid this?
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Fri Dec 02 03:05:53 2022 UTC