Skip to content

Nightly - -Zinstrument-coverage makes vendored openssl-sys cause a compiler panic #79725

Closed
@xylix

Description

@xylix

Code

Cargo.toml

[package]
name = "rust-nightly-05-12-repro"
version = "0.1.0"
authors = ["Kerkko Pelttari <kerk.pelt@gmail.com>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
openssl-sys = { version = "0.9.58", features = ["vendored"]}
RUSTFLAGS=-Zinstrument-coverage cargo test 

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (3ff10e74a 2020-12-04)
binary: rustc
commit-hash: 3ff10e74a74ed093fcabac1de27fe1cd65bbbb4a
commit-date: 2020-12-04
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

Error output

     Running `rustc --crate-name openssl_sys /home/xylix/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.58/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="openssl-src"' --cfg 'feature="vendored"' -C metadata=746b00652141f378 -C extra-filename=-746b00652141f378 --out-dir /home/xylix/Code/rust-nightly-05-12-repro/target/debug/deps -L dependency=/home/xylix/Code/rust-nightly-05-12-repro/target/debug/deps --extern libc=/home/xylix/Code/rust-nightly-05-12-repro/target/debug/deps/liblibc-e41c2d10207ee17e.rmeta --cap-lints allow -Zinstrument-coverage -L native=/home/xylix/Code/rust-nightly-05-12-repro/target/debug/build/openssl-sys-35bb66ffcf599d2f/out/openssl-build/install/lib --cfg const_fn --cfg 'osslconf="OPENSSL_NO_COMP"' --cfg 'osslconf="OPENSSL_NO_SSL3_METHOD"' --cfg ossl101 --cfg ossl102 --cfg ossl102f --cfg ossl102h --cfg ossl110 --cfg ossl110f --cfg ossl110g --cfg ossl110h --cfg ossl111 --cfg ossl111b --cfg ossl111c -l static=ssl -l static=crypto`
thread 'rustc' panicked at 'assertion failed: self.start_pos.to_u32() + total_extra_bytes <= bpos.to_u32()', compiler/rustc_span/src/lib.rs:1495: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.50.0-nightly (3ff10e74a 2020-12-04) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z instrument-coverage -C embed-bitcode=no -C debuginfo=2 --crate-type lib

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

query stack during panic:
#0 [mir_promoted] processing `err::ERR_PACK`
#1 [mir_borrowck] borrow-checking `err::ERR_PACK`
end of query stack
error: could not compile `openssl-sys`

Caused by:
  process didn't exit successfully: `rustc --crate-name openssl_sys /home/xylix/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.58/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="openssl-src"' --cfg 'feature="vendored"' -C metadata=746b00652141f378 -C extra-filename=-746b00652141f378 --out-dir /home/xylix/Code/rust-nightly-05-12-repro/target/debug/deps -L dependency=/home/xylix/Code/rust-nightly-05-12-repro/target/debug/deps --extern libc=/home/xylix/Code/rust-nightly-05-12-repro/target/debug/deps/liblibc-e41c2d10207ee17e.rmeta --cap-lints allow -Zinstrument-coverage -L native=/home/xylix/Code/rust-nightly-05-12-repro/target/debug/build/openssl-sys-35bb66ffcf599d2f/out/openssl-build/install/lib --cfg const_fn --cfg 'osslconf="OPENSSL_NO_COMP"' --cfg 'osslconf="OPENSSL_NO_SSL3_METHOD"' --cfg ossl101 --cfg ossl102 --cfg ossl102f --cfg ossl102h --cfg ossl110 --cfg ossl110f --cfg ossl110g --cfg ossl110h --cfg ossl111 --cfg ossl111b --cfg ossl111c -l static=ssl -l static=crypto` (exit code: 101)
Backtrace

 ~/C/rust-nightly-05-12-repro (master) [101]> RUST_BACKTRACE=1 RUSTFLAGS=-Zinstrument-coverage cargo build
   Compiling openssl-sys v0.9.58
thread 'rustc' panicked at 'assertion failed: self.start_pos.to_u32() + total_extra_bytes <= bpos.to_u32()', compiler/rustc_span/src/lib.rs:1495:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/3ff10e74a74ed093fcabac1de27fe1cd65bbbb4a/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/3ff10e74a74ed093fcabac1de27fe1cd65bbbb4a/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/3ff10e74a74ed093fcabac1de27fe1cd65bbbb4a/library/core/src/panicking.rs:50:5
   3: rustc_span::SourceFile::lookup_file_pos
   4: <rustc_mir::transform::coverage::InstrumentCoverage as rustc_mir::transform::MirPass>::run_pass
   5: rustc_mir::transform::run_passes
   6: rustc_mir::transform::mir_promoted
   7: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_promoted>::compute
   8: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
   9: rustc_query_system::query::plumbing::get_query_impl
  10: rustc_mir::borrow_check::mir_borrowck
  11: core::ops::function::FnOnce::call_once
  12: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck>::compute
  13: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  14: rustc_data_structures::stack::ensure_sufficient_stack
  15: rustc_query_system::query::plumbing::get_query_impl
  16: rustc_query_system::query::plumbing::ensure_query_impl
  17: rustc_session::utils::<impl rustc_session::session::Session>::time
  18: rustc_interface::passes::analysis
  19: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  20: rustc_query_system::dep_graph::graph::DepGraph<K>::with_eval_always_task
  21: rustc_data_structures::stack::ensure_sufficient_stack
  22: rustc_query_system::query::plumbing::get_query_impl
  23: rustc_interface::passes::QueryContext::enter
  24: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  25: rustc_span::with_source_map
  26: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.50.0-nightly (3ff10e74a 2020-12-04) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z instrument-coverage -C embed-bitcode=no -C debuginfo=2 --crate-type lib

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

query stack during panic:
#0 [mir_promoted] processing `err::ERR_PACK`
#1 [mir_borrowck] borrow-checking `err::ERR_PACK`
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `openssl-sys`

To learn more, run the command again with --verbose.
 ~/C/rust-nightly-05-12-repro (master) [101]>

Metadata

Metadata

Assignees

Labels

A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)C-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions