Yabai: Crash in event tap

Created on 9 Sep 2019  路  29Comments  路  Source: koekeishiya/yabai

It seems quite frequently (a few times in my working day) that I'll get a notification saying something about payload-scripting-addition (too brief to notice and read usually), and then any windows that I've swapped position, e.g. from a layout:

A |
--+ B
C |

if I'd swapped to:

A |
--+ C
B |

it will have reset to the original positions, maintaining only layout.

The last many lines of the error log are:

yabai: scripting-addition payload was already injected into Dock.app!

(perhaps that's what the notification says too.)

which I assume is an error on restart, rather than an error that caused it to restart. There's nothing between one occurrence of this line and the next.

bug

All 29 comments

Check Console.app for Crash Reports of yabai or Dock.app and post them here. You're likely running yabai as a service which causes it to automatically restart after crashing.

If you're running Catalina, make sure to read the last 4-5 posts in #22 (and keep further discussion in there). There are two known crashes for Catalina yet to be fixed.

Check Console.app for Crash Reports of yabai or Dock.app and post them here.

No crash reports, only this for yabai:

-[TCCDAccessIdentity staticCode]: static code for: identifier /usr/local/opt/yabai/bin/yabai, type: 1: 0x7fd6b5202ab0 at /usr/local/opt/yabai/bin/yabai

and a list of 'XPC clients' for Dock.

Unless I need Console open before and while it crashes to see it recorded there?

You're likely running yabai as a service which causes it to automatically restart after crashing.

I am indeed, via brew services. That plist though was where I found the location of the error log, which, as I said, contains only:

yabai: scripting-addition payload was already injected into Dock.app!

from the restarts.

If you're running Catalina

No, Mojave 10.14.6.

It just happened again - I caught the notification this time, it said:

payload scripting addition is out of date, please reinstall!

Does that mean simply:

yabai --uninstall-sa
yabai --install-sa

?

Installing the scripting addition requires root-user permissions, as it writes into /Library/ScriptingAdditions, which is a protected path.

sudo yabai --install-sa

On newer versions of yabai, simply running the install command should suffice. It will remove any old version, install the new one and then restart Dock.app iff necessary.

Edit: For what it's worth, the crash only happened for you because you were running a very outdated version of the scripting addition. Newer versions check if the internal functions were found, and simply do nothing instead of blindly calling something that may not even be a function.

It's still occurring, notification is "payload scripting addition, v1.0.5". The same message in Console for yabai, now these for Dock:

27366555: RECEIVED OUT-OF-SEQUENCE NOTIFICATION: 0 vs 2527, 265,
27366555: RECEIVED OUT-OF-SEQUENCE NOTIFICATION: 110 vs 2528, 258,

And while I was typing five similar messages appeared for yabai. Nothing new in error log, just the same 'already injected into Dock'.

Try to kill Dock manually by running killall Dock. Restarting / logging our and back in may also help.

If this is happening frequently to you, disable the brew service and run yabai manually through a terminal with the --verbose argument: yabai --verbose for debug output.

When a crash occur, copy the last ~15lines of the terminal output here, together with the supplied crash log found in Console.app. macOS will by default provide a crash report for any application that uses the default signal handlers. If you don't know where in Console.app to find the crash logs, a quick google search should suffice.

For days it was fine running yabai --verbose directly, and I thought brew must be somehow to blame.

But just now I couldn't switch desktops, and then noticed it was hanging, no longer streaming focus/click events etc. - on terminating it (I had beeen running it in the background):

'yabai --verbose' terminated by signal SIGSEGV (Address boundary error)

.crash file:

Process:               yabai [74466]
Path:                  /usr/local/bin/yabai
Identifier:            yabai
Responsible:           yabai [74466]
    __TEXT                 0000000107e39000-0000000107e66000 [  180K] r-x/rwx SM=COW  /usr/local/Cellar/yabai/2.0.1/bin/yabai
10  yabai                           0x0000000107e5b18d main + 2077
1   yabai                           0x0000000107e3b32c socket_connection_handler + 44
1   yabai                           0x0000000107e3d459 event_loop_run + 201
       0x107e39000 -        0x107e65ffb +yabai (0) <5DE526E0-6516-31EF-8168-7F0FC20A4954> /usr/local/bin/yabai

Now that I've found where that lives, I can see there are similar ones from running under brew (obviously PIDs & addresses differ) - same trace in each.

This might be a complete coincidence, but perhaps not and worth mentioning: running via brew services it was quite frequent (a few times per day) but running directly it lasted some time (I can't remember how long after your last comment I started, but I'm sure it's been >1 week) without crashing. Today I ran some other script (in the foreground) in the same shell; it didn't crash immediately, it was some hours later, but it still seems quite a coincidence.

Let me know if there's anything else you need or that I can try. Cheers.

Edit: Yep, just 40 min after restarting with brew it happened again, same .crash.

Is there not more info in your crash logs, like a stack trace; which thread crashed (and where).

Was this page helpful?
0 / 5 - 0 ratings