-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic in Firefox (rusqlite/lru_cache/linked_hash_map) built with recent Rust nightlies #77585
Comments
The message is: Hit MOZ_CRASH(attempted to leave type (a bit silly that non-debug builds of Firefox only output that message into the crash dump magic thing and not onto stderr..)
Maybe the library is at fault here and new rustc just added more checks? |
Removing bisection/mcve -- this is a standard "code was UB" situation, caused by increased checking on mem::uninitialized with types that have invalid bitpatterns. |
Okay, I guess I should close the issue here if that's intentional? Though the fact that runtime checks are added to new compiler versions, not just compile-time checks, is a bit surprising. Seems like the related issue is contain-rs/linked-hash-map#97 |
This is definitely caused by #71274. @myfreeweb can you find out the exact version of linked-hash-map that was compiled for this? v0.5.3 (released back in May) should contain a fix for this problem. |
Note in particular that the code you quoted is outdated:
In the latest version, this looks different. This code was changed more than a year ago. So it looks like the version of linked-hash-map that you use is ancient.
I don't think so, actually -- I think the relevant issue/PR is contain-rs/linked-hash-map#100. |
It would be nice to just make this kind of thing a compilation error, but that's against the stability guarantee -- even if the call is known to be bad, the code might be written so that the UB cases are never executed, so we can't break it. (There's arguably no runtime check here; it's just the codegen level noticing UB and taking advantage of its freedom to emit whatever it wants there. And -- helpfully for debugging emitting a panic -- rather than the |
We do actually have a lint to detect such problems so you can make it a compiler error in your crate with We cannot halt compilation in codegen when we emit the panic as this might be dead code -- even in correct unsafe code, there can be unreachable branches that would cause UB when reached. Making this a compilation error is akin to making any use of the |
Well, mozilla-central has vendored 0.5.1, not me :) bugzilled |
Firefox built with rustc 1.49.0-nightly (beb5ae4 2020-10-04) on FreeBSD/amd64 crashes very quickly with this:
I think the previous nightly before that had the issue too, but it's a recent issue, whatever I was using before the last couple upgrades (probably something from September) was fine. Switching to stable fixed the issue.
(doing a debug build now)
The text was updated successfully, but these errors were encountered: