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.

Why Ruby App Servers Break on MacOS High Sierra

259 pointsby mefover 7 years ago

16 comments

saagarjhaover 7 years ago
Greg Parker, who works on the Objective-C runtime, has a blog post that goes into more detail: <a href="http:&#x2F;&#x2F;www.sealiesoftware.com&#x2F;blog&#x2F;archive&#x2F;2017&#x2F;6&#x2F;5&#x2F;Objective-C_and_fork_in_macOS_1013.html" rel="nofollow">http:&#x2F;&#x2F;www.sealiesoftware.com&#x2F;blog&#x2F;archive&#x2F;2017&#x2F;6&#x2F;5&#x2F;Objectiv...</a>
评论 #15511573 未加载
joshmnover 7 years ago
This issue has been addressed on ruby-head<p><a href="https:&#x2F;&#x2F;github.com&#x2F;ruby&#x2F;ruby&#x2F;commit&#x2F;8b182a7f7d798ab6539518fbfcb51c78549f9733" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ruby&#x2F;ruby&#x2F;commit&#x2F;8b182a7f7d798ab6539518fb...</a>
评论 #15509112 未加载
评论 #15506929 未加载
dep_bover 7 years ago
&gt; This cryptic error<p>Well....I don&#x27;t think I&#x27;ve seen many programmer-to-programmer errors that are less cryptic than the one described in the article. It&#x27;s actually quite amazing how much explanation you sometimes get from Cocoa!
评论 #15511400 未加载
评论 #15510758 未加载
the_mitsuhikoover 7 years ago
Python suffers from the same issue but the response there has largely been to stop using modules that use objc.
评论 #15506467 未加载
oblioover 7 years ago
This is so incredibly Apple :)<p>The breakage, I mean. To clarify a bit, for better or for worse, this is what Microsoft does, totally different psychology: <a href="https:&#x2F;&#x2F;blogs.msdn.microsoft.com&#x2F;oldnewthing&#x2F;20031223-00&#x2F;?p=41373" rel="nofollow">https:&#x2F;&#x2F;blogs.msdn.microsoft.com&#x2F;oldnewthing&#x2F;20031223-00&#x2F;?p=...</a>
评论 #15506444 未加载
评论 #15506034 未加载
评论 #15506000 未加载
评论 #15506474 未加载
评论 #15506015 未加载
评论 #15506409 未加载
评论 #15513485 未加载
mhandleyover 7 years ago
Interesting discussion. If these were user-space threads, like FreeBSD ~20 years ago, there&#x27;d be no problem. When fork() is called, the whole user-space threads package would be forked, along with all the threads.<p>So the obvious question is whether it&#x27;s <i>fundamental</i> that with kernel threads the fork() system call doesn&#x27;t clone all the other threads in the process? Yes, that&#x27;s not how it&#x27;s done, but could Apple choose to implement a new fork_all() system call? I imagine it wouldn&#x27;t be easy - you&#x27;d need to pause <i>all</i> the running threads while you copied state, but is there a reason it&#x27;s actually not possible?
评论 #15506652 未加载
评论 #15506551 未加载
评论 #15506747 未加载
mkjover 7 years ago
Do developers just call whatever function seems to work without reading the docs? It doesn&#x27;t work for low level programming.<p><pre><code> ~ man fork </code></pre> CAVEATS: There are limits to what you can do in the child process. To be totally safe you should restrict yourself to only executing async-signal safe operations until such time as one of the exec functions is called. All APIs, including global data symbols, in any framework or library should be assumed to be unsafe after a fork() unless explicitly documented...
评论 #15507684 未加载
评论 #15511011 未加载
评论 #15507520 未加载
评论 #15508372 未加载
throwaway613834over 7 years ago
fork() <i>fundamentally does not make sense</i> as the de-facto method of starting a new process. Why aren&#x27;t people using posix_spawn() by default?
评论 #15506878 未加载
评论 #15507788 未加载
booleanbetrayalover 7 years ago
for other fun low-level High Sierra issues, see the PostgreSQL msync() thread: <a href="https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;flat&#x2F;13746.1506974083%40sss.pgh.pa.us#13746.1506974083@sss.pgh.pa.us" rel="nofollow">https:&#x2F;&#x2F;www.postgresql.org&#x2F;message-id&#x2F;flat&#x2F;13746.1506974083%...</a>
评论 #15507677 未加载
olivierlacanover 7 years ago
The discussion on the Ruby core team issue tracker is also very informative: <a href="https:&#x2F;&#x2F;bugs.ruby-lang.org&#x2F;issues&#x2F;14009" rel="nofollow">https:&#x2F;&#x2F;bugs.ruby-lang.org&#x2F;issues&#x2F;14009</a>
bpicoloover 7 years ago
I&#x27;ve hit similar issues with uwsgi in recent memory (though pre high-sierra), where an OS upgrade caused it to start segfaulting when using the `requests` lib inside CoreFoundation somewhere (though of course entirely unrelated to the new forking changes).<p>Maybe this? Though the resolution was to disable uwsgi proxying globally... <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;35650520&#x2F;uwsgi-segmentation-fault-when-using-flask-and-python-requests" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;35650520&#x2F;uwsgi-segmentat...</a>
krisivesover 7 years ago
What does Linux do right now?
评论 #15506931 未加载
limaover 7 years ago
Why do people run applications servers on macOS?
评论 #15506446 未加载
评论 #15506450 未加载
评论 #15506655 未加载
throwme211345over 7 years ago
LOL. mac osx breaks fork() to avoid state inconsistency in threaded applications. How about pthread_atfork() semantics? But ,as usual, apple heavy hands userspace and breaks things. Nothing new to see here, move on.
评论 #15507511 未加载
ransom1538over 7 years ago
I agree the bug should be fixed. But, why not just use docker, then run rails like its on ubuntu&#x2F;linux on your mac? It miserable having windows&#x2F;mac&#x2F;etc specific issues.
评论 #15506863 未加载
评论 #15507768 未加载
pantulisover 7 years ago
I love this geek-porn stuff, and the Phusion guys never fail to deliver it ;)<p>But my question is: is this really that important? I mostly use macOS for development, don&#x27;t feel that the preforking model has that impact in the development cycle.
评论 #15506356 未加载
评论 #15506355 未加载