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

[Question] HW5 build failed with sanitizer #573

Closed
healwon opened this issue Dec 9, 2021 · 3 comments
Closed

[Question] HW5 build failed with sanitizer #573

healwon opened this issue Dec 9, 2021 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@healwon
Copy link

healwon commented Dec 9, 2021

I'm in trouble with build failed.
build and test with cargo and cargo --release is done well, but in cargo_asan and cargo_tsan test, it fails to build.

I cannot reason why...anyone know how to solve this problem?

...

running 1 test
test log_concurrent ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 3 filtered out; finished in 2.75s

2. Running AddressSanitizer tests...
Testing growable_array.rs with cargo_asan...
Build failed!
Test failed:    cargo_asan test  --test growable_array smoke
Test failed:    cargo_asan test  --test growable_array stress_sequential
Test failed:    cargo_asan test  --test growable_array stress_concurrent
Test failed:    cargo_asan test  --test growable_array log_concurrent
Testing split_ordered_list.rs with cargo_asan...
Build failed!
Test failed:    cargo_asan test  --test split_ordered_list smoke
Test failed:    cargo_asan test  --test split_ordered_list stress_sequential
Test failed:    cargo_asan test  --test split_ordered_list stress_concurrent
Test failed:    cargo_asan test  --test split_ordered_list log_concurrent
3. Running ThreadSanitizer tests...
Testing growable_array.rs with cargo_tsan --release...
Build failed!
Test failed:    cargo_tsan test --release --test growable_array stress_concurrent
Test failed:    cargo_tsan test --release --test growable_array log_concurrent
Testing split_ordered_list.rs with cargo_tsan --release...
Build failed!
Test failed:    cargo_tsan test --release --test split_ordered_list stress_concurrent
Test failed:    cargo_tsan test --release --test split_ordered_list log_concurrent
Score: 60 / 180
@healwon healwon added the question Further information is requested label Dec 9, 2021
@tomtomjhj
Copy link
Member

Try

source scripts/grade-utils.sh
cargo_asan test --no-run

@healwon
Copy link
Author

healwon commented Dec 9, 2021

Thank you. Actually, I entirely forgot bash source.

I got this result:

$ cargo_asan test --no-run
   Compiling cs431-homework v0.1.0 (/home/s20180677/cs431/homework)
thread 'rustc' panicked at 'assertion failed: sentinel == STR_SENTINEL', /rustc/e6b883c74f49f32cb5d1cbad3457f2b8805a4a38/compiler/rustc_serialize/src/opaque.rs:669:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.59.0-nightly (e6b883c74 2021-12-08) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z sanitizer=address -C embed-bitcode=no -C debuginfo=2 -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `cs431-homework`
warning: build failed, waiting for other jobs to finish...
thread 'rustc' panicked at 'assertion failed: sentinel == STR_SENTINEL', /rustc/e6b883c74f49f32cb5d1cbad3457f2b8805a4a38/compiler/rustc_serialize/src/opaque.rs:669:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.59.0-nightly (e6b883c74 2021-12-08) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z sanitizer=address -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: build failed

So, it seems to be rustc bug.
It is reported in rust-lang/rust#91689, and it said this happens in the latest nightly.
Any way to downgrade?

@tomtomjhj
Copy link
Member

There are several ways to pin the rust version. https://rust-lang.github.io/rustup/overrides.html

I'll try to fix the grading script in a few hours

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

No branches or pull requests

3 participants