thebarbican19 / BatteryBoi

The battery app your Mac's been dreaming about behind your back.
https://batteryboi.ovatar.io/
GNU General Public License v3.0
846 stars 20 forks source link

Crash after Restart #29

Open waytoabv opened 1 year ago

waytoabv commented 1 year ago

https://github.com/thebarbican19/BatteryBoi/assets/127306391/1d70c4fb-98da-48a8-ad3c-87b67c1928a5

With Sonoma (public beta 5) I have these weird traces when switching desktops. Also I can only access the setting after restarting the app.

dchmurec commented 1 year ago

Same thing when switching desktop on Ventura 13.5.1

thebarbican19 commented 1 year ago

Thanks guys. I will get this resolved in the next issue.

thebarbican19 commented 1 year ago

Hi gang! @dchmurec, @waytoabv. I am pleased to report this is now resolved as I have reworked all the animations, also BLUETOOTH IS IN! Please let me know otherwise, otherwise I will close this issue.

dchmurec commented 1 year ago

Hi gang! @dchmurec, @waytoabv. I am pleased to report this is now resolved as I have reworked all the animations, also BLUETOOTH IS IN! Please let me know otherwise, otherwise I will close this issue.

Looks like all good now with the window switching, no more weird stuck traces.

The other thing happens that the app crashes or kill itself after sleep, not always happens and no errors, so I can't even replicate it right now to explain in more details.

thebarbican19 commented 1 year ago

Thanks, for letting me know. I will keep testing to see if I can replicate it. I will keep this issue open as it's now renamed.

thebarbican19 commented 1 year ago

@dchmurec, I have just pushed a new build that should fix this. Please let me know how it looks.

dchmurec commented 1 year ago

@dchmurec, I have just pushed a new build that should fix this. Please let me know how it looks.

I’m still having the same issue: BatteryBoi keeps crashing on my MacBook Air M2 with Ventura 13.5.2. It happens when I leave the laptop in sleep mode with the lid closed for a few hours. When I open the lid again, BatteryBoi is gone from the menu bar. There’s no error message or anything, it just disappears (crashing) after sleeping.

thebarbican19 commented 1 year ago

@dchmurec thanks for the update. Ok, I will keep looking, I did have a crash today also but was unable to recreate it. If you have any more details please do share so I can better tackle this.

dchmurec commented 1 year ago

@dchmurec thanks for the update. Ok, I will keep looking, I did have a crash today also but was unable to recreate it. If you have any more details please do share so I can better tackle this.

I found crash report, it seems like the crash happens on wake up from sleep mode, if this somehow can help you then there you go, you can read the crash report from link below:

https://pastebin.com/K2fERdAd

AI summary on crash report:

Here are the key points I gathered from reviewing the report:

The crashed thread is thread 4, which was a dispatch queue for NSManagedObjectContext. The crash occurred due to an EXC_BAD_ACCESS exception, specifically a segmentation fault from trying to access memory address 0xfffffffffffffff8.

The crash happened while trying to remove an object from a dictionary in CoreData, likely during NSManagedObjectContext cleanup.

The call stack shows the crash originated deep within AppKit/UIKit frameworks, but was triggered by code in the main application thread related to SwiftUI.

The crash occurred due to a "Translation fault" on memory address 0xfffffffffffffff8, which indicates the address being accessed was not mapped to valid memory.

So in summary, it appears the app crashed because code attempted to access an invalid memory address while doing CoreData cleanup work on the main thread. The root cause seems to be invalid memory access, likely due to a bug in the app's data model logic or object lifecycle management. I would focus investigation on the app's CoreData stack and SwiftUI view code that interacts with it.