[MacPorts] #70987: php80, php81: Segmentation fault when generating phar.php
MacPorts
noreply at macports.org
Tue Oct 1 16:56:31 UTC 2024
#70987: php80, php81: Segmentation fault when generating phar.php
--------------------------+------------------------
Reporter: exlemor | Owner: ryandesign
Type: defect | Status: accepted
Priority: Normal | Milestone:
Component: ports | Version: 2.10.1
Resolution: | Keywords: sequoia
Port: php80 php81 |
--------------------------+------------------------
Comment (by exlemor):
Replying to [comment:5 ryandesign]:
> I found the crash reports on the build machine. The crash when building
php80 is a little vague to me; it doesn't show the usual stack trace that
should tell us what function was running when the problem happened:
>
> {{{
> Crashed Thread: 0 Dispatch queue: com.apple.main-thread
>
> Exception Type: EXC_BAD_ACCESS (SIGSEGV)
> Exception Codes: KERN_INVALID_ADDRESS at 0x00000000000001e8
> Exception Codes: 0x0000000000000001, 0x00000000000001e8
>
> Termination Reason: Namespace SIGNAL, Code 11 Segmentation fault: 11
> Terminating Process: exc handler [75775]
>
> VM Region Info: 0x1e8 is not in any region. Bytes before following
region: 4509498904
> REGION TYPE START - END [ VSIZE]
PRT/MAX SHRMOD REGION DETAIL
> UNUSED SPACE AT START
> --->
> __TEXT 10cc98000-10d683000 [ 9.9M]
r-x/r-x SM=COW /opt/local/var/macports/*/php
>
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0 ??? 0x1e8 ???
>
>
> Thread 0 crashed with X86 Thread State (64-bit):
> rax: 0x00007fd29780c900 rbx: 0x000000010e205000 rcx:
0x0000000000000003 rdx: 0x000000010e205020
> rdi: 0x000000010e205000 rsi: 0x000000010e200000 rbp:
0x000000000000001a rsp: 0x00007ff7b3266be0
> r8: 0x000000010e205000 r9: 0x000000000000006c r10:
0x00000000001ff800 r11: 0x0000000000000030
> r12: 0x0000000000000000 r13: 0x000000010d6989c0 r14:
0x00007ff7b3266c00 r15: 0x000000010ce78ecd
> rip: 0x00000000000001e8 rfl: 0x0000000000010202 cr2:
0x00000000000001e8
>
> Logical CPU: 0
> Error Code: 0x00000014 (no mapping for user instruction read)
> Trap Number: 14
> }}}
>
> But there were four more crash logs from the build of php81. I now
realize generating phar.php also crashes when building php81 on macOS 15,
but unlike with php80 and earlier it doesn't stop the build. Two of the
crashes are segmentation faults and the logs look like the one from php80.
The other two crashes are abort traps and their logs more helpfully point
to a function—`zend_hash_find` or rather the unnamed label `.LL31` that
`zend_hash_find` calls:
>
> {{{
> Crashed Thread: 0 Dispatch queue: com.apple.main-thread
>
> Exception Type: EXC_CRASH (SIGABRT)
> Exception Codes: 0x0000000000000000, 0x0000000000000000
>
> Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6
> Terminating Process: php [40488]
>
> Application Specific Information:
> abort() called
>
>
> Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
> 0 libsystem_kernel.dylib 0x7ff813d7db52 __pthread_kill
+ 10
> 1 libsystem_pthread.dylib 0x7ff813db7f85 pthread_kill +
262
> 2 libsystem_c.dylib 0x7ff813cd8b19 abort + 126
> 3 libsystem_malloc.dylib 0x7ff813bd7ab1 malloc_vreport
+ 857
> 4 libsystem_malloc.dylib 0x7ff813bdb58b malloc_report +
151
> 5 php 0x10cf5e27d .LL31 + 203
> 6 php 0x10cef6498 zend_hash_find
+ 128
> 7 php 0x10cf752b1 lookup_class_ex
+ 312
> 8 php 0x10cf70823
zend_perform_covariant_type_check + 885
> 9 php 0x10cf75ae8
zend_do_perform_implementation_check + 554
> 10 php 0x10cf755f8
do_inheritance_check_on_method + 344
> 11 php 0x10cf722df
do_interface_implementation + 520
> 12 php 0x10ceec276
zend_class_implements + 216
> 13 php 0x10cf5d6fd
zend_register_weakref_ce + 316
> 14 php 0x10cf703be
zend_register_default_classes + 34
> 15 php 0x10cef7ba5 zm_startup_core
+ 101
> 16 php 0x10cee9ff9
zend_startup_module_ex + 259
> 17 php 0x10ceea38f
zend_startup_module_zval + 12
> 18 php 0x10cef55cd zend_hash_apply
+ 87
> 19 php 0x10ce87a9c
php_module_startup + 2180
> 20 php 0x10cfbb90d php_cli_startup
+ 13
> 21 php 0x10cfb9666 main + 1356
> 22 dyld 0x7ff813a2a2cd start + 1805
>
>
> Thread 0 crashed with X86 Thread State (64-bit):
> rax: 0x0000000000000000 rbx: 0x0000000000000006 rcx:
0x00007ff7b3203dc8 rdx: 0x0000000000000000
> rdi: 0x0000000000000103 rsi: 0x0000000000000006 rbp:
0x00007ff7b3203df0 rsp: 0x00007ff7b3203dc8
> r8: 0x000000000000002e r9: 0x0000000000000000 r10:
0x0000000000000000 r11: 0x0000000000000246
> r12: 0x0000000000000000 r13: 0x0000000000000050 r14:
0x0000000000000103 r15: 0x0000000000000016
> rip: 0x00007ff813d7db52 rfl: 0x0000000000000246 cr2:
0x0000000000000000
>
> Logical CPU: 0
> Error Code: 0x02000148
> Trap Number: 133
> }}}
>
> I don't know what phar.php is, why it is being generated, or what it is
used for. It does not, for example, as far as I can tell, get installed.
>
> Would you try installing the php81, php82, and php83 ports and running
`php81 -v`, `php82 -v`, and `php83 -v`? I believe php81 will crash but
hope php82 and php83 don't. This would help determine if we're looking for
an existing fix in php82 that we can backport or something new that still
needs to have a fix developed.
Actually MacPorts php8.1 installed fine it seems (no errors at the end)...
I am actually running MacPorts through PHPWebStudy (and PHPPWebStudy also
has built-in PHP 8.1 - 8.3 capabilities or MacPorts - I used MacPorts
integration and chose php 8.1 and that installed ) -- at least it says
installed successfully - not sure if it did or not and then installed
MySQL 8.0.x without issue...
Unfortunately, I need PHP 7.4 and not PHP 8 or newer ;(
Sincerely,
Emmanuel.
--
Ticket URL: <https://trac.macports.org/ticket/70987#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list