TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Restarting macOS apps automatically on crash

36 pointsby alin23over 1 year ago

12 comments

alin23over 1 year ago
Great comments everyone! Really nice hearing from all these devs experienced with writing crash free apps that never crash with inscrutable tracebacks which after days of investigation turn out to be caused by a DisplayLink driver.<p>It’s refreshing to see your users never angrily contact you to fix crashes you can’t fix and that your only answer is not “sorry you will have to just relaunch the app”<p>Your unfounded assumptions are a delight, indeed I must be doing something wrong and maybe just didn’t put in the work into fixing these errors, and after 6 years of developing the same app and looking at the Sentry dashboard every day and talking to users through email&#x2F;Discord&#x2F;Twitter&#x2F;Reddit&#x2F;forums and looking at their video recordings and deciphering their explanations and sending them betas and custom utilities that definitely reproduce how the crash is not a user error… sorry, what was I saying?<p>God damn it man, it’s this thing every day here.<p>I just wanted to share a readily made solution for people that are in desperate need of it and have exhausted all other possibilities. I’m not trying to make everyone create crash loops and bringing systems to a grind.
saagarjhaover 1 year ago
One should be careful about what they put in a signal handler. Doing complex things like calling into Foundation, especially in a signal handler that indicates something has really gone wrong, is probably not a good idea.
评论 #37365860 未加载
bandergirlover 1 year ago
I expecting to see logic to detect crash loops. What happens then?
评论 #37364550 未加载
pixel_tracingover 1 year ago
I don’t suggest this.<p>Your application may crash due to:<p>- hangs &#x2F; spins - memory corruption - programmer error &#x2F; faulty logic (think loooping infinitely) - thermals &#x2F; memory usage<p>Let launchd handle restarting your application by allowing the user a “Relaunch” button
tedunangstover 1 year ago
Or maybe you&#x27;ve been signed up for free fuzzing by your local government security service. Restarting the app so they can continue probing is only courteous.
m3kw9over 1 year ago
Prob take longer to get out of a crash loop than to just cdm-space and type first 2 letters of the app name and enter.
asplakeover 1 year ago
The developers of Kindle for Mac might want to read this
alberthover 1 year ago
Reminds my how Basecamp use to restart their Rails app 400 times&#x2F;day.<p><a href="https:&#x2F;&#x2F;dhh.dk&#x2F;posts&#x2F;31-myth-2-rails-is-expected-to-crash-400-timesday" rel="nofollow noreferrer">https:&#x2F;&#x2F;dhh.dk&#x2F;posts&#x2F;31-myth-2-rails-is-expected-to-crash-40...</a>
cryptonectorover 1 year ago
&gt; Bonus: restart on hang<p>This is not good for battery life. I&#x27;m not sure how to heuristically detect hangs in a power-friendly way.
评论 #37366071 未加载
nottheengineerover 1 year ago
&quot;My software crashes so often that it&#x27;s worth the time to automate restarting it&quot; is what I&#x27;d expect of a windows user. Has macOS really gotten that bad over the last few years? I remember being forced to use it a long time ago and while it was very limited and special, nothing ever crashed or was visibly buggy.
评论 #37364677 未加载
评论 #37365081 未加载
评论 #37366507 未加载
评论 #37365114 未加载
评论 #37366039 未加载
评论 #37365910 未加载
评论 #37365678 未加载
评论 #37366068 未加载
prmoustacheover 1 year ago
solution looking for a problem
评论 #37366075 未加载
ChrisMarshallNYover 1 year ago
I&#x27;m not really a fan of auto-restart on crash. In some cases, it could cause damage.<p>I consider a crash -<i>any</i> crash, to be my fault. This includes things like yanking out the power cord (which probably will just stop the program counter, as opposed to careening off into the weeds).<p>No matter how abusive the user is, no matter how out-of-band their behavior, my software should <i>never</i> crash.<p>I love crashes. They tend to be easy to fix (of course, thread collisions are another matter). If I can reliably reproduce a crash, I can usually fix it in a few minutes.<p>In iOS, Apple makes it impossible to quit an app. I have heard of developers deliberately forcing a crash to do that, but, if Apple catches you doing it, they&#x27;ll yank the app. They won&#x27;t approve apps they can get to crash. In fact, they have, in the past, found crashes that I missed.<p>Just better off, writing software that can handle always-on, and that doesn&#x27;t crash.
评论 #37366677 未加载
评论 #37366073 未加载