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

Fuzz: drop workarounds for operations that may panic #92

Merged
merged 4 commits into from
Jul 29, 2020
Merged

Conversation

Shnatsel
Copy link
Collaborator

Drop workarounds for operations that may panic now that rutenspitz compares panic behavior

cc @jakubadamw

@Shnatsel
Copy link
Collaborator Author

Oh , it's finding some mismatches in ArrayVec now! Interesting!

@jakubadamw
Copy link
Contributor

LGTM. 👍

@Shnatsel
Copy link
Collaborator Author

ArrayVec panic is pointing to an integer overflow on this line:

Bound::Included(&n) => n + 1,

Operation triggering it: v.drain(..=18446744073709551615);

I am surprised that this panic is possible to detect in this setup at all. Does this mean that Vec doesn't panic here?

Side note: https://github.com/jakubadamw/rutenspitz/blob/master/DEBUGGING.md is complicated, lldb-specific (no gdb) and possibly requires rust-lldb as opposed to mainline. I've just added a println!("Operations trace:\n{}", _op_trace);

@Shnatsel
Copy link
Collaborator Author

@Shnatsel
Copy link
Collaborator Author

The same overflow was also discovered in TinyVec:

Bound::Included(x) => x + 1,

@Shnatsel
Copy link
Collaborator Author

CI is failing with DNS resolution errors.

@jakubadamw
Copy link
Contributor

jakubadamw commented Jul 28, 2020

@Shnatsel,

Side note: https://github.com/jakubadamw/rutenspitz/blob/master/DEBUGGING.md is complicated, lldb-specific (no gdb) and possibly requires rust-lldb as opposed to mainline. I've just added a println!("Operations trace:\n{}", _op_trace);

I used a regular lldb (HFUZZ_DEBUGGER=lldb cargo hfuzz run-debug …). In fact, I had some issues running it with rust-lldb. 🙂 But yes, it is written with lldb in mind and perhaps could use some clarification.

@Nemo157
Copy link
Collaborator

Nemo157 commented Jul 29, 2020

That sounds worthy of an upstream bug report, silently failing to drain the vector 😦

@Nemo157
Copy link
Collaborator

Nemo157 commented Jul 29, 2020

Hmm, building with -Z build-std gives

thread 'main' panicked at 'attempt to add with overflow', /home/wim/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/liballoc/vec.rs:1322:29

so, the behaviour here is actually identical, except std is normally built in release mode and you are testing in debug mode.

@Shnatsel
Copy link
Collaborator Author

I've opened an issue against libstd: rust-lang/rust#74909

@Shnatsel Shnatsel merged commit 4c5fbbf into main Jul 29, 2020
@Shnatsel Shnatsel deleted the compare-panics branch July 29, 2020 13:40
@Shnatsel
Copy link
Collaborator Author

No further failures after 500 million executions of arrayish target and 125 million executions of tinyvec target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants