Crash in [@ zlib_rs::deflate::State::d_code] on Raptor Lake CPUs
Categories
(Core :: General, defect)
Tracking
()
People
(Reporter: mccr8, Assigned: glandium)
References
(Blocks 2 open bugs, Regression)
Details
(Keywords: crash, regression, topcrash)
Crash Data
Attachments
(2 external files)
Crash report: https://crash-stats.mozilla.org/report/index/113ebfb1-9197-44e2-88ce-322b20250223
MOZ_CRASH Reason:
index out of bounds: the len is 512 but the index is 567
Top 10 frames:
0 xul.dll MOZ_Crash(char const*, int, char const*) mfbt/Assertions.h:382
0 xul.dll RustMozCrash(char const*, int, char const*) mozglue/static/rust/wrappers.cpp:18
1 xul.dll mozglue_static::panic_hook(std::panic::PanicHookInfo*) mozglue/static/rust/lib.rs:102
2 xul.dll core::ops::function::Fn::call<void (*)(ref$<std::panic::PanicHookInfo>), tupl... /rustc/4d91de4e48198da2e33413efdcd9cd2cc0c46688/library/core/src/ops/function.rs:250
3 xul.dll alloc::boxed::impl$30::call() library/alloc/src/boxed.rs:2007
3 xul.dll std::panicking::rust_panic_with_hook() library/std/src/panicking.rs:836
4 xul.dll std::panicking::begin_panic_handler::closure$0() library/std/src/panicking.rs:701
5 xul.dll std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_h... library/std/src/sys/backtrace.rs:168
6 xul.dll std::panicking::begin_panic_handler() library/std/src/panicking.rs:692
7 xul.dll core::panicking::panic_fmt() library/core/src/panicking.rs:75
Looks like we're hitting a bounds check.
| Assignee | ||
Comment 1•1 year ago
|
||
Do we have a reproducer for any of these?
Comment 2•1 year ago
|
||
Several crashes are on YouTube, here's a few links:
- https://www.youtube.com/watch?v=wDWV-EwReDE
- https://www.youtube.com/watch?v=IJGbkjuRO8E
- https://music.youtube.com/playlist?list=OLAK5uy_kY8dtv44revO4EYCIUOAgYfrWo9a_DQu0
Other crashes are on Discord, Twitch but also under https://www.bing.com/images/
Comment 3•1 year ago
•
|
||
Oh wait, every single crash is coming from a machine with CPU ID family 6 model 183 stepping 1. That's our good friend Raptor Lake (Raptor Cove S / Gracemont E to be precise).
Comment 4•1 year ago
•
|
||
Additionally the crash with the most recent microcode has version 0x129, the latest microcode version for this instance of Raptor Lake is 0x12c and we have no crashes with that version.
| Assignee | ||
Updated•1 year ago
|
| Reporter | ||
Comment 5•1 year ago
|
||
Good catch! I didn't even think to look for a CPU issue at this volume of a crash on Nightly.
I have no reproducer information about how to reproduce beyond what gsvelto said.
Comment 6•1 year ago
|
||
Small correction, we also have crashes on file from microcode version 0x12b which is almost the latest. So unless the bug has been p̶a̶p̶e̶r̶e̶d̶ ̶o̶v̶e̶r̶ fixed in 0x12c then it affects all microcode versions. Microcode 0x12c was released two weeks ago so not many machines will be running it.
Updated•1 year ago
|
Comment 7•1 year ago
|
||
Hi Gabriele! Can you help set the severity for this issue? Is there anything we can do, in addition to waiting for the resolution of https://github.com/trifectatechfoundation/zlib-rs/issues/306? Thank you.
Comment 8•1 year ago
|
||
From a severity perspective this is really bad, because it manifests itself as either a content or full browser crash happening often on nightly so I'd say S2. The problem is that it's entirely out of our hands unless we understand what instruction sequence triggers it, but even if we identify it, avoiding it might be impossible. It's also going to be a lot of work. We should definitely reach out for our contacts at Intel given the volume of this crash.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 9•1 year ago
|
||
To be clear, this does not affect anything else than nightly. The code is not set to ride the trains yet.
Comment 10•1 year ago
|
||
The bug is linked to a topcrash signature, which matches the following criterion:
- Top 10 desktop browser crashes on nightly
For more information, please visit BugBot documentation.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 11•1 year ago
|
||
Given that this is on Raptor Lake, it sounds like the assumption is that this is the over-voltage bug? Assuming that's the case, then as noted there, "there is no fix to the issue if it already affects a CPU, and any damage to the CPU is permanent". So if the CPU had already been damaged, it may not matter if the microcode is a fixed version. (Leaving aside that many of the crashes appear to be on pre-0x129 versions.)
Does Mozilla have a standard procedure for handling likely Raptor Lake CPU bugs? Reaching out to Intel may be a good idea, but also, given the number of crashes occurring with this CPU, might there be some reasonable way to encourage people to take advantage of the warranty extension on their CPUs?
Trying to avoid getting nerd-sniped by the possibility of narrowing down the issue further, since doing so would effectively be trying to reverse-engineer the CPU bug. But some general questions for someone who has access to the crash data: Does the "index out of bounds" panic for these crashes have a consistent index (e.g. the 567 mentioned in this issue) or are the indexes all over the place (between 513 and 767)? Do the backtraces always go through compress_block_dynamic_trees and emit_dist, rather than compress_block_static_trees and emit_dist_static, or is it a mix of both?
Comment 12•1 year ago
|
||
The index is not always 567. e.g: 527, 719, 615, 566, 747
7 out of 7 of the crashes I checked went through compress_block_dynamic_trees
Comment 13•1 year ago
|
||
(In reply to Josh Triplett from comment #11)
Given that this is on Raptor Lake, it sounds like the assumption is that this is the over-voltage bug? Assuming that's the case, then as noted there, "there is no fix to the issue if it already affects a CPU, and any damage to the CPU is permanent". So if the CPU had already been damaged, it may not matter if the microcode is a fixed version. (Leaving aside that many of the crashes appear to be on pre-0x129 versions.)
This crash is very consistent while the overvoltage issue was randomish in nature, it's more likely to be one of the existing erratas or a new one.
Does Mozilla have a standard procedure for handling likely Raptor Lake CPU bugs? Reaching out to Intel may be a good idea, but also, given the number of crashes occurring with this CPU, might there be some reasonable way to encourage people to take advantage of the warranty extension on their CPUs?
I have reached out to Intel but haven't received an answer yet, we'll see what happens. That being said I've re-checked their errata and microcode release and noticed that they shipped a new microcode version in February (0x12c) which apparently fixes two of the known issues that cause loads to deliver wrong data (RPL050 and RPL060). We currently don't have crashes on file for users with that microcode version installed but it's too early to tell, it will take a while before that version gets rolled out to our users both in Windows and Linux.
Trying to avoid getting nerd-sniped by the possibility of narrowing down the issue further, since doing so would effectively be trying to reverse-engineer the CPU bug. But some general questions for someone who has access to the crash data: Does the "index out of bounds" panic for these crashes have a consistent index (e.g. the
567mentioned in this issue) or are the indexes all over the place (between513and767)? Do the backtraces always go throughcompress_block_dynamic_treesandemit_dist, rather thancompress_block_static_treesandemit_dist_static, or is it a mix of both?
It never goes through the latter, the stack is always the same you see in the crash in comment 0.
Comment 14•1 year ago
|
||
Based on the topcrash criteria, the crash signature linked to this bug is not a topcrash signature anymore.
For more information, please visit BugBot documentation.
Updated•1 year ago
|
Comment 15•1 year ago
|
||
Since the crash volume is low (less than 15 per week), the severity is downgraded to S3. Feel free to change it back if you think the bug is still critical.
For more information, please visit BugBot documentation.
Comment 16•1 year ago
|
||
gsvelto - any update from Intel? Any crashes with 0x12c in the 2 months since last check?
Comment 17•1 year ago
|
||
I haven't heard anything from Intel. There have been only two crashes with microcode 0x12c in the past two months, all the other crashes are on older microcodes. Given that those two crashes remain I don't feel confident in saying that the problem was fixed, but it might have been mitigated to the point that it's not very frequent anymore. I also can't rule out that we don't generate the sequence of instructions that crashes that particular CPU.
Comment 18•1 year ago
|
||
Gabriele pointed out the underlying CPU bug has been identified: https://fgiesen.wordpress.com/2025/05/21/oodle-2-9-14-and-intel-13th-14th-gen-cpus/
If the volume here goes too high we may be able to work around it.
| Assignee | ||
Comment 19•1 year ago
•
|
||
I'm going to deploy libz-rs-sys on early beta in bug 1968103, we'll see how the crash volume evolves.
Comment 20•1 year ago
|
||
I have checked the reports again and I have bad news: it seems that there's a new microcode around (version 0x12f) and the crash volume on it is significant. It's hard to be sure if this is a regression on Intel's part but it does look like it is. Either way, with this crash rate in beta we'd probably have a very significant volume of crashes in the release channel.
Comment 21•1 year ago
|
||
FYI I've reached out to Intel again, let's see what happens.
Updated•1 year ago
|
Comment 22•1 year ago
|
||
Adding an extra note here about the nature of the crash because it might be useful: I traced the root cause of the crash to this bit of code:
By looking at the register contents in the crash reports I can tell that the value that's being loaded in the dist variable is wrong. The uppermost bit of that 16-bit variable is set but it should never be. The value itself looks like it couldn't have possibly come from the buffer it was supposed to be loaded from. Since this is an LTO/PGO build however, this code is highly inlined and specialized, so I couldn't trace it back to the bit of assembly where the load is actually happening, I'm just seeing the value after the fact. Given it's a 16-bit value I suspect that we might be getting the wrong part of a wider load, but this is just speculation on my part which I haven't been able to verify yet.
Comment 23•1 year ago
|
||
FYI we heard nothing from Intel, these kind of bugs have kept popping up and none of the new microcode versions seem to have solved them. I say we should go ahead with our changes. The users of these systems are already having a miserable time and it's better to point them towards getting their machines fixed rather than trying to work around just one of the dozens (!) of different bugs that only ever happen on these CPUs.
Comment 24•5 months ago
|
||
[Tracking Requested - why for this release]:
With bug 2017549 enabling libz-rs-sys on release, this is a top crasher (#3) for Firefox 151.0 caused by the affected CPUs.
(In reply to Gian-Carlo Pascutto [:gcp] from comment #18)
If the volume here goes too high we may be able to work around it.
Updated•5 months ago
|
Comment 25•5 months ago
|
||
Setting as S2 as this is already a top crasher for 151.0 on day 1 of the rollout
Comment 26•5 months ago
|
||
FYI while the upstream code changed a bit my analisis in comment 22 is still valid. We're getting a wrong dist value in compress_block_help(), potentially because the generated code is issuing instructions that manipulate x86 8-bit subregisters to compose the 16-bit value and that's one of the codepaths that are more likely to trigger the hardware bug. The workaround would entail avoiding those instructions along those paths, which is probably impossible to do at the compiler level short of replacing that bit of code with inline assembly.
Comment 28•5 months ago
•
|
||
I will comment some ideas in the osint channel (but yes, it's replacing the code with inline assembly that works around the problem).
Comment 29•5 months ago
|
||
The bug is marked as tracked for firefox152 (beta). However, the bug still isn't assigned.
:sdetar, could you please find an assignee for this tracked bug? Given that it is a regression and we know the cause, we could also simply backout the regressor. If you disagree with the tracking decision, please talk with the release managers.
For more information, please visit BugBot documentation.
Updated•5 months ago
|
| Assignee | ||
Comment 30•5 months ago
|
||
Updated•5 months ago
|
Comment 31•5 months ago
|
||
FYI I might have found some users with broken machines who could test this. I'll report back after I confirm that they can reproduce the original issue on their boxes.
Updated•5 months ago
|
Comment 32•5 months ago
|
||
Comment 33•5 months ago
|
||
Comment 34•5 months ago
|
||
Backed out for causing build bustages @ rust.mk
| Assignee | ||
Updated•5 months ago
|
Comment 35•5 months ago
|
||
Comment 36•5 months ago
|
||
| bugherder | ||
Comment 37•5 months ago
|
||
The patch landed in nightly and beta is affected.
:glandium, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox152towontfix.
For more information, please visit BugBot documentation.
| Assignee | ||
Comment 38•5 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D301917
Updated•5 months ago
|
Comment 39•5 months ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: Fixes crash on Intel Raptor CPUs
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Trivial code change with no semantic difference.
- String changes made/needed?: N/A
- Is Android affected?: no
Updated•5 months ago
|
Updated•5 months ago
|
Comment 40•5 months ago
|
||
| uplift | ||
Comment 41•5 months ago
|
||
Should we get our own Raptor Lake machine and run CI somehow, or would it just open a can of worms that nobody wants to look at?
| Assignee | ||
Updated•5 months ago
|
Comment 42•5 months ago
|
||
It would help but we'd need to find a system that's already degraded, or degrade one on purpose by reverting the microcode to whatever the faulty version was. It's a lot of work.
Description
•