swoole / swoole-src

🚀 Coroutine-based concurrency library for PHP
https://www.swoole.com
Apache License 2.0
18.25k stars 3.16k forks source link

mac 启用了swoole_curl 后composer执行没有任何返回 #5272

Open longfeiRen opened 2 months ago

longfeiRen commented 2 months ago

Please answer these questions before submitting your issue.

  1. What did you do? If possible, provide a simple script for reproducing the error.

执行composer self-update 没有任何返回也未执行

  1. What did you expect to see? 在php.ini 注释掉 ;extension="swoole.so" 后正常返回

    You are already using the latest available Composer version 2.7.1 (stable channel).
  2. What did you see instead? 在mac 异常日志中可以看到

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

Process: php [57324] Path: /usr/local/Cellar/php/8.3.3/bin/php Identifier: php Version: ??? Code Type: X86-64 (Native) Parent Process: php [57323] Responsible: phpstorm [735] User ID: 501

Date/Time: 2024-03-11 18:03:06.8296 +0800 OS Version: macOS 12.6.6 (21G646) Report Version: 12 Bridge OS Version: 3.0 (14Y910) Anonymous UUID: E5EA30F7-FC49-8BA0-C6BD-9531649A9EF5

Time Awake Since Boot: 10000 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 0x0000000000000009 Exception Codes: 0x0000000000000001, 0x0000000000000009 Exception Note: EXC_CORPSE_NOTIFY

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

VM Region Info: 0x9 is not in any region. Bytes before following region: 140737486696439 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL UNUSED SPACE AT START --->
VM_ALLOCATE 7fffffe6b000-7fffffe6c000 [ 4K] r-x/r-x SM=ALI

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 php 0x1027e5765 zval_ptr_dtor + 4 1 swoole.so 0x10632bcda swoole_curl_free_obj(_zend_object*) + 314 2 php 0x10287af28 zend_objects_store_del + 176 3 php 0x1027fa2e2 zend_array_destroy + 147 4 php 0x102851b1f zend_leave_helper_SPEC + 122 5 php 0x102807f91 execute_ex + 89 6 php 0x1028081b3 zend_execute + 336 7 php 0x1027e87d6 zend_execute_scripts + 272 8 php 0x1027874f7 php_execute_script + 394 9 php 0x1028c427b do_cli + 6716 10 php 0x1028c26cb main + 641 11 dyld 0x103d5152e start + 462

Thread 1: 0 libsystem_pthread.dylib 0x7ff81f7b8f48 start_wqthread + 0

Thread 0 crashed with X86 Thread State (64-bit): rax: 0x0000000000000000 rbx: 0x0000000109c353f0 rcx: 0x0000000000000000 rdx: 0x0000000109a7b380 rdi: 0x0000000000000000 rsi: 0x0000000105c00000 rbp: 0x00007ff7bda91e90 rsp: 0x00007ff7bda91e90 r8: 0x0000000105d6f348 r9: 0x0000000000000000 r10: 0x00000000000007fb r11: 0x00000000000003ff r12: 0x000000010960fe00 r13: 0x000000000000000b r14: 0x000000010960ff98 r15: 0x0000000106331670 rip: 0x00000001027e5765 rfl: 0x0000000000010246 cr2: 0x0000000000000009

Logical CPU: 0 Error Code: 0x00000004 (no mapping for user data read) Trap Number: 14

Thread 0 instruction stream: 48 63 db 48 0f af fb 49-03 7c 24 10 41 ff d7 ff Hc.H...I.|$.A... c3 41 3b 5c 24 04 7c e4-45 84 f6 74 21 49 8b 7c .A;\$.|.E..t!I.| 24 10 48 85 ff 74 0e e8-7e c1 fd ff 49 c7 44 24 $.H..t..~...I.D$ 10 00 00 00 00 49 c7 44-24 04 00 00 00 00 5b 41 .....I.D$.....[A 5c 41 5e 41 5f 5d c3 55-48 89 e5 8b 47 04 83 e0 \A^A_].UH...G... 0f 48 8d 0d c3 27 bd 00-5d ff 24 c1 55 48 89 e5 .H...'..].$.UH.. [80]7f 09 00 74 23 48 8b-3f ff 0f 8b 47 04 74 1b ....t#H.?...G.t. <== 83 f8 1a 75 0d f6 47 11-02 74 0e 48 8b 7f 08 8b ...u..G..t.H.... 47 04 a9 10 fc ff ff 74-10 5d c3 83 e0 0f 48 8d G......t.]....H. 0d 86 27 bd 00 5d ff 24-c1 5d e9 cb d6 07 00 55 ..'..].$.].....U 48 89 e5 80 7f 09 00 74-07 48 8b 07 ff 08 74 02 H......t.H....t. 5d c3 80 7f 08 06 75 09-48 89 c7 5d e9 96 6c 14 ].....u.H..]..l.

Binary Images: 0x10246c000 - 0x1032fbfff php () <35c33282-ac74-3e49-8738-b413779c4134> /usr/local/Cellar/php/8.3.3/bin/php 0x1061cc000 - 0x1063cffff swoole.so () <0aaeeba5-782b-3092-982f-b988d70d0d9c> /usr/local/lib/php/pecl/20230831/swoole.so 0x103d4c000 - 0x103db7fff dyld () <2517e9fe-884a-3855-8532-92bffba3f81c> /usr/lib/dyld 0x7ff81f7b7000 - 0x7ff81f7c2fff libsystem_pthread.dylib () /usr/lib/system/libsystem_pthread.dylib 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: 1 thread_create: 0 thread_set_state: 192

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

                            VIRTUAL   REGION 

REGION TYPE SIZE COUNT (non-coalesced) =========== ======= ======= Activity Tracing 256K 1 Kernel Alloc Once 8K 1 MALLOC 194.8M 32 MALLOC guard page 16K 4 MALLOC_LARGE (reserved) 64K 1 reserved VM address space (unallocated) MALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated) Memory Tag 250 20.8M 10 ObjC additional data 15K 1 STACK GUARD 56.0M 2 Stack 8712K 2 VM_ALLOCATE 2060K 3 VM_ALLOCATE (reserved) 192K 1 reserved VM address space (unallocated) DATA 4581K 188 DATA_CONST 8046K 145 __DATA_DIRTY 211K 51 LINKEDIT 653.8M 65 TEXT 158.2M 205 __UNICODE 592K 1 dyld private memory 1024K 1 mapped file 48K 1 shared memory 44K 4 =========== ======= ======= TOTAL 1.5G 720 TOTAL, minus reserved VM space 1.1G 720


Full Report

{"app_name":"php","timestamp":"2024-03-11 18:03:07.00 +0800","app_version":"","slice_uuid":"35c33282-ac74-3e49-8738-b413779c4134","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 12.6.6 (21G646)","incident_id":"F688AAF1-D5FF-465B-B5AD-F6427F645A45","name":"php"} { "uptime" : 10000, "procLaunch" : "2024-03-11 18:02:56.4346 +0800", "procRole" : "Unspecified", "version" : 2, "userID" : 501, "deployVersion" : 210, "modelCode" : "MacBookPro13,3", "procStartAbsTime" : 10644465291336, "coalitionID" : 774, "osVersion" : { "train" : "macOS 12.6.6", "build" : "21G646", "releaseType" : "User" }, "captureTime" : "2024-03-11 18:03:06.8296 +0800", "incident" : "F688AAF1-D5FF-465B-B5AD-F6427F645A45", "bug_type" : "309", "pid" : 57324, "procExitAbsTime" : 10654857533970, "cpuType" : "X86-64", "procName" : "php", "procPath" : "\/usr\/local\/Cellar\/php\/8.3.3\/bin\/php", "parentProc" : "php", "parentPid" : 57323, "coalitionName" : "com.jetbrains.PhpStorm", "crashReporterKey" : "E5EA30F7-FC49-8BA0-C6BD-9531649A9EF5", "responsiblePid" : 735, "responsibleProc" : "phpstorm", "bridgeVersion" : {"build":"14Y910","train":"3.0"}, "sip" : "enabled", "vmRegionInfo" : "0x9 is not in any region. Bytes before following region: 140737486696439\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n VM_ALLOCATE 7fffffe6b000-7fffffe6c000 [ 4K] r-x\/r-x SM=ALI ", "isCorpse" : 1, "exception" : {"codes":"0x0000000000000001, 0x0000000000000009","rawCodes":[1,9],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x0000000000000009"}, "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":57324}, "vmregioninfo" : "0x9 is not in any region. Bytes before following region: 140737486696439\n REGION TYPE START - END [ VSIZE] PRT\/MAX SHRMOD REGION DETAIL\n UNUSED SPACE AT START\n---> \n VM_ALLOCATE 7fffffe6b000-7fffffe6c000 [ 4K] r-x\/r-x SM=ALI ", "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":192,"task_for_pid":1},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0}, "faultingThread" : 0, "threads" : [{"triggered":true,"id":435620,"instructionState":{"instructionStream":{"bytes":[72,99,219,72,15,175,251,73,3,124,36,16,65,255,215,255,195,65,59,92,36,4,124,228,69,132,246,116,33,73,139,124,36,16,72,133,255,116,14,232,126,193,253,255,73,199,68,36,16,0,0,0,0,73,199,68,36,4,0,0,0,0,91,65,92,65,94,65,95,93,195,85,72,137,229,139,71,4,131,224,15,72,141,13,195,39,189,0,93,255,36,193,85,72,137,229,128,127,9,0,116,35,72,139,63,255,15,139,71,4,116,27,131,248,26,117,13,246,71,17,2,116,14,72,139,127,8,139,71,4,169,16,252,255,255,116,16,93,195,131,224,15,72,141,13,134,39,189,0,93,255,36,193,93,233,203,214,7,0,85,72,137,229,128,127,9,0,116,7,72,139,7,255,8,116,2,93,195,128,127,8,6,117,9,72,137,199,93,233,150,108,20],"offset":96}},"threadState":{"r13":{"value":11},"rax":{"value":0},"rflags":{"value":66118},"cpu":{"value":0},"r14":{"value":4452319128},"rsi":{"value":4391436288},"r8":{"value":4392940360},"cr2":{"value":9},"rdx":{"value":4456952704},"r10":{"value":2043},"r9":{"value":0},"r15":{"value":4398978672,"symbolLocation":0,"symbol":"curl_write_nothing(char, unsigned long, unsigned long, void)"},"rbx":{"value":4458763248},"trap":{"value":14,"description":"(no mapping for user data read)"},"err":{"value":4},"r11":{"value":1023},"rip":{"value":4336801637,"matchesCrashFrame":1},"rbp":{"value":140702015626896},"rsp":{"value":140702015626896},"r12":{"value":4452318720},"rcx":{"value":0},"flavor":"x86_THREAD_STATE","rdi":{"value":0}},"queue":"com.apple.main-thread","frames":[{"imageOffset":3643237,"symbol":"zval_ptr_dtor","symbolLocation":4,"imageIndex":0},{"imageOffset":1440986,"symbol":"swoole_curl_free_obj(_zend_object*)","symbolLocation":314,"imageIndex":1},{"imageOffset":4255528,"symbol":"zend_objects_store_del","symbolLocation":176,"imageIndex":0},{"imageOffset":3728098,"symbol":"zend_array_destroy","symbolLocation":147,"imageIndex":0},{"imageOffset":4086559,"symbol":"zend_leave_helper_SPEC","symbolLocation":122,"imageIndex":0},{"imageOffset":3784593,"symbol":"execute_ex","symbolLocation":89,"imageIndex":0},{"imageOffset":3785139,"symbol":"zend_execute","symbolLocation":336,"imageIndex":0},{"imageOffset":3655638,"symbol":"zend_execute_scripts","symbolLocation":272,"imageIndex":0},{"imageOffset":3257591,"symbol":"php_execute_script","symbolLocation":394,"imageIndex":0},{"imageOffset":4555387,"symbol":"do_cli","symbolLocation":6716,"imageIndex":0},{"imageOffset":4548299,"symbol":"main","symbolLocation":641,"imageIndex":0},{"imageOffset":21806,"symbol":"start","symbolLocation":462,"imageIndex":2}]},{"id":435621,"frames":[{"imageOffset":8008,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":3}]}], "usedImages" : [ { "source" : "P", "arch" : "x86_64", "base" : 4333158400, "size" : 15269888, "uuid" : "35c33282-ac74-3e49-8738-b413779c4134", "path" : "\/usr\/local\/Cellar\/php\/8.3.3\/bin\/php", "name" : "php" }, { "source" : "P", "arch" : "x86_64", "base" : 4397514752, "size" : 2113536, "uuid" : "0aaeeba5-782b-3092-982f-b988d70d0d9c", "path" : "\/usr\/local\/lib\/php\/pecl\/20230831\/swoole.so", "name" : "swoole.so" }, { "source" : "P", "arch" : "x86_64", "base" : 4359241728, "size" : 442368, "uuid" : "2517e9fe-884a-3855-8532-92bffba3f81c", "path" : "\/usr\/lib\/dyld", "name" : "dyld" }, { "source" : "P", "arch" : "x86_64", "base" : 140703656800256, "size" : 49152, "uuid" : "e5d44afd-2577-3cee-8711-9d8d426229e0", "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib", "name" : "libsystem_pthread.dylib" }, { "size" : 0, "source" : "A", "base" : 0, "uuid" : "00000000-0000-0000-0000-000000000000" } ], "sharedCache" : { "base" : 140703653543936, "size" : 19331678208, "uuid" : "f2ce8b0d-f2e7-3c14-88fa-430ab7913380" }, "vmSummary" : "ReadOnly portion of Libraries: Total=811.9M resident=0K(0%) swapped_out_or_unallocated=811.9M(100%)\nWritable regions: Total=611.5M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=611.5M(100%)\n\n VIRTUAL REGION \nREGION TYPE SIZE COUNT (non-coalesced) \n=========== ======= ======= \nActivity Tracing 256K 1 \nKernel Alloc Once 8K 1 \nMALLOC 194.8M 32 \nMALLOC guard page 16K 4 \nMALLOC_LARGE (reserved) 64K 1 reserved VM address space (unallocated)\nMALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)\nMemory Tag 250 20.8M 10 \nObjC additional data 15K 1 \nSTACK GUARD 56.0M 2 \nStack 8712K 2 \nVM_ALLOCATE 2060K 3 \nVM_ALLOCATE (reserved) 192K 1 reserved VM address space (unallocated)\nDATA 4581K 188 \nDATA_CONST 8046K 145 \n__DATA_DIRTY 211K 51 \nLINKEDIT 653.8M 65 \nTEXT 158.2M 205 \n__UNICODE 592K 1 \ndyld private memory 1024K 1 \nmapped file 48K 1 \nshared memory 44K 4 \n=========== ======= ======= \nTOTAL 1.5G 720 \nTOTAL, minus reserved VM space 1.1G 720 \n", "legacyInfo" : { "threadTriggered" : { "queue" : "com.apple.main-thread" } }, "trialInfo" : { "rollouts" : [ { "rolloutId" : "6297d96be2c9387df974efa4", "factorPackIds" : {

  },
  "deploymentId" : 240000014
},
{
  "rolloutId" : "6112e14f37f5d11121dcd519",
  "factorPackIds" : {
    "SIRI_TEXT_TO_SPEECH" : "634710168e8be655c1316aaa"
  },
  "deploymentId" : 240000231
}

], "experiments" : [ { "treatmentId" : "00f62786-ceb5-418f-a586-adcc2922cf89", "experimentId" : "65d62240cb0e2417d11ce6e1", "deploymentId" : 400000001 } ] } }


4. What version of Swoole are you using (show your `php --ri swoole`)?

swoole

Swoole => enabled Author => Swoole Team team@swoole.com Version => 5.1.1 Built => Mar 7 2024 17:16:49 coroutine => enabled with boost asm context kqueue => enabled rwlock => enabled sockets => enabled openssl => OpenSSL 1.1.1w 11 Sep 2023 dtls => enabled http2 => enabled json => enabled curl-native => enabled pcre => enabled c-ares => 1.26.0 zlib => 1.2.11 brotli => E16781312/D16781312 mysqlnd => enabled async_redis => enabled

Directive => Local Value => Master Value swoole.enable_coroutine => On => On swoole.enable_library => On => On swoole.enable_fiber_mock => Off => Off swoole.enable_preemptive_scheduler => Off => Off swoole.display_errors => On => On swoole.use_shortname => Off => Off swoole.unixsock_buffer_size => 262144 => 262144


5. What is your machine environment used (show your `uname -a` & `php -v` & `gcc -v`) ?

uname -a Darwin bogon 21.6.0 Darwin Kernel Version 21.6.0: Mon Apr 24 21:10:53 PDT 2023; root:xnu-8020.240.18.701.5~1/RELEASE_X86_64 x86_64

php -v PHP 8.3.3 (cli) (built: Feb 16 2024 05:30:03) (NTS) Copyright (c) The PHP Group Zend Engine v4.3.3, Copyright (c) Zend Technologies with Xdebug v3.3.1, Copyright (c) 2002-2023, by Derick Rethans with Zend OPcache v8.3.3, Copyright (c), by Zend Technologies

gcc -v

Apple clang version 13.1.6 (clang-1316.0.21.2.5) Target: x86_64-apple-darwin21.6.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

NathanFreeman commented 2 months ago

swoole5.1.1兼容8.3的curl有问题,要升级到swoole5.1.2

longfeiRen commented 2 months ago

swoole5.1.1兼容8.3的curl有问题,要升级到swoole5.1.2

升级到5.1.2依然不行

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

Process:               php [58203]
Path:                  /usr/local/Cellar/php/8.3.3/bin/php
Identifier:            php
Version:               ???
Code Type:             X86-64 (Native)
Parent Process:        Exited process [58192]
Responsible:           phpstorm [735]
User ID:               501

Date/Time:             2024-03-12 10:12:52.1811 +0800
OS Version:            macOS 12.6.6 (21G646)
Report Version:        12
Bridge OS Version:     3.0 (14Y910)
Anonymous UUID:        E5EA30F7-FC49-8BA0-C6BD-9531649A9EF5

Sleep/Wake UUID:       FED066C2-F56B-4AA2-8C55-EE091D9204F8

Time Awake Since Boot: 23000 seconds
Time Since Wake:       2159 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 0x0000000000000009
Exception Codes:       0x0000000000000001, 0x0000000000000009
Exception Note:        EXC_CORPSE_NOTIFY

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

VM Region Info: 0x9 is not in any region.  Bytes before following region: 140737486696439
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      VM_ALLOCATE              7fffffe6b000-7fffffe6c000 [    4K] r-x/r-x SM=ALI  

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   php                                    0x104868765 zval_ptr_dtor + 4
1   swoole.so                              0x10852a74a _php_curl_free(php_curl*) + 269 (interface.cc:2468) [inlined]
2   swoole.so                              0x10852a74a swoole_curl_free_obj(_zend_object*) + 314 (interface.cc:2527)
3   php                                    0x1048fdf28 zend_objects_store_del + 176
4   php                                    0x10487d2e2 zend_array_destroy + 147
5   php                                    0x1048d4b1f zend_leave_helper_SPEC + 122
6   php                                    0x10488af91 execute_ex + 89
7   php                                    0x10488b1b3 zend_execute + 336
8   php                                    0x10486b7d6 zend_execute_scripts + 272
9   php                                    0x10480a4f7 php_execute_script + 394
10  php                                    0x10494727b do_cli + 6716
11  php                                    0x1049456cb main + 641
12  dyld                                   0x11091c52e start + 462

Thread 1:
0   libsystem_pthread.dylib             0x7ff81f7b8f48 start_wqthread + 0

Thread 2:
0   libsystem_pthread.dylib             0x7ff81f7b8f48 start_wqthread + 0

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x000000010bc54150  rcx: 0x0000000000000000  rdx: 0x000000010ba863a0
  rdi: 0x0000000000000000  rsi: 0x000000010ae00000  rbp: 0x00007ff7bba0ee90  rsp: 0x00007ff7bba0ee90
   r8: 0x000000010aee1368   r9: 0x0000000000000000  r10: 0x00000000000007fb  r11: 0x00000000000003ff
  r12: 0x000000010b6dd600  r13: 0x000000000000000b  r14: 0x000000010b6dd798  r15: 0x0000000108530140
  rip: 0x0000000104868765  rfl: 0x0000000000010246  cr2: 0x0000000000000009

Logical CPU:     0
Error Code:      0x00000004 (no mapping for user data read)
Trap Number:     14

Thread 0 instruction stream:
  48 63 db 48 0f af fb 49-03 7c 24 10 41 ff d7 ff  Hc.H...I.|$.A...
  c3 41 3b 5c 24 04 7c e4-45 84 f6 74 21 49 8b 7c  .A;\$.|.E..t!I.|
  24 10 48 85 ff 74 0e e8-7e c1 fd ff 49 c7 44 24  $.H..t..~...I.D$
  10 00 00 00 00 49 c7 44-24 04 00 00 00 00 5b 41  .....I.D$.....[A
  5c 41 5e 41 5f 5d c3 55-48 89 e5 8b 47 04 83 e0  \A^A_].UH...G...
  0f 48 8d 0d c3 27 bd 00-5d ff 24 c1 55 48 89 e5  .H...'..].$.UH..
 [80]7f 09 00 74 23 48 8b-3f ff 0f 8b 47 04 74 1b  ....t#H.?...G.t. <==
  83 f8 1a 75 0d f6 47 11-02 74 0e 48 8b 7f 08 8b  ...u..G..t.H....
  47 04 a9 10 fc ff ff 74-10 5d c3 83 e0 0f 48 8d  G......t.]....H.
  0d 86 27 bd 00 5d ff 24-c1 5d e9 cb d6 07 00 55  ..'..].$.].....U
  48 89 e5 80 7f 09 00 74-07 48 8b 07 ff 08 74 02  H......t.H....t.
  5d c3 80 7f 08 06 75 09-48 89 c7 5d e9 96 6c 14  ].....u.H..]..l.

Binary Images:
       0x1044ef000 -        0x10537efff php (*) <35c33282-ac74-3e49-8738-b413779c4134> /usr/local/Cellar/php/8.3.3/bin/php
       0x1083cb000 -        0x1085cefff swoole.so (*) <287d6b35-2c99-3bb1-bdb3-278e0cc0b0b3> /usr/local/lib/php/pecl/20230831/swoole.so
       0x110917000 -        0x110982fff dyld (*) <2517e9fe-884a-3855-8532-92bffba3f81c> /usr/lib/dyld
    0x7ff81f7b7000 -     0x7ff81f7c2fff libsystem_pthread.dylib (*) <e5d44afd-2577-3cee-8711-9d8d426229e0> /usr/lib/system/libsystem_pthread.dylib
               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: 1
    thread_create: 0
    thread_set_state: 192

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

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Activity Tracing                   256K        1 
Kernel Alloc Once                    8K        1 
MALLOC                           184.8M       29 
MALLOC guard page                   16K        4 
MALLOC_LARGE (reserved)             64K        1         reserved VM address space (unallocated)
MALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)
Memory Tag 250                    20.8M       10 
ObjC additional data                15K        1 
STACK GUARD                       56.0M        3 
Stack                             9232K        3 
VM_ALLOCATE                       2060K        3 
VM_ALLOCATE (reserved)             192K        1         reserved VM address space (unallocated)
__DATA                            4581K      188 
__DATA_CONST                      8046K      145 
__DATA_DIRTY                       211K       51 
__LINKEDIT                       653.8M       65 
__TEXT                           158.2M      205 
__UNICODE                          592K        1 
dyld private memory               1024K        1 
mapped file                         48K        1 
shared memory                       44K        4 
===========                     =======  ======= 
TOTAL                              1.4G      719 
TOTAL, minus reserved VM space     1.1G      719 

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

{"app_name":"php","timestamp":"2024-03-12 10:12:52.00 +0800","app_version":"","slice_uuid":"35c33282-ac74-3e49-8738-b413779c4134","build_version":"","platform":1,"share_with_app_devs":0,"is_first_party":1,"bug_type":"309","os_version":"macOS 12.6.6 (21G646)","incident_id":"4AEC3849-C3C2-4E22-9C7B-54C03419AEE2","name":"php"}
{
  "uptime" : 23000,
  "procLaunch" : "2024-03-12 10:12:50.7990 +0800",
  "procRole" : "Unspecified",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "MacBookPro13,3",
  "procStartAbsTime" : 23873695751215,
  "coalitionID" : 774,
  "osVersion" : {
    "train" : "macOS 12.6.6",
    "build" : "21G646",
    "releaseType" : "User"
  },
  "captureTime" : "2024-03-12 10:12:52.1811 +0800",
  "incident" : "4AEC3849-C3C2-4E22-9C7B-54C03419AEE2",
  "bug_type" : "309",
  "pid" : 58203,
  "procExitAbsTime" : 23875035651302,
  "cpuType" : "X86-64",
  "procName" : "php",
  "procPath" : "\/usr\/local\/Cellar\/php\/8.3.3\/bin\/php",
  "parentProc" : "Exited process",
  "parentPid" : 58192,
  "coalitionName" : "com.jetbrains.PhpStorm",
  "crashReporterKey" : "E5EA30F7-FC49-8BA0-C6BD-9531649A9EF5",
  "responsiblePid" : 735,
  "responsibleProc" : "phpstorm",
  "wakeTime" : 2159,
  "bridgeVersion" : {"build":"14Y910","train":"3.0"},
  "sleepWakeUUID" : "FED066C2-F56B-4AA2-8C55-EE091D9204F8",
  "sip" : "enabled",
  "vmRegionInfo" : "0x9 is not in any region.  Bytes before following region: 140737486696439\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      UNUSED SPACE AT START\n--->  \n      VM_ALLOCATE              7fffffe6b000-7fffffe6c000 [    4K] r-x\/r-x SM=ALI  ",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000001, 0x0000000000000009","rawCodes":[1,9],"type":"EXC_BAD_ACCESS","signal":"SIGSEGV","subtype":"KERN_INVALID_ADDRESS at 0x0000000000000009"},
  "termination" : {"flags":0,"code":11,"namespace":"SIGNAL","indicator":"Segmentation fault: 11","byProc":"exc handler","byPid":58203},
  "vmregioninfo" : "0x9 is not in any region.  Bytes before following region: 140737486696439\n      REGION TYPE                    START - END         [ VSIZE] PRT\/MAX SHRMOD  REGION DETAIL\n      UNUSED SPACE AT START\n--->  \n      VM_ALLOCATE              7fffffe6b000-7fffffe6c000 [    4K] r-x\/r-x SM=ALI  ",
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":192,"task_for_pid":1},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":979915,"instructionState":{"instructionStream":{"bytes":[72,99,219,72,15,175,251,73,3,124,36,16,65,255,215,255,195,65,59,92,36,4,124,228,69,132,246,116,33,73,139,124,36,16,72,133,255,116,14,232,126,193,253,255,73,199,68,36,16,0,0,0,0,73,199,68,36,4,0,0,0,0,91,65,92,65,94,65,95,93,195,85,72,137,229,139,71,4,131,224,15,72,141,13,195,39,189,0,93,255,36,193,85,72,137,229,128,127,9,0,116,35,72,139,63,255,15,139,71,4,116,27,131,248,26,117,13,246,71,17,2,116,14,72,139,127,8,139,71,4,169,16,252,255,255,116,16,93,195,131,224,15,72,141,13,134,39,189,0,93,255,36,193,93,233,203,214,7,0,85,72,137,229,128,127,9,0,116,7,72,139,7,255,8,116,2,93,195,128,127,8,6,117,9,72,137,199,93,233,150,108,20],"offset":96}},"threadState":{"r13":{"value":11},"rax":{"value":0},"rflags":{"value":66118},"cpu":{"value":0},"r14":{"value":4486715288},"rsi":{"value":4477419520},"r8":{"value":4478341992},"cr2":{"value":9},"rdx":{"value":4490552224},"r10":{"value":2043},"r9":{"value":0},"r15":{"sourceLine":410,"value":4434624832,"sourceFile":"interface.cc","symbol":"curl_write_nothing(char*, unsigned long, unsigned long, void*)","symbolLocation":0},"rbx":{"value":4492443984},"trap":{"value":14,"description":"(no mapping for user data read)"},"err":{"value":4},"r11":{"value":1023},"rip":{"value":4370892645,"matchesCrashFrame":1},"rbp":{"value":140701981535888},"rsp":{"value":140701981535888},"r12":{"value":4486714880},"rcx":{"value":0},"flavor":"x86_THREAD_STATE","rdi":{"value":0}},"queue":"com.apple.main-thread","frames":[{"imageOffset":3643237,"symbol":"zval_ptr_dtor","symbolLocation":4,"imageIndex":0},{"symbol":"_php_curl_free(php_curl*)","inline":true,"imageIndex":1,"imageOffset":1439562,"symbolLocation":269,"sourceLine":2468,"sourceFile":"interface.cc"},{"imageOffset":1439562,"sourceLine":2527,"sourceFile":"interface.cc","symbol":"swoole_curl_free_obj(_zend_object*)","imageIndex":1,"symbolLocation":314},{"imageOffset":4255528,"symbol":"zend_objects_store_del","symbolLocation":176,"imageIndex":0},{"imageOffset":3728098,"symbol":"zend_array_destroy","symbolLocation":147,"imageIndex":0},{"imageOffset":4086559,"symbol":"zend_leave_helper_SPEC","symbolLocation":122,"imageIndex":0},{"imageOffset":3784593,"symbol":"execute_ex","symbolLocation":89,"imageIndex":0},{"imageOffset":3785139,"symbol":"zend_execute","symbolLocation":336,"imageIndex":0},{"imageOffset":3655638,"symbol":"zend_execute_scripts","symbolLocation":272,"imageIndex":0},{"imageOffset":3257591,"symbol":"php_execute_script","symbolLocation":394,"imageIndex":0},{"imageOffset":4555387,"symbol":"do_cli","symbolLocation":6716,"imageIndex":0},{"imageOffset":4548299,"symbol":"main","symbolLocation":641,"imageIndex":0},{"imageOffset":21806,"symbol":"start","symbolLocation":462,"imageIndex":2}]},{"id":979916,"frames":[{"imageOffset":8008,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":3}]},{"id":979917,"frames":[{"imageOffset":8008,"symbol":"start_wqthread","symbolLocation":0,"imageIndex":3}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4367249408,
    "size" : 15269888,
    "uuid" : "35c33282-ac74-3e49-8738-b413779c4134",
    "path" : "\/usr\/local\/Cellar\/php\/8.3.3\/bin\/php",
    "name" : "php"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4433162240,
    "size" : 2113536,
    "uuid" : "287d6b35-2c99-3bb1-bdb3-278e0cc0b0b3",
    "path" : "\/usr\/local\/lib\/php\/pecl\/20230831\/swoole.so",
    "name" : "swoole.so"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4572934144,
    "size" : 442368,
    "uuid" : "2517e9fe-884a-3855-8532-92bffba3f81c",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 140703656800256,
    "size" : 49152,
    "uuid" : "e5d44afd-2577-3cee-8711-9d8d426229e0",
    "path" : "\/usr\/lib\/system\/libsystem_pthread.dylib",
    "name" : "libsystem_pthread.dylib"
  },
  {
    "size" : 0,
    "source" : "A",
    "base" : 0,
    "uuid" : "00000000-0000-0000-0000-000000000000"
  }
],
  "sharedCache" : {
  "base" : 140703653543936,
  "size" : 19331678208,
  "uuid" : "f2ce8b0d-f2e7-3c14-88fa-430ab7913380"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=811.9M resident=0K(0%) swapped_out_or_unallocated=811.9M(100%)\nWritable regions: Total=602.0M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=602.0M(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nActivity Tracing                   256K        1 \nKernel Alloc Once                    8K        1 \nMALLOC                           184.8M       29 \nMALLOC guard page                   16K        4 \nMALLOC_LARGE (reserved)             64K        1         reserved VM address space (unallocated)\nMALLOC_NANO (reserved)           384.0M        1         reserved VM address space (unallocated)\nMemory Tag 250                    20.8M       10 \nObjC additional data                15K        1 \nSTACK GUARD                       56.0M        3 \nStack                             9232K        3 \nVM_ALLOCATE                       2060K        3 \nVM_ALLOCATE (reserved)             192K        1         reserved VM address space (unallocated)\n__DATA                            4581K      188 \n__DATA_CONST                      8046K      145 \n__DATA_DIRTY                       211K       51 \n__LINKEDIT                       653.8M       65 \n__TEXT                           158.2M      205 \n__UNICODE                          592K        1 \ndyld private memory               1024K        1 \nmapped file                         48K        1 \nshared memory                       44K        4 \n===========                     =======  ======= \nTOTAL                              1.4G      719 \nTOTAL, minus reserved VM space     1.1G      719 \n",
  "legacyInfo" : {
  "threadTriggered" : {
    "queue" : "com.apple.main-thread"
  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "6297d96be2c9387df974efa4",
      "factorPackIds" : {

      },
      "deploymentId" : 240000014
    },
    {
      "rolloutId" : "6112e14f37f5d11121dcd519",
      "factorPackIds" : {
        "SIRI_TEXT_TO_SPEECH" : "634710168e8be655c1316aaa"
      },
      "deploymentId" : 240000231
    }
  ],
  "experiments" : [
    {
      "treatmentId" : "00f62786-ceb5-418f-a586-adcc2922cf89",
      "experimentId" : "65d62240cb0e2417d11ce6e1",
      "deploymentId" : 400000001
    }
  ]
}
}
NathanFreeman commented 2 months ago

php --ri swoole看一下当前swoole版本

cokeTsang commented 2 months ago

php --ri swoole看一下当前swoole版本

@NathanFreeman 我是php8.1+swoole5.1.2,如果编译同时启用--enable-openssl和--enable-swoole-curl,composer会提示Segmentation fault (core dumped),去掉--enable-swoole-curl重新编译,composer正常。

php --ri swoole

swoole

Swoole => enabled Author => Swoole Team team@swoole.com Version => 5.1.2 Built => Mar 14 2024 15:49:16 coroutine => enabled with boost asm context epoll => enabled eventfd => enabled signalfd => enabled cpu_affinity => enabled spinlock => enabled rwlock => enabled openssl => OpenSSL 1.0.2k-fips 26 Jan 2017 http2 => enabled json => enabled pcre => enabled zlib => 1.2.7 mutex_timedlock => enabled pthread_barrier => enabled futex => enabled async_redis => enabled

Directive => Local Value => Master Value swoole.enable_coroutine => On => On swoole.enable_library => On => On swoole.enable_fiber_mock => Off => Off swoole.enable_preemptive_scheduler => Off => Off swoole.display_errors => On => On swoole.use_shortname => Off => Off swoole.unixsock_buffer_size => 8388608 => 8388608