Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frequent crashes when changing focus #629

Closed
Liquidmantis opened this issue Aug 1, 2020 · 2 comments
Closed

Frequent crashes when changing focus #629

Liquidmantis opened this issue Aug 1, 2020 · 2 comments

Comments

@Liquidmantis
Copy link

I've been digging through the issues and this doesn't seem related to #277 as I don't see any Skylight references. I'm able to reliably reproduce this crash after a random number of focus changes.

MacOS: 10.15.6
Yabai 3.2.1
Opacity disabled
Opacity duration 0

Sometimes there's just a delay in switching focus, other times Yabai crashes and reloads.

Process: yabai [55249]
Path: /usr/local/opt/yabai/bin/yabai
Identifier: yabai
Version: 0
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: yabai [55249]
User ID: 501

Date/Time: 2020-07-31 20:18:00.921 -0600
OS Version: Mac OS X 10.15.6 (19G73)
Report Version: 12
Bridge OS Version: 4.6 (17P6065)
Anonymous UUID: 7F2F79C1-8572-F905-70F4-C7CEBFF7B3CB

Sleep/Wake UUID: 43DEC385-F08E-4A53-98FC-CA592DADB807

Time Awake Since Boot: 23000 seconds
Time Since Wake: 18000 seconds

System Integrity Protection: disabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [55249]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 yabai 0x0000000109f59363 application_notification_handler + 179
1 com.apple.HIServices 0x00007fff34206f7e _XXMIGPostNotification + 717
2 com.apple.HIServices 0x00007fff3422cb13 _XPostNotification + 340
3 com.apple.HIServices 0x00007fff341e9f64 mshMIGPerform + 174
4 com.apple.CoreFoundation 0x00007fff35f37304 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 41
5 com.apple.CoreFoundation 0x00007fff35f37250 __CFRunLoopDoSource1 + 541
6 com.apple.CoreFoundation 0x00007fff35f35d79 __CFRunLoopRun + 2270
7 com.apple.CoreFoundation 0x00007fff35f34e3e CFRunLoopRunSpecific + 462
8 com.apple.CoreFoundation 0x00007fff35fbd489 CFRunLoopRun + 40
9 yabai 0x0000000109f669df main + 1967
10 libdyld.dylib 0x00007fff6fe08cc9 start + 1

@Liquidmantis
Copy link
Author

Liquidmantis commented Aug 5, 2020

I've been poking at this and found the verbose way of running Yabai.

Here is an example of successful switch between two apps:

thread: 208375808 | window_manager_create_and_add_window: Hammerspoon 47185
thread: 208375808 | window_manager_create_and_add_window: Hammerspoon 47186
thread: 208375808 | EVENT_HANDLER_DAEMON_MESSAGE: window --focus east
thread: 208375808 | EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: Code - Insiders (43960)
thread: 208375808 | EVENT_HANDLER_APPLICATION_DEACTIVATED: Hyper
thread: 208375808 | EVENT_HANDLER_APPLICATION_ACTIVATED: Code - Insiders
thread: 208375808 | EVENT_HANDLER_WINDOW_FOCUSED: Code - Insiders 42279
thread: 208375808 | EVENT_HANDLER_DAEMON_MESSAGE: window --focus west
thread: 208375808 | EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: Hyper (7053)
thread: 208375808 | EVENT_HANDLER_APPLICATION_DEACTIVATED: Code - Insiders
thread: 208375808 | EVENT_HANDLER_APPLICATION_ACTIVATED: Hyper
thread: 208375808 | EVENT_HANDLER_WINDOW_DESTROYED: Hammerspoon 47185
thread: 208375808 | EVENT_HANDLER_WINDOW_DESTROYED: Hammerspoon 47186

Here is an example where there was a hang:

thread: 208375808 | window_manager_create_and_add_window: Hammerspoon 47182
thread: 208375808 | window_observe_notification: kAXWindowMiniaturizedNotification failed with error kAXErrorCannotComplete
thread: 208375808 | window_observe_notification: kAXWindowDeminiaturizedNotification failed with error kAXErrorCannotComplete
thread: 208375808 | window_observe_notification: kAXUIElementDestroyedNotification failed with error kAXErrorCannotComplete
thread: 208375808 | window_manager_create_and_add_window: could not observe Hammerspoon 47183
thread: 208375808 | EVENT_HANDLER_WINDOW_DESTROYED: Hammerspoon 47180
thread: 208375808 | EVENT_HANDLER_WINDOW_DESTROYED: Hammerspoon 47181
thread: 208375808 | EVENT_HANDLER_DAEMON_MESSAGE: window --focus west
thread: 208375808 | EVENT_HANDLER_APPLICATION_FRONT_SWITCHED: Hyper (7053)
thread: 208375808 | EVENT_HANDLER_APPLICATION_DEACTIVATED: Code - Insiders
thread: 208375808 | EVENT_HANDLER_APPLICATION_ACTIVATED: Hyper
thread: 208375808 | EVENT_HANDLER_WINDOW_DESTROYED: Hammerspoon 47182

I've been trying to avoid learning and switching to skhd, but maybe that's the solution?

[Edit] Those logs led me to believe that maybe it was an issue with the hs.alert dialogs I was using for notification of Hammerspoon's mode state. I removed my hs.alerts from the mode triggers and the log lines about the Hammerspoon window creation disappeared, and I've been unable to reproduce the hang now.

@Liquidmantis
Copy link
Author

Closing this because I haven't had any issues after disabling the Hammerspoon alerts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant