jordanbaird / Ice

Powerful menu bar manager for macOS
https://icemenubar.app
GNU General Public License v3.0
10.28k stars 194 forks source link

[Bug]: Potential Issue with Spaces #52

Closed CrypticComputation closed 2 months ago

CrypticComputation commented 2 months ago

Check existing issues

Description

I've been using Ice for a little over a week now and have been experiencing quite a few crashes regarding 'replayd' according to the Apple crash report. This has happened 6-12 times now.

I am using the Spaces feature on my Mac to the tune of 10 virtual desktops that I regularly swipe between throughout my day. These crashes usually occurring when I've swiped through a few of them consecutively.

I'm not sure if my Spaces is causing an issue with the screen recording Ice requires or the way it does? I'm submitting this report after a cursory Google search lead me nowhere regarding just what it is that 'replayd' crashing could be linked to.

I mark this as "potential" because I admittedly have no idea if this is even related to Ice.

But, considering this issue has arisen since discovering and using Ice, I figured I'd better check with the developer just in case it is a bug regarding my particular setup and desktop use.

I have seen on Google that 'ReplayKit' which is mentioned in the crash reports is linked to multimedia recording on Mac.

Lastly, I am using Ice in a fairly default manner outside of enabling 'Shadow' menu bar styling and despite the somewhat regularity of these crashes, Ice itself does not crash or use any unusual amount of resources.

I've included a screenshot of the crash report I've been seeing just in case it helps.

Thanks for creating Ice and any input you may have, Jordan.

Steps to Reproduce

I'm honestly not sure to reliably reproduce it yet outside of utilizing multiple Spaces?

Ice Version

0.8.0

macOS Version

14.4.1

Screenshots

Screenshot 2024-04-11 at 6 42 38 PM
jordanbaird commented 2 months ago

Ice uses ScreenCaptureKit, which I believe uses ReplayKit under the hood. While Ice very well could be what's causing the crash, I'm thinking that this is a bug with ReplayKit or replayd. If something Ice is doing is causing an error, ReplayKit should propagate it forward so Ice can handle it. It definitely shouldn't crash.

I have a suspicion that it has something to do with trying to capture the screen at the exact moment macOS switches spaces (specifically while it's in between two spaces). The current release version of Ice actually times out on screen capture operations during this timeframe, which would make sense if replayd crashes at the same time.

I was able to figure out a way to prevent screen capture operations during space switches, so this should be fixed in the next release. I'm going to close this for now, but let me know if the crash still persists once the new release is out.

CrypticComputation commented 2 months ago

Thank you for getting back to me and checking out the possible cause(s) of my issue

I wanted to add one more thing now that it's the weekend and I've got some more time to mess around on my Mac. I've noticed this crash seems to occur much less frequently if at all when I disable shadowing. Do you think the shadow needing the split second to apply is causing any issue?

I've noticed it takes about a half a second for the styling to apply to the bar when switching Spaces and maybe bouncing around different Spaces while it's styling is something?

This could all be coincidence and I'm no developer, but I just wanted to mention it.

For all I know, the fix you have implemented could remedy all of the above.

I will report back after checking out the future release if necessary.