You'd know exactly where and why it was raised, and you can gracefully report and error and go on with outher work or shut down. The comparison is a bit of a stretch.
-
-
My comparison isn't in the type of error, but the fact that either extension (java or c) can cause an error native to that extension type. So the fact that a C extension can segv shouldn't be used as an argument against them. Not all Ruby programmers know Java (as not all know C)
3 replies 0 retweets 1 like -
Far more Ruby programmers would know how to handle an exception than a segv.
1 reply 0 retweets 3 likes -
Replying to @headius @tenderlove and
In practice, though, neither will be handled at the app level if a gem allows either one to affect the dependent app.
1 reply 0 retweets 1 like -
Replying to @jamie_gaskins @tenderlove and
One will get a full stack trace in app logs and not interfere with code that doesn't use that extension. The other just explodes.
1 reply 0 retweets 1 like -
Replying to @headius @tenderlove and
The stack trace is great for the gem developer who wrote the extension, but it does little for the typical Ruby app developer who doesn’t know Java and is unfamiliar with JRuby internals. And the NPE does affect an entire app if it bubbles up that high.
1 reply 0 retweets 1 like -
Replying to @jamie_gaskins @tenderlove and
But you can report it and an ext author can probably find and fix it within minutes. I get what y'all are saying but there's only a limited parallel between segv and NPE here...by design.
1 reply 0 retweets 3 likes -
Replying to @headius @tenderlove and
I get what you're saying, too, but that parallel is only limited through your perspective. From the PoV of an app developer who doesn't understand the plumbing, a JRuby NPE stack trace and an MRI segv trace are equivalently opaque, and both are readable by ext authors.
1 reply 0 retweets 0 likes -
Replying to @jamie_gaskins @tenderlove and
I can win this argument simply by pointing out that segv is the *best case scenario*. You can also just walk off an object into another object and totally boggle the heap in a C ext.
1 reply 0 retweets 2 likes -
Replying to @headius @jamie_gaskins and
I'm not sure what argument you're trying to win. An NPE is easier to debug than a segv, but that doesn't mean I should never write C. Debugging a JRuby NPE or a CRuby segv both require knowledge of their respective implementations (JRuby or CRuby)
2 replies 0 retweets 1 like
Plus a segv is a best case scenario for a memory safety issue. At the end of the day it's UB, and you're just *hoping* your app crashes instead of something worse.
-
-
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.