Bug #81394 [Opn->Fbk]: Apache faults when using cURL with IMAP enabled
| From: | requinix@php.net | Date: | Fri, 27 Aug 2021 20:07:42 +0000 |
| Subject: | Bug #81394 [Opn->Fbk]: Apache faults when using cURL with IMAP enabled | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-236131@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=81394&edit=1
ID: 81394
Updated by: requinix@php.net
Reported by: chauncey at mcaskill dot ca
Summary: Apache faults when using cURL with IMAP enabled
-Status: Open
+Status: Feedback
Type: Bug
Package: cURL related
Operating System: macOS
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Does it still happen without XDebug?
Previous Comments:
------------------------------------------------------------------------
[2021-08-27 19:14:17] chauncey at mcaskill dot ca
Description:
------------
While running a PHP script via Apache2:
* When the IMAP extension is enabled, calling
curl_exec() immediately kills the PHP
script. PHP does not log any errors, Apache log's a segmentation fault (see below). If HTTPD is
running as root, calling curl_exec() works as expected. If running the script via PHP
binary, calling curl_exec() works as expected.
* When the IMAP extension is disabled (or not installed), calling curl_exec() works as
expected with or without HTTPD running as root.
Affects PHP 5.6 â 8.1, Intel and Silicon, Mojave to Big Sur, installed via Homebrew. Using
Homebrew's HTTPD. Using Shivam Mathur's PHP and PHP extensions.
```
IMAP c-Client Version: 2007f
SSL Support: enabled
Kerberos Support: enabled
```
```
cURL Version: 7.78.0
SSL Version: (SecureTransport) OpenSSL/1.1.1l
ZLib Version: 1.2.11
libSSH Version: libssh2/1.9.0
```
Initial GitHub issue: https://github.com/shivammathur/homebrew-php/issues/454
Related GitHub issue: https://github.com/Homebrew/homebrew-core/issues/80460
Related PHP bug report: https://bugs.php.net/bug.php?id=76507
Test script:
---------------
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://duckduckgo.com');
curl_exec($ch);
curl_close($ch);
?>
Via PHP CLI, cURL request works: php test.php
Via Apache, the cURL request fails: any browser or curl http://localhost/test.php or wget http://localhost/test.php
Expected result:
----------------
The snippet should output the HTML response for the DuckDuckGo home page.
Actual result:
--------------
Empty response from server.
Apache log:
```
[Mon Aug 23 12:16:18.240389 2021] [core:notice] [pid 19198] AH00052: child pid 19371 exit signal
Segmentation fault (11)
```
Crash report (summary):
```
Thread 0 Crashed:: Dispatch queue: com.apple.root.utility-qos
0 libdispatch.dylib 0x000000018dfdbe3c dispatch_apply_f + 716
1 libdispatch.dylib 0x000000018dfdbe18 dispatch_apply_f + 680
2 com.apple.CoreFoundation 0x000000018e38f464 __104-[CFPrefsSearchListSource
synchronouslySendDaemonMessage:andAgentMessage:andDirectMessage:replyHandler:]_block_invoke.98 + 132
3 com.apple.CoreFoundation 0x000000018e228e78
CFPREFERENCES_IS_WAITING_FOR_SYSTEM_AND_USER_CFPREFSDS + 100
4 com.apple.CoreFoundation 0x000000018e228cb8 -[CFPrefsSearchListSource
synchronouslySendDaemonMessage:andAgentMessage:andDirectMessage:replyHandler:] + 232
5 com.apple.CoreFoundation 0x000000018e227468 -[CFPrefsSearchListSource
alreadylocked_generationCountFromListOfSources:count:] + 252
6 com.apple.CoreFoundation 0x000000018e227144 -[CFPrefsSearchListSource
alreadylocked_getDictionary:] + 468
7 com.apple.CoreFoundation 0x000000018e226cf0 -[CFPrefsSearchListSource
alreadylocked_copyValueForKey:] + 176
8 com.apple.CoreFoundation 0x000000018e226c20 -[CFPrefsSource copyValueForKey:] + 60
9 com.apple.CoreFoundation 0x000000018e226bcc __76-[_CFXPreferences
copyAppValueForKey:identifier:container:configurationURL:]_block_invoke + 44
10 com.apple.CoreFoundation 0x000000018e21fd98 __108-[_CFXPreferences(SearchListAdditions)
withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 384
11 com.apple.CoreFoundation 0x000000018e38fd3c -[_CFXPreferences
withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 392
12 com.apple.CoreFoundation 0x000000018e21f750 -[_CFXPreferences
copyAppValueForKey:identifier:container:configurationURL:] + 168
13 com.apple.CoreFoundation 0x000000018e21f66c
_CFPreferencesCopyAppValueWithContainerAndConfiguration + 128
14 com.apple.SystemConfiguration 0x000000018ecd5030 SCDynamicStoreCopyProxiesWithOptions + 180
15 libcurl.4.dylib 0x0000000102302950 Curl_resolv + 296
16 libcurl.4.dylib 0x00000001023302e0 create_conn + 11444
17 libcurl.4.dylib 0x000000010232d58c Curl_connect + 96
18 libcurl.4.dylib 0x0000000102317564 multi_runsingle + 444
19 libcurl.4.dylib 0x00000001023172b4 curl_multi_perform + 152
20 libcurl.4.dylib 0x00000001022f8f18 curl_easy_perform + 280
21 libphp7.so 0x0000000100e7549c zif_curl_exec + 104
22 xdebug.so 0x000000010493271c xdebug_execute_internal + 584
23 libphp7.so 0x00000001011b6bf0 ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER + 376
24 libphp7.so 0x000000010117da44 execute_ex + 88
25 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
26 libphp7.so 0x00000001011b7018 ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 472
27 libphp7.so 0x000000010117da44 execute_ex + 88
28 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
29 libphp7.so 0x00000001011b7018 ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 472
30 libphp7.so 0x000000010117da44 execute_ex + 88
31 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
32 libphp7.so 0x00000001011b7018 ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 472
33 libphp7.so 0x000000010117da44 execute_ex + 88
34 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
35 libphp7.so 0x00000001011b7018 ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 472
36 libphp7.so 0x000000010117da44 execute_ex + 88
37 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
38 libphp7.so 0x00000001011b7018 ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 472
39 libphp7.so 0x000000010117da44 execute_ex + 88
40 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
41 libphp7.so 0x00000001011b7018 ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 472
42 libphp7.so 0x000000010117da44 execute_ex + 88
43 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
44 libphp7.so 0x00000001011b7018 ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER + 472
45 libphp7.so 0x000000010117da44 execute_ex + 88
46 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
47 libphp7.so 0x00000001011b6cac ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER + 564
48 libphp7.so 0x000000010117da44 execute_ex + 88
49 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
50 libphp7.so 0x00000001011b6cac ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER + 564
51 libphp7.so 0x000000010117da44 execute_ex + 88
52 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
53 libphp7.so 0x00000001011b6cac ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER + 564
54 libphp7.so 0x000000010117da44 execute_ex + 88
55 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
56 libphp7.so 0x00000001011bb5e8 ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER + 624
57 libphp7.so 0x000000010117da44 execute_ex + 88
58 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
59 libphp7.so 0x00000001011bb5e8 ZEND_INCLUDE_OR_EVAL_SPEC_TMPVAR_HANDLER + 624
60 libphp7.so 0x000000010117da44 execute_ex + 88
61 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
62 libphp7.so 0x00000001011bb300 ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER + 584
63 libphp7.so 0x000000010117da44 execute_ex + 88
64 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
65 libphp7.so 0x00000001011bb300 ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER + 584
66 libphp7.so 0x000000010117da44 execute_ex + 88
67 xdebug.so 0x0000000104932408 xdebug_execute_ex + 780
68 libphp7.so 0x000000010117db88 zend_execute + 272
69 libphp7.so 0x00000001011417a0 zend_execute_scripts + 152
70 libphp7.so 0x00000001010ee330 php_execute_script + 532
71 libphp7.so 0x00000001011fc6c0 php_handler + 916
72 httpd 0x0000000100682e70 ap_run_handler + 64
73 httpd 0x0000000100683558 ap_invoke_handler + 268
74 httpd 0x00000001006b98d0 ap_internal_redirect + 60
75 mod_rewrite.so 0x0000000100e03bc0 handler_redirect + 136
76 httpd 0x0000000100682e70 ap_run_handler + 64
77 httpd 0x0000000100683558 ap_invoke_handler + 268
78 httpd 0x00000001006b948c ap_process_async_request + 792
79 httpd 0x00000001006b953c ap_process_request + 24
80 httpd 0x00000001006b63d4 ap_process_http_connection + 344
81 httpd 0x0000000100693e6c ap_run_process_connection + 64
82 mod_mpm_prefork.so 0x0000000100886530 child_main + 1032
83 mod_mpm_prefork.so 0x0000000100885ff4 make_child + 432
84 mod_mpm_prefork.so 0x0000000100885a58 prefork_run + 2056
85 httpd 0x00000001006964e8 ap_run_mpm + 84
86 httpd 0x0000000100689ea4 main + 1924
87 libdyld.dylib 0x000000018e195430 start + 4
```
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=81394&edit=1