Post

Replies

Boosts

Views

Activity

Reply to Dead lock cause by NSTask's os_unfair_lock
the call stack * thread #40   frame #0: 0x00007ff815f6720a libsystem_kernel.dylib`__ulock_wait + 10   frame #1: 0x00007ff815fb62c5 libsystem_platform.dylib`_os_unfair_lock_lock_slow + 162  * frame #2: 0x00007ff816f82ffe Foundation`-[NSConcreteTask processIdentifier] + 28   frame #3: 0x00000001053e95e5 libqaxbase.macos.dylib`-[NSTask(self=0x0000600002261590, _cmd="waitUntilExitWithTimeout:sendTerm:sendKill:", TO=2, SENDTERM=YES, SENDKILL=YES) waitUntilExitWithTimeout:sendTerm:sendKill:] at os_base_api.mm:79:25   frame #4: 0x00000001053ea84a libqaxbase.macos.dylib`OSBaseApi::ExecCmd(this=0x0000600002cb5700, cmdWithArgs="netstat -rn | awk '/default/ {if ( index($4, \"llw0\") > 0 ){print $2} }'", result=0x0000600000df0930) at os_base_api.mm:278:5   frame #5: 0x000000010557ed77 libnacplugin.dylib`NacPlugin::Exec(this=0x00007f795df04150, cmd="netstat -rn | awk '/default/ {if ( index($4, \"llw0\") > 0 ){print $2} }'") at NacPlugin.cpp:697:19   frame #6: 0x000000010557c0a7 libnacplugin.dylib`NacPlugin::GetInterfaceAddrs(this=0x00007f795df04150, interfaces=size=0) at NacPlugin.cpp:503:35   frame #7: 0x000000010557a821 libnacplugin.dylib`NacPlugin::KeepAlive(this=0x00007f795df04150) at NacPlugin.cpp:156:5   frame #8: 0x000000010557a4d0 libnacplugin.dylib`NacPlugin::NacReport(this=0x00007f795df04150) at NacPlugin.cpp:84:9   frame #9: 0x000000010558eb38 libnacplugin.dylib`NacPlugin::PluginInit(this=0x00006000000b81e8)::$_0::operator()() const at NacPlugin.cpp:66:15   frame #10: 0x000000010558eae5 libnacplugin.dylib`decltype(__f=0x00006000000b81e8)::$_0>(fp)()) std::__1::__invoke<NacPlugin::PluginInit()::$_0>(NacPlugin::PluginInit()::$_0&&) at type_traits:3918:1   frame #11: 0x000000010558ea85 libnacplugin.dylib`void std::__1::__thread_execute<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, NacPlugin::PluginInit()::$_0>(__t=size=2, (null)=__tuple_indices<> @ 0x0000700005927f68)::$_0>&, std::__1::__tuple_indices<>) at thread:280:5   frame #12: 0x000000010558e305 libnacplugin.dylib`void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, NacPlugin::PluginInit()::$_0> >(__vp=0x00006000000b81e0) at thread:291:5   frame #13: 0x00007ff815fa2514 libsystem_pthread.dylib`_pthread_start + 125   frame #14: 0x00007ff815f9e02f libsystem_pthread.dylib`thread_start + 15 (lldb) di -f Foundation`-[NSConcreteTask processIdentifier]:    0x7ff816f82fe2 <+0>: pushq %rbp    0x7ff816f82fe3 <+1>: movq  %rsp, %rbp    0x7ff816f82fe6 <+4>: pushq %r14    0x7ff816f82fe8 <+6>: pushq %rbx    0x7ff816f82fe9 <+7>: movq  %rdi, %r14    0x7ff816f82fec <+10>: movq  0x408ad6f5(%rip), %rbx  ; NSConcreteTask._lock    0x7ff816f82ff3 <+17>: addq  %rdi, %rbx    0x7ff816f82ff6 <+20>: movq  %rbx, %rdi    0x7ff816f82ff9 <+23>: callq 0x7ff8171534e8      ; symbol stub for: os_unfair_lock_lock ->  0x7ff816f82ffe <+28>: movq  0x408ad713(%rip), %rax  ; NSConcreteTask._pid    0x7ff816f83005 <+35>: movl  (%r14,%rax), %r14d    0x7ff816f83009 <+39>: movq  %rbx, %rdi    0x7ff816f8300c <+42>: callq 0x7ff8171534f4      ; symbol stub for: os_unfair_lock_unlock    0x7ff816f83011 <+47>: movl  %r14d, %eax    0x7ff816f83014 <+50>: popq  %rbx    0x7ff816f83015 <+51>: popq  %r14    0x7ff816f83017 <+53>: popq  %rbp    0x7ff816f83018 <+54>: retq      0x7ff816f83019 <+55>: nop       0x7ff816f8301a <+56>: nop       0x7ff816f8301b <+57>: nop       0x7ff816f8301c <+58>: nop       0x7ff816f8301d <+59>: nop       0x7ff816f8301e <+60>: nop       0x7ff816f8301f <+61>: nop       0x7ff816f83020 <+62>: nop  * thread #42, queue = 'com.apple.root.utility-qos.overcommit'  * frame #0: 0x00007ff815f6b262 libsystem_kernel.dylib`__wait4 + 10   frame #1: 0x00007ff817086097 Foundation`__45-[NSConcreteTask launchWithDictionary:error:]_block_invoke.239 + 110   frame #2: 0x00007ff815debcc9 libdispatch.dylib`_dispatch_client_callout + 8   frame #3: 0x00007ff815dee746 libdispatch.dylib`_dispatch_continuation_pop + 460   frame #4: 0x00007ff815dffa5a libdispatch.dylib`_dispatch_source_invoke + 2150   frame #5: 0x00007ff815dfc1b4 libdispatch.dylib`_dispatch_kevent_worker_thread + 1554   frame #6: 0x00007ff815f9f0d7 libsystem_pthread.dylib`_pthread_wqthread + 398   frame #7: 0x00007ff815f9e01b libsystem_pthread.dylib`start_wqthread + 15 (lldb) f 1 frame #1: 0x00007ff817086097 Foundation`__45-[NSConcreteTask launchWithDictionary:error:]_block_invoke.239 + 110 Foundation`__45-[NSConcreteTask launchWithDictionary:error:]_block_invoke.239: ->  0x7ff817086097 <+110>: movl  %eax, %ebx    0x7ff817086099 <+112>: testl %eax, %eax    0x7ff81708609b <+114>: jns  0x7ff8170860a7      ; <+126>    0x7ff81708609d <+116>: callq 0x7ff817152bb2      ; symbol stub for: __error (lldb) di -f Foundation`__45-[NSConcreteTask launchWithDictionary:error:]_block_invoke.239:    0x7ff817086029 <+0>:  pushq %rbp    0x7ff81708602a <+1>:  movq  %rsp, %rbp    0x7ff81708602d <+4>:  pushq %r15    0x7ff81708602f <+6>:  pushq %r14    0x7ff817086031 <+8>:  pushq %r13    0x7ff817086033 <+10>: pushq %r12    0x7ff817086035 <+12>: pushq %rbx    0x7ff817086036 <+13>: subq  $0x68, %rsp    0x7ff81708603a <+17>: movq  %rdi, %r15    0x7ff81708603d <+20>: movq  0x41ded264(%rip), %rax  ; (void *)0x00007ff8577b9260: __stack_chk_guard    0x7ff817086044 <+27>: movq  (%rax), %rax    0x7ff817086047 <+30>: movq  %rax, -0x30(%rbp)    0x7ff81708604b <+34>: movq  0x20(%rdi), %r14    0x7ff81708604f <+38>: addq  0x407aa692(%rip), %r14  ; NSConcreteTask._lock    0x7ff817086056 <+45>: movq  %r14, %rdi    0x7ff817086059 <+48>: callq 0x7ff8171534e8      ; symbol stub for: os_unfair_lock_lock    0x7ff81708605e <+53>: movq  0x28(%r15), %rax    0x7ff817086062 <+57>: movq  0x407aa6b7(%rip), %rcx  ; NSConcreteTask._dsrc    0x7ff817086069 <+64>: movq  $0x0, (%rax,%rcx)    0x7ff817086071 <+72>: movq  0x30(%r15), %rdi    0x7ff817086075 <+76>: callq 0x7ff817152f66      ; symbol stub for: dispatch_source_cancel    0x7ff81708607a <+81>: movq  0x407aa697(%rip), %r13  ; NSConcreteTask._pid    0x7ff817086081 <+88>: leaq  -0x34(%rbp), %r12    0x7ff817086085 <+92>: movq  0x28(%r15), %rax    0x7ff817086089 <+96>: movl  (%rax,%r13), %edi    0x7ff81708608d <+100>: movq  %r12, %rsi    0x7ff817086090 <+103>: xorl  %edx, %edx    0x7ff817086092 <+105>: callq 0x7ff817153a04      ; symbol stub for: waitpid ->  0x7ff817086097 <+110>: movl  %eax, %ebx    0x7ff817086099 <+112>: testl %eax, %eax    0x7ff81708609b <+114>: jns  0x7ff8170860a7      ; <+126>    0x7ff81708609d <+116>: callq 0x7ff817152bb2      ; symbol stub for: __error    0x7ff8170860a2 <+121>: cmpl  $0x4, (%rax)    0x7ff8170860a5 <+124>: je   0x7ff817086085      ; <+92>    0x7ff8170860a7 <+126>: movl  $0xffffffff, %eax     ; imm = 0xFFFFFFFF
Nov ’21
Reply to mac OS popup "(null) Would Like to Filter Network Content"
I think this should be apple's bug on 10.15.7 I make 3 tests as below: Preconditions: prepare the SampleNetworkExtension.app, put it on the network shared disk, and make a new VM for macos 10.15.7 1.copy SampleNetworkExtension.app to /Applications. run /Applications/SampleNetworkExtension.app, the popup is ok 2.clean up: move /Applications/SampleNetworkExtension.app to Trash and empty Trash, reboot system. copy SampleNetworkExtension.app to /Applications/test.app/Contents/PlugIns. run /Applications/test.app/Contents/PlugIns/SampleNetworkExtension.app, the popup will be null 3.clean up: move /Applications/test.app/Contents/PlugIns/SampleNetworkExtension.app to Trash and empty Trash, reboot system. copy SampleNetworkExtension.app to /Applications/test.app/Contents/PlugIns, and copy it to /Applications also. run /Applications/Contents/PlugIns/SampleNetworkExtension.app, the popup is ok. I do the same test on macos 11 or macos 12, that's ok. Maybe apple fixed it on macos 11
Mar ’22