Closed Bug 1623778 Opened 5 years ago Closed 5 years ago

Crash in [@ std::io::stdio::_eprint] during fluent_bundle_add_resource

Categories

(Core :: Internationalization, defect)

Unspecified
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla76
Tracking Status
firefox-esr68 --- unaffected
firefox74 --- unaffected
firefox75 --- unaffected
firefox76 --- fixed

People

(Reporter: mccr8, Assigned: zbraniecki)

References

(Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(1 file)

This bug is for crash report bp-04eec468-2c3b-4df8-b93a-af5a70200317.

Top 10 frames of crashing thread:

0 libxul.so RustMozCrash mozglue/static/rust/wrappers.cpp:17
1 libxul.so mozglue_static::panic_hook mozglue/static/rust/lib.rs:89
2 libxul.so core::ops::function::Fn::call src/libcore/ops/function.rs:72
3 libxul.so std::panicking::rust_panic_with_hook src/libstd/panicking.rs:475
4 libxul.so rust_begin_unwind src/libstd/panicking.rs:375
5 libxul.so std::panicking::begin_panic_fmt src/libstd/panicking.rs:326
6 libxul.so std::io::stdio::_eprint src/libstd/io/stdio.rs:811
7 libxul.so fluent_bundle_add_resource intl/l10n/rust/fluent-ffi/src/bundle.rs:254
8 libxul.so mozilla::dom::FluentBundle_Binding::addResource dom/bindings/FluentBinding.cpp:1000
9 libxul.so bool mozilla::dom::binding_detail::GenericMethod<mozilla::dom::binding_detail::NormalThisPolicy, mozilla::dom::binding_detail::ThrowExceptions> dom/bindings/BindingUtils.cpp:3205

This crash is happening on the line eprintln!("Error while adding a resource");.

I don't know why the signature is so crummy. A lot of the recent crashes with this signature are this issue, but maybe not all of them. I filed bug 1623774 about the signature.

Summary: Crash in [@ std::io::stdio::_eprint] → Crash in [@ std::io::stdio::_eprint] during fluent_bundle_add_resource
Flags: needinfo?(gandalf)

Emilio - any idea why this crashes and what would be a safe way to report errors?

Flags: needinfo?(gandalf) → needinfo?(emilio)

Yeah, the error message says it... it's crashing with "os error 5", which is access denied.

Either let _ = writeln!(&mut io::stderr(), "..."); to ignore the error, or use the log crate, or even better in this case return the error to C++ and throw an exception?

Flags: needinfo?(emilio)

(Or log a warning in the console or something)

Assignee: nobody → gandalf
Status: NEW → ASSIGNED

This is a temporary solution. Once I migrate Localization.jsm to Rust I'll unify error reporting to happen in Localization class and bind them to contexts and file URIs.
Also, in Localization warnings are shown in testing and local builds, CI is meant to crash, and production stable release builds not show recoverable errors.

For now, this will help people discover error scenarios.

Pushed by zbraniecki@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/41722eea7dd5 Improve error reporting for AddResource. r=emilio
Pushed by zbraniecki@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/da4e0b4b9306 Improve error reporting for AddResource. r=emilio

minor test incompatibility due to error strings.

Flags: needinfo?(gandalf)
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: