Skip to content
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

compiletest: Panic in ProcOutput::extend #98469

Closed
mystor opened this issue Jun 24, 2022 · 1 comment
Closed

compiletest: Panic in ProcOutput::extend #98469

mystor opened this issue Jun 24, 2022 · 1 comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug.

Comments

@mystor
Copy link
Contributor

mystor commented Jun 24, 2022

in #96551 the logic for deciding when to filter paths was changed in compiletest such that known paths are always considered to be 32 bytes long.

Unfortunately this logic has an error in the case where the known path is shorter than 32 bytes, as the logic may decide to abbreviate the output due to it exceeding HEAD_LEN + TAIL_LEN bytes in length, however the output isn't long enough, so the following check underflows, leading to a panic in split_off:

let tail = middle.split_off(middle.len() - TAIL_LEN).into_boxed_slice();

@jyn514 jyn514 added A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. labels Apr 20, 2023
@jieyouxu jieyouxu added the A-compiletest Area: The compiletest test runner label May 31, 2024
@jieyouxu jieyouxu moved this from Needs Triage / Backlog to Ready in compiletest maintenance and improvements Jun 9, 2024
@jieyouxu
Copy link
Member

compiletest triage:

let matches = (&bytes[(old_len.saturating_sub(path_bytes.len() - 1))..])

seems to have a proper saturing_sub now, probably fixed by #96551. The logic here isn't exactly pretty, however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug.
Projects
Development

No branches or pull requests

3 participants