xbar
xbar copied to clipboard
Segfaults on refresh
Hi! Thanks for developing such an amazing app!
Running the 2.10-beta (brew installation) on MacOS 10.15.7, I've noticed quite a lot of crashes when interacting with clickable items. More specifically, it seems that these errors occur when a script refreshes while the menu of a plugin is open, i.e. when the following sequence occurs:
- A menu bar plugin is clicked to expand the menu
- A refresh occurs
- An item in the menu is clicked -> segfault
A minimal example from the readme to reproduce this error: (filename: test.1s.sh
):
#!/usr/bin/env bash
echo 'test'
echo '---'
echo 'Open website | href=https://xbarapp.com'
This will crash almost every time Open website
is clicked. Changing the filename to test.1m.sh
will result in very few crashes in normal usage, but it's still possible to reproduce the error by clicking test
, waiting 60 seconds, clicking Open website
.
I haven't confirmed the same sequence of events (eg, plugin is doing a refresh), but I experience a crash nearly every time I click an xbar menu item. At least one of the plugins I use does a refresh after running a command, so I suspect it's the same issue. Problem started with 2.1.0-beta.
Hi. Are you running on M1 by any chance? I've discovered that the code that detects when a menu is open doesn't work on M1, despite the same code working fine on Intel! We use this to ensure that the menus aren't "pulled from under your feet". Could you please try this:
- Right click xbar in finder
- Select "Get Info"
- Check "Open using Rosetta"
- Restart xbar
Thanks.
I do not have an M1 mac. Sorry I couldn't help with a simple culprit.
Same, I'm running this on a 2018 MBP13 (Catalina, as mentioned above), so I'm afraid this isn't the issue.
Yeah, sorry about that - this one's on me. Just done some debugging and it turns out my aggressive approach to memory leaks introduced a regression that is ultimately the cause of this. I've created a fix and Mat and I will be testing over the weekend. If all goes well, expect a release shortly.
👍
Thanks for the update