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

Crash in SIApplication.m in observerCallback #671

Closed
ianfixes opened this issue Jan 5, 2018 · 1 comment
Closed

Crash in SIApplication.m in observerCallback #671

ianfixes opened this issue Jan 5, 2018 · 1 comment

Comments

@ianfixes
Copy link
Contributor

ianfixes commented Jan 5, 2018

System

  • Amethyst version: 0.11.4 (52)
  • macOS version: 10.12.6

What's the problem?

This crash happens infrequently, but always in the same place. I suspect a race condition while closing a window, which creates a null pointer that the observerCallback is not handling.

void observerCallback(AXObserverRef observer, AXUIElementRef element, CFStringRef notification, void *refcon) {
    SIAXNotificationHandler callback = (__bridge SIAXNotificationHandler)refcon;
    SIWindow *window = [[SIWindow alloc] initWithAXElement:element];
    callback(window);
}
(lldb) po window
<c0d06200 80610000 00000000 00000000>

(lldb) po observer
<AXObserver 0x61800089d0b0> {pid=52339}

(lldb) po element
<AXUIElement 0x60002b645c40> {pid=52339}

(lldb) po notification
AXUIElementDestroyed

(lldb) po refcon
<AXUIElement 0x60002b45e330> {pid=52339}

(lldb) po callback 
0x0000000000000010

(lldb) 

How can it be reproduced?

No idea. It happens once every 3+ weeks.

What applications are involved?

Not application specific, as far as I can tell.

Has anything fixed it, even temporarily?

Luck.

@ianfixes
Copy link
Contributor Author

ianfixes commented Jan 5, 2018

Oops, of course I'm not going to find the open issue when I'm looking in Amethyst instead of Silica.

This belongs here: ianyh/Silica#10

@ianfixes ianfixes closed this as completed Jan 5, 2018
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