homebrew-php: Segmentation fault with gettext functions (Ventura, PHP 8.2.8, Apple M1 and Intel)
` Describe the bug PHP works except for pages that contains gettext functions.
PHP versions 8.2.8 (also with 7.4)
To Reproduce
<?php
if (function_exists("_")) {
echo "GETTEXT IS AVAILABLE!<br>";
$s=_("string"); // <- segmentation fault
}
I’ve tried to reinstall homebrew from scratch with no luck.
UPDATE: I can confirm that the problem is not Apple M1 specific. I’ve just done a brew update and brew upgrade on an Intel Mac that worked perfectly with gettext (PHP 8.2.7 and other old packages as deps was installed) and after the full upgrade the problem appears.
Error log: [Thu Jul 27 08:25:45.217193 2023] [core:notice] [pid 17508] AH00052: child pid 17511 exit signal Segmentation fault (11)
Console dump:
Translated Report (Full Report Below)
Process: httpd [1270] Path: /opt/homebrew/*/httpd Identifier: httpd Version: ??? Code Type: ARM-64 (Native) Parent Process: httpd [1265] Responsible: httpd [1265] User ID: 501
Date/Time: 2023-07-26 19:27:24.1495 +0200 OS Version: macOS 13.4.1 (22F770820d) Report Version: 12 Anonymous UUID: 4433CAA0-BF76-E312-9F89-D303F03DC9E2
Time Awake Since Boot: 530 seconds
System Integrity Protection: disabled
Crashed Thread: 0 Dispatch queue: com.apple.root.utility-qos
Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000110 Exception Codes: 0x0000000000000001, 0x0000000000000110
VM Region Info: 0x110 is not in any region. Bytes before following region: 105553518919408
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
UNUSED SPACE AT START
—>
MALLOC_NANO (reserved) 600018000000-600020000000 [128.0M] rw-/rwx SM=NUL …(unallocated)
Application Specific Information: *** multi-threaded process forked *** crashed on child side of fork pre-exec
Kernel Triage: VM - (arg = 0x0) pmap_enter retried due to resource shortage VM - (arg = 0x0) pmap_enter retried due to resource shortage VM - (arg = 0x0) pmap_enter retried due to resource shortage
Thread 0 Crashed:: Dispatch queue: com.apple.root.utility-qos 0 libdispatch.dylib 0x18657483c _dispatch_apply_with_attr_f + 1164 1 libdispatch.dylib 0x186574a38 dispatch_apply + 96 2 CoreFoundation 0x1869173cc __103-[CFPrefsSearchListSource synchronouslySendSystemMessage:andUserMessage:andDirectMessage:replyHandler:]_block_invoke.52 + 132 3 CoreFoundation 0x1867a4460 CFPREFERENCES_IS_WAITING_FOR_SYSTEM_AND_USER_CFPREFSDS + 100 4 CoreFoundation 0x1869165fc -[CFPrefsSearchListSource synchronouslySendSystemMessage:andUserMessage:andDirectMessage:replyHandler:] + 232 5 CoreFoundation 0x1867a2b80 -[CFPrefsSearchListSource alreadylocked_generationCountFromListOfSources:count:] + 232 6 CoreFoundation 0x1867a288c -[CFPrefsSearchListSource alreadylocked_getDictionary:] + 468 7 CoreFoundation 0x1867a2410 -[CFPrefsSearchListSource alreadylocked_copyValueForKey:] + 172 8 CoreFoundation 0x1867a2344 -[CFPrefsSource copyValueForKey:] + 52 9 CoreFoundation 0x1867a22f8 __76-[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:]_block_invoke + 32 10 CoreFoundation 0x18679b260 __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 376 11 CoreFoundation 0x186917c78 -[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 384 12 CoreFoundation 0x18679ab30 -[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:] + 168 13 CoreFoundation 0x18679aa4c _CFPreferencesCopyAppValueWithContainerAndConfiguration + 112 14 libintl.8.dylib 0x100b3cca4 _nl_locale_name_default + 72 15 libintl.8.dylib 0x100b3af54 libintl_dcigettext + 1852 16 libphp.so 0x101a0f9f0 zif_gettext + 84 17 libphp.so 0x101d07d04 ZEND_DO_ICALL_SPEC_RETVAL_USED_HANDLER + 84 18 libphp.so 0x101cc9a70 execute_ex + 52 19 libphp.so 0x101cc9c6c zend_execute + 288 20 libphp.so 0x101ca9fe4 zend_execute_scripts + 156 21 libphp.so 0x101c4fd94 php_execute_script + 460 22 libphp.so 0x101d8efac php_handler + 1024 23 httpd 0x100662414 ap_run_handler + 64 24 httpd 0x100662aec ap_invoke_handler + 264 25 httpd 0x100699eb4 ap_process_async_request + 792 26 httpd 0x100699f64 ap_process_request + 24 27 httpd 0x100696dc8 ap_process_http_connection + 344 28 httpd 0x1006738ac ap_run_process_connection + 64 29 mod_mpm_prefork.so 0x10087e3ec child_main + 1092 30 mod_mpm_prefork.so 0x10087de74 make_child + 436 31 mod_mpm_prefork.so 0x10087ded4 startup_children + 96 32 mod_mpm_prefork.so 0x10087d1ec prefork_run + 324 33 httpd 0x100675fbc ap_run_mpm + 84 34 httpd 0x100669500 main + 2200 35 dyld 0x1863b7f28 start + 2236
Thread 0 crashed with ARM Thread State (64-bit): x0: 0x0000000139e05ff0 x1: 0x0000000000000001 x2: 0x0000000000000001 x3: 0x0000000000000004 x4: 0x00000001869173f4 x5: 0x0000000000000001 x6: 0x0000000139e04390 x7: 0x0000000000000130 x8: 0x0000000000000100 x9: 0x0000000000000303 x10: 0x0000000018922220 x11: 0x0000000008922220 x12: 0x0000000008922220 x13: 0x0000000018922220 x14: 0x00000000ffffffff x15: 0x00000001e16ebda0 x16: 0x0000000186573e3c x17: 0x00000001e3457368 x18: 0x0000000000000000 x19: 0x00000001e16edc80 x20: 0x0000000000000000 x21: 0x0000000139e05ff0 x22: 0x00000000100004ff x23: 0x00006000022586c0 x24: 0x0000000139e05ff0 x25: 0x0000000000000104 x26: 0x00000001e16e9ee0 x27: 0x00000001e16e9f80 x28: 0x0000000000000001 fp: 0x000000016f7a2230 lr: 0xfb1a000186574814 sp: 0x000000016f7a2180 pc: 0x000000018657483c cpsr: 0x60001000 far: 0x0000000000000110 esr: 0x56000080 Address size fault
…
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 3
- Comments: 19 (1 by maintainers)
@Saeven If Homebrew decides to add the env parameter
OBJC_DISABLE_INITIALIZE_FORK_SAFETYto the plist in the php formulae, I will add it here as well.But, it would be great if we had a patch in php itself for this as from what I understand the env parameter just removes the safety check and does not solve the actual issue in the language. https://github.com/php/php-src/issues/11818