From dfb48dc8a8d32540efd643e48ed26ddd5eb38c5e Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 13 Dec 2025 17:36:27 +0200 Subject: [PATCH 1/9] make more readable --- src/fuzzing.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fuzzing.md b/src/fuzzing.md index 295f2ef87..009ca0770 100644 --- a/src/fuzzing.md +++ b/src/fuzzing.md @@ -5,8 +5,8 @@ For the purposes of this guide, *fuzzing* is any testing methodology that involves compiling a wide variety of programs in an attempt to uncover bugs in rustc. Fuzzing is often used to find internal compiler errors (ICEs). -Fuzzing can be beneficial, because it can find bugs before users run into them and -provide small, self-contained programs that make the bug easier to track down. +Fuzzing can be beneficial, because it can find bugs before users run into them. +It also provides small, self-contained programs that make the bug easier to track down. However, some common mistakes can reduce the helpfulness of fuzzing and end up making contributors' lives harder. To maximize your positive impact on the Rust @@ -144,7 +144,7 @@ To enable debug assertions, add this to `bootstrap.toml` when compiling rustc: debug-assertions = true ``` -ICEs that require debug assertions to reproduce should be tagged +ICEs that require debug assertions to reproduce should be tagged [`requires-debug-assertions`][requires-debug-assertions]. [requires-debug-assertions]: https://github.com/rust-lang/rust/labels/requires-debug-assertions From b66ff8a8c7ef7180fa3655606e26d7b7bfee9aa8 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 13 Dec 2025 17:39:16 +0200 Subject: [PATCH 2/9] remove unclear text --- src/fuzzing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fuzzing.md b/src/fuzzing.md index 009ca0770..b4792f8ef 100644 --- a/src/fuzzing.md +++ b/src/fuzzing.md @@ -22,7 +22,7 @@ project, please read this guide before reporting fuzzer-generated bugs! - Include a reasonably minimal, standalone example along with any bug report - Include all of the information requested in the bug report template - Search for existing reports with the same message and query stack -- Format the test case with `rustfmt`, if it maintains the bug +- Format the test case with `rustfmt` - Indicate that the bug was found by fuzzing *Please don't:* From 5732a40cdb1c607f8522292a96d225449abc72b1 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 13 Dec 2025 17:46:47 +0200 Subject: [PATCH 3/9] horizontal scroll is excessive for these examples --- src/fuzzing.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/fuzzing.md b/src/fuzzing.md index b4792f8ef..070092879 100644 --- a/src/fuzzing.md +++ b/src/fuzzing.md @@ -38,13 +38,11 @@ been reported, please go ahead and report it and link to issues you think might In general, ICEs on the same line but with different *query stacks* are usually distinct bugs. For example, [#109020][#109020] and [#109129][#109129] had similar error messages: -``` -error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <[closure@src/main.rs:36:25: 36:28] as std::ops::FnOnce<(Emplacable<()>,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead -``` -``` -error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <() as Project>::Assoc, maybe try to call `try_normalize_erasing_regions` instead -``` -but different query stacks: +> error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <[closure@src/main.rs:36:25: 36:28] as std::ops::FnOnce<(Emplacable<()>,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead + +> error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <() as Project>::Assoc, maybe try to call `try_normalize_erasing_regions` instead + +However, they have different query stacks: ``` query stack during panic: #0 [fn_abi_of_instance] computing call ABI of `<[closure@src/main.rs:36:25: 36:28] as core::ops::function::FnOnce<(Emplacable<()>,)>>::call_once - shim(vtable)` From d997e4b4adbb052f7a47b078327b3e4824d37abf Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 13 Dec 2025 17:47:48 +0200 Subject: [PATCH 4/9] guidance is clear enough --- src/fuzzing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fuzzing.md b/src/fuzzing.md index 070092879..dc601e8b0 100644 --- a/src/fuzzing.md +++ b/src/fuzzing.md @@ -62,7 +62,7 @@ end of query stack When building a corpus, be sure to avoid collecting tests that are already known to crash rustc. A fuzzer that is seeded with such tests is more likely to -generate bugs with the same root cause, wasting everyone's time. +generate bugs with the same root cause. The simplest way to avoid this is to loop over each file in the corpus, see if it causes an ICE, and remove it if so. From 4eff79d4c72ab5382c79cc72a607e67209b9cee5 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 13 Dec 2025 18:02:02 +0200 Subject: [PATCH 5/9] feels appropriate --- src/fuzzing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fuzzing.md b/src/fuzzing.md index dc601e8b0..6cbe3cdb4 100644 --- a/src/fuzzing.md +++ b/src/fuzzing.md @@ -78,7 +78,7 @@ To build a corpus, you may want to use: ## Extra credit -Here are a few things you can do to help the Rust project after filing an ICE. +Here are a few things you can do to help the Rust project after filing an ICE: - [Bisect][bisect] the bug to figure out when it was introduced. If you find the regressing PR / commit, you can mark the issue with the label `S-has-bisection`. From 4be89f0fb4338ff6243ee4bc01bf85bfcf965cc8 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 13 Dec 2025 18:14:14 +0200 Subject: [PATCH 6/9] fluff --- src/fuzzing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fuzzing.md b/src/fuzzing.md index 6cbe3cdb4..9f5360e1e 100644 --- a/src/fuzzing.md +++ b/src/fuzzing.md @@ -133,7 +133,7 @@ Of course, it's best to try multiple build configurations and see what actually results in superior throughput. You may want to build rustc from source with debug assertions to find -additional bugs, though this is a trade-off: it can slow down fuzzing by +additional bugs, though this can slow down fuzzing by requiring extra work for every execution. To enable debug assertions, add this to `bootstrap.toml` when compiling rustc: From f5afb600e8d021f55e7fbe3a4f2bb134867e3227 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 13 Dec 2025 18:15:07 +0200 Subject: [PATCH 7/9] use compact format, as this is what is in bootstrap.example.toml --- src/fuzzing.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/fuzzing.md b/src/fuzzing.md index 9f5360e1e..648fa351c 100644 --- a/src/fuzzing.md +++ b/src/fuzzing.md @@ -138,8 +138,7 @@ requiring extra work for every execution. To enable debug assertions, add this to `bootstrap.toml` when compiling rustc: ```toml -[rust] -debug-assertions = true +rust.debug-assertions = true ``` ICEs that require debug assertions to reproduce should be tagged From 1572e819e14089b91f6ca2e5c4e29f80a6de3663 Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 13 Dec 2025 18:18:39 +0200 Subject: [PATCH 8/9] redundant --- src/fuzzing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fuzzing.md b/src/fuzzing.md index 648fa351c..6ef8c3179 100644 --- a/src/fuzzing.md +++ b/src/fuzzing.md @@ -36,7 +36,7 @@ project, please read this guide before reporting fuzzer-generated bugs! If you're not sure whether or not an ICE is a duplicate of one that's already been reported, please go ahead and report it and link to issues you think might be related. In general, ICEs on the same line but with different *query stacks* are usually distinct bugs. -For example, [#109020][#109020] and [#109129][#109129] had similar error messages: +For example, [#109020] and [#109129] had similar error messages: > error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <[closure@src/main.rs:36:25: 36:28] as std::ops::FnOnce<(Emplacable<()>,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead @@ -71,7 +71,7 @@ To build a corpus, you may want to use: - The rustc/rust-analyzer/clippy test suites (or even source code) --- though avoid tests that are already known to cause failures, which often begin with comments like `//@ failure-status: 101` or `//@ known-bug: #NNN`. -- The already-fixed ICEs in the archived [Glacier][glacier] repository --- though +- The already-fixed ICEs in the archived [Glacier] repository --- though avoid the unfixed ones in `ices/`! [glacier]: https://github.com/rust-lang/glacier @@ -142,9 +142,9 @@ rust.debug-assertions = true ``` ICEs that require debug assertions to reproduce should be tagged -[`requires-debug-assertions`][requires-debug-assertions]. +[`requires-debug-assertions`]. -[requires-debug-assertions]: https://github.com/rust-lang/rust/labels/requires-debug-assertions +[`requires-debug-assertions`]: https://github.com/rust-lang/rust/labels/requires-debug-assertions ## Existing projects From 89e9af43d56ab2fe347d72893fe60c5376f7797f Mon Sep 17 00:00:00 2001 From: Tshepang Mbambo Date: Sat, 13 Dec 2025 18:26:45 +0200 Subject: [PATCH 9/9] fails link checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit error: Potential incomplete link ┌─ fuzzing.md:41:122 │ 41 │ > error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <[closure@src/main.rs:36:25: 36:28] as std::ops::FnOnce<(Emplacable<()>,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Did you forget to define a URL for `closure@src/main.rs:36:25: 36:28`? --- src/fuzzing.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fuzzing.md b/src/fuzzing.md index 6ef8c3179..635c01d21 100644 --- a/src/fuzzing.md +++ b/src/fuzzing.md @@ -38,9 +38,13 @@ been reported, please go ahead and report it and link to issues you think might In general, ICEs on the same line but with different *query stacks* are usually distinct bugs. For example, [#109020] and [#109129] had similar error messages: -> error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <[closure@src/main.rs:36:25: 36:28] as std::ops::FnOnce<(Emplacable<()>,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead +``` +error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <[closure@src/main.rs:36:25: 36:28] as std::ops::FnOnce<(Emplacable<()>,)>>::Output, maybe try to call `try_normalize_erasing_regions` instead +``` -> error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <() as Project>::Assoc, maybe try to call `try_normalize_erasing_regions` instead +``` +error: internal compiler error: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:195:90: Failed to normalize <() as Project>::Assoc, maybe try to call `try_normalize_erasing_regions` instead +``` However, they have different query stacks: ```