On Tue, Mar 22, 2016, at 06:51 PM, Brian Smith wrote:
> On Tue, Mar 22, 2016 at 3:03 AM, Henri Sivonen <hsivo...@hsivonen.fi>
> wrote:
> 
> > It seems that the Rust MP4 parser is run a new Rust-created thread in
> > order to catch panics.
> >
> 
> Is the Rust MP4 parser using panics for flow control (like is common in
> JS
> and Java with exceptions), or only for "should be impossible" situations
> (like MOZ_CRASH in Gecko)?
> 
> IMO panics in Rust should only be used for cases where one would use
> MOZ_CRASH and so you should configure the rust runtime to abort on
> panics.
> 
> I personally don't expect people to write correctly write unwinding-safe
> code—especially when mixing non-Rust and Rust—any more than I expect
> people
> to write exception-safe code (i.e. not at all), and so abort-on-panic is
> really the only acceptable configuration to run Rust code in.

I think I agree with this assessment. We'd just also like to make sure
that the specific way that the Rust code aborts triggers our Breakpad
exception handler, as we've had problems with this in the past (calling
abort() does not reliably do so, except in Gecko code where we override
the symbol), hence the repeated refrain of "MOZ_CRASH".

-Ted
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to