Segmentation fault with gettext functions (Ventura, PHP 8.2.8, Apple M1 and Intel) #2243
Replies: 19 comments
-
Same issue with PHP 7.2.34_9 , Monterey. |
Beta Was this translation helpful? Give feedback.
-
I encountered a similar problem in the homebrew-core project, see this link: I've tried those fpm parameters with [email protected] and it seems to solve the issues. |
Beta Was this translation helpful? Give feedback.
-
@Saeven 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. |
Beta Was this translation helpful? Give feedback.
-
@shivammathur for sure - just wanted to share a related finding. There were no updates beyond the report 👍🏻 |
Beta Was this translation helpful? Give feedback.
-
Could you please check if Homebrew/homebrew-core#137431 (comment) work around works for your environment? You seem to using httpd(apache) with php-fpm. I found my work around works with nginx, and researching if it works on httpd. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hi folks, This is still dying horribly for me on a regular basis withi all versions of PHP, and both with mod_php and Apache2, and witih nginx under php-fpm. I've managed to generate some coredumps with nginx + php-fpm using the 8.1-debug package and PHP 8.1.22. Here's the backtrace:
This does happen with xdebug disabled too. I have applied th OBJC workaround to the plist:
This has not helped in any noticable way. Let me know if there's anything I can do to help, or more information I can provide. I know a number of my colleagues are hitting the same issue recently. |
Beta Was this translation helpful? Give feedback.
-
I got Same issue with PHP 7.4.33 , M1 Sonoma. And I just use the default config files. |
Beta Was this translation helpful? Give feedback.
-
But I tried build php (7.4.33 and 8.2)locally, and it's working. I'm still not sure what's the problem. |
Beta Was this translation helpful? Give feedback.
-
OBJC_DISABLE_INITIALIZE_FORK_SAFETY did not solve it for me, but setting LC_ALL seems to. Idea came from the link below. Added this to the homebrew.mxcl.httpd.plist EnvironmentVariables section:
Homebrew/homebrew-core#137431 (comment) Using Drupal 10 with Apache 2.4.58 and PHP 8.2.12 on macOS Ventura 13.6. |
Beta Was this translation helpful? Give feedback.
-
Bash was crashing in for me in I have all of the following set in my
|
Beta Was this translation helpful? Give feedback.
-
Actually, no it didn't fix the problem. Still getting the same stacktrace...
|
Beta Was this translation helpful? Give feedback.
-
After the LC_ALL change, my web server ran for 10 days without a single error. But then the PHP segmentation fault errors started showing up again in increasing numbers. Only solution so far is to restart the httpd process. Without the LC_ALL change, I can 100% reliably crash using the code in the first message of the the thread. It must be something additional beyond that. [Thu Nov 16 14:04:04.566816 2023] [core:notice] [pid 89945] AH00052: child pid 6532 exit signal Segmentation fault (11) |
Beta Was this translation helpful? Give feedback.
-
This seems to be a problem with macOS's CoreFoundation (or maybe how autoconf builds the source). What finally solved this for me was configuring bash with What I see during the bash configure is that autoconf is emitting My guess is that something in macOS CoreFoundation changed about 18 months ago because that's when this started happening for me. |
Beta Was this translation helpful? Give feedback.
-
Just found this comment from ten years ago... |
Beta Was this translation helpful? Give feedback.
-
Just re-re-re-compiled bash with nls enabled and this worked...
|
Beta Was this translation helpful? Give feedback.
-
Take note: PHP has decided that the longstanding default locale of |
Beta Was this translation helpful? Give feedback.
-
Any value from
|
Beta Was this translation helpful? Give feedback.
-
My website is still crashing in CFPrefsSearchListSource, but there is a second source beyond gettext. homebrew's PostgreSQL builds use buggy Apple Kerberos/Heimdal libraries. PHP is randomly crashing when connecting to a database because of the same forking issue. OBJC_DISABLE_INITIALIZE_FORK_SAFETY does not help. See details here: |
Beta Was this translation helpful? Give feedback.
-
Finally resolved by setting PGGSSENCMODE=disable. |
Beta Was this translation helpful? Give feedback.
-
`
Describe the bug
PHP works except for pages that contains gettext functions.
PHP versions
8.2.8 (also with 7.4)
To Reproduce
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
.....
Beta Was this translation helpful? Give feedback.
All reactions