Closed dapetcu21 closed 2 years ago
I'm also experiencing this issue (same call stack) on Catalina when interacting with a CEF-based OBS plugin.
Process: obs [2305]
Path: /Applications/OBS.app/Contents/MacOS/obs
Identifier: com.obsproject.obs-studio
Version: 24.0.6 (24.0.6)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: obs [2305]
User ID: 502
Date/Time: 2020-01-08 21:55:54.468 -0800
OS Version: Mac OS X 10.15.2 (19C57)
Report Version: 12
Anonymous UUID: B82B6543-A01A-404F-881F-208E83573F48
Time Awake Since Boot: 460 seconds
System Integrity Protection: enabled
Crashed Thread: 4
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000011cf1660
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [2305]
VM Regions Near 0x11cf1660:
__LINKEDIT 0000000011ce5000-0000000011cf0000 [ 44K] r--/rwx SM=COW /System/Library/Extensions/IOHIDFamily.kext/Contents/PlugIns/IOHIDLib.plugin/Contents/MacOS/IOHIDLib
-->
MALLOC_LARGE 0000000011cf2000-0000000011d02000 [ 64K] rw-/rwx SM=PRV
Thread 0:: CrBrowserMain Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff70de725a mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff70de75d0 mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff3959a890 __CFRunLoopServiceMachPort + 322
3 com.apple.CoreFoundation 0x00007fff39599456 __CFRunLoopRun + 1705
4 com.apple.CoreFoundation 0x00007fff39598738 CFRunLoopRunSpecific + 503
5 com.apple.HIToolbox 0x00007fff380df65d RunCurrentEventLoopInMode + 292
6 com.apple.HIToolbox 0x00007fff380df39d ReceiveNextEventCommon + 600
7 com.apple.HIToolbox 0x00007fff380df127 _BlockUntilNextEventMatchingListInModeWithFilter + 64
8 com.apple.AppKit 0x00007fff36750eb4 _DPSNextEvent + 990
9 com.apple.AppKit 0x00007fff3674f690 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
10 com.apple.AppKit 0x00007fff367413ae -[NSApplication run] + 658
11 libqcocoa.dylib 0x000000000fbad8dd 0xfb84000 + 170205
12 org.qt-project.QtCore 0x0000000110ede2be QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 398
13 org.qt-project.QtCore 0x0000000110ee2e91 QCoreApplication::exec() + 369
14 com.obsproject.obs-studio 0x000000010dee0570 main + 5248
15 libdyld.dylib 0x00007fff70ca67fd start + 1
Thread 1:
0 libsystem_pthread.dylib 0x00007fff70eab818 start_wqthread + 0
Thread 2:
0 libsystem_pthread.dylib 0x00007fff70eab818 start_wqthread + 0
Thread 3:
0 libsystem_pthread.dylib 0x00007fff70eab818 start_wqthread + 0
Thread 4 Crashed:
0 com.apple.iokit.IOHIDLib 0x0000000011cd96e7 0x11ccc000 + 55015
1 com.apple.iokit.IOHIDLib 0x0000000011cda271 0x11ccc000 + 57969
2 com.apple.framework.IOKit 0x00007fff3c377c2d IOHIDDeviceGetValue + 33
3 libobs.0.dylib 0x00000001106f1b50 obs_hotkeys_platform_is_pressed + 176
4 libobs.0.dylib 0x000000011072938d obs_hotkey_thread + 157
5 libsystem_pthread.dylib 0x00007fff70eafe65 _pthread_start + 148
6 libsystem_pthread.dylib 0x00007fff70eab83b thread_start + 15
Oh yeah, I should mention I'm using the VLC playback media source, if that's of any relevance.
Temporary workaround: disable input monitoring permission in system preferences / security and privacy. Guessing this is related to input monitoring vs OS-level secure input on password fields, which I believe prevents input monitoring when it comes to password fields.
Thank you so much for the workaround, @ashleyharvey
I've been having a similar issue myself today and thought it was weird that the specific issue above was happening but in different circumstances, I've done some testing and I am fairly sure the issue above has nothing to do with password entry as it also happens in Touch ID, and my little experience of dabling with macOS development I know there is a Secure Keyboard Entry mode which is enabled in certain situations.
This can also be manually enabled in Terminal.app, per my above ticket #2605 you'll see that various applications which I know for a fact to all use Secure Keyboard Entry are causing this.
I use an app called TextExpander which flags when this is enabled too long and thus why I know 1Password, Chrome, Keychain Assistant and Terminal.app (in sudo
all use this).
Given the above it seems like the issue as others have mentioned is with the OS security extensions, and basically seems like OBS is trying to communicate with one of these APIs for OS access when the Secure Keyboard Entry mode is disabled, this is not allowed by the OS, and crash?
Jim has pushed a temporary fix which will be available when we release 25.0.x to macOS.
Link: https://github.com/obsproject/obs-studio/commit/d002345a11c096e9d27bbdadb1f26d421a34c257
On 10.15, if a user activates secure input of some sort, the hotkey code will begin to crash inside of any Apple function related to hotkeys, even after secure input has ended. This does not appear to be the fault of OBS; the reason to this is still as of yet unknown, but is suspected to be a bug inside of Apple code that's a new regression as of 10.15.
So for the time being as a temporary solution to the crash, simply disable external hotkey support once secure input has been detected.
Because of this issue, the hotkey code should probably be replaced by a different method of tracking hotkeys, perhaps InstallEventHandler for example. This commit is little more than a bandaid to the crash.
We will keep this issue open until a proper solution (where we don't have to fully disable hotkeys) is devised. The general recommendation as far as we can tell would be to use a newer API like this, which I assume would require a fair bit of work.
Has someone reported this to Apple through Radar?
As far as I know, not yet. Might be a task for @DDRBoxman or @jp9000.
Expected Behavior
It shouldn't crash
Current Behavior
It crashes in
obs_hotkeys_platform_is_pressed()
, inIOHIDDeviceGetValue()
Steps to Reproduce
The same crash also happened in other situations where I wasn't interacting with a password prompt, but I can't tell what triggered it.
Additional information