100% of crashes on my M1 MBA occur in applications when accessing files over SMB network shares. One every couple of days. I have to restart about once every week or two because it borks the system completely.
But when I'm not connected to an SMB drive, I don't think I've had a single crash in years.
I have no idea if it's something in the SMB driver itself that's crashing, or assumptions inside of application logic that fail in certain SMB scenarios.
It’s faulty app logic, assuming an io error cannot occur accessing a filesystem. They’ll also crash if you have disk issues or driver problems. The important thing is they may not even realize they’re calling into a function or routine that can access the fs for something!
All io access needs to be recoverable or catchable for your app not to crash. You’d be surprised how much background fs activity there can be in apps (or indirectly triggered by apps!) all the time.
This is one reason where I think Rust shines, and has even improved how I write C++.
So many areas where rust makes me deal with a result or option that are easy to take for granted. It’s a strong reminder of the number of things we should be treating as possible error cases
Sure, but a developer can also write any number of other code that’s irresponsible. At that point the language has done all it can for them, and the onus is on the developer to not be lazy.
That and sandboxing effects with perhaps improperly accessed bookmark data
I'm building a macos app now, and only because I wasn't catching fs access error did I realize I needed to handle folder access carefully when using bookmarks in core data.
Stuff like this with NFS was my living nightmare for years. On Linux it would put processes into the D state and you'd have to restart the entire machine to fix anything.
But when I'm not connected to an SMB drive, I don't think I've had a single crash in years.
I have no idea if it's something in the SMB driver itself that's crashing, or assumptions inside of application logic that fail in certain SMB scenarios.