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

osmesa-sys 0.1.2 ICE with nightly 2021-04-20 and newer and -Z instrument-coverage #84421

Closed
sdroege opened this issue Apr 22, 2021 · 6 comments · Fixed by #84456
Closed

osmesa-sys 0.1.2 ICE with nightly 2021-04-20 and newer and -Z instrument-coverage #84421

sdroege opened this issue Apr 22, 2021 · 6 comments · Fixed by #84456
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@sdroege
Copy link
Contributor

sdroege commented Apr 22, 2021

See below. Last nightly version that was known to work was 2021-04-19.

Note that it says below 1.53.0-nightly (6df26f897 2021-04-20) but this is the version that rustup installs as 2021-04-21! Similarly rustc 1.53.0-nightly (9d9c2c92b 2021-04-19) is the last known to work version but installed via rustup as 2021-04-20.

$ RUST_BACKTRACE=1 RUSTFLAGS="-Z instrument-coverage" cargo +nightly-2021-04-21 check
    Checking osmesa-sys v0.1.2 (/home/slomo/Projects/rust/tmp/osmesa-sys-0.1.2)
warning: use of deprecated macro `try`: use the `?` operator instead
  --> lib.rs:29:1
   |
29 | / shared_library!(OsMesa, LIB_NAME,
30 | |   pub fn OSMesaColorClamp (enable: c_uchar),
31 | |   pub fn OSMesaCreateContext (format: c_uint, sharelist: OSMesaContext) -> OSMesaContext,
32 | |   pub fn OSMesaCreateContextExt (format: c_uint, depthBits: c_int, stencilBits: c_int, accumBits: c_int, sharelist: OSMesaContext) -> OSM...
...  |
41 | |   pub fn OSMesaPixelStore (pname: c_int, value: c_int),
42 | | );
   | |__^
   |
   = note: `#[warn(deprecated)]` on by default
   = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated constant `std::sync::ONCE_INIT`: the `new` function is now preferred
  --> lib.rs:29:1
   |
29 | / shared_library!(OsMesa, LIB_NAME,
30 | |   pub fn OSMesaColorClamp (enable: c_uchar),
31 | |   pub fn OSMesaCreateContext (format: c_uint, sharelist: OSMesaContext) -> OSMesaContext,
32 | |   pub fn OSMesaCreateContextExt (format: c_uint, depthBits: c_int, stencilBits: c_int, accumBits: c_int, sharelist: OSMesaContext) -> OSM...
...  |
41 | |   pub fn OSMesaPixelStore (pname: c_int, value: c_int),
42 | | );
   | |__^
   |
   = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

warning: use of deprecated constant `std::sync::ONCE_INIT`: the `new` function is now preferred
  --> lib.rs:29:1
   |
29 | / shared_library!(OsMesa, LIB_NAME,
30 | |   pub fn OSMesaColorClamp (enable: c_uchar),
31 | |   pub fn OSMesaCreateContext (format: c_uint, sharelist: OSMesaContext) -> OSMesaContext,
32 | |   pub fn OSMesaCreateContextExt (format: c_uint, depthBits: c_int, stencilBits: c_int, accumBits: c_int, sharelist: OSMesaContext) -> OSM...
...  |
41 | |   pub fn OSMesaPixelStore (pname: c_int, value: c_int),
42 | | );
   | |__^
   |
   = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

thread 'rustc' panicked at 'assertion failed: self.start_pos.to_u32() + total_extra_bytes <= bpos.to_u32()', compiler/rustc_span/src/lib.rs:1511:9
stack backtrace:
   0: rust_begin_unwind
             at /rustc/6df26f897cffb2d86880544bb451c6b5f8509b2d/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/6df26f897cffb2d86880544bb451c6b5f8509b2d/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/6df26f897cffb2d86880544bb451c6b5f8509b2d/library/core/src/panicking.rs:50:5
   3: rustc_span::SourceFile::lookup_file_pos
   4: rustc_mir::transform::coverage::Instrumentor::inject_counters
   5: <rustc_mir::transform::coverage::InstrumentCoverage as rustc_mir::transform::MirPass>::run_pass
   6: rustc_mir::transform::run_passes
   7: rustc_mir::transform::mir_promoted
   8: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
   9: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  10: rustc_data_structures::stack::ensure_sufficient_stack
  11: rustc_query_system::query::plumbing::force_query_with_job
  12: rustc_query_system::query::plumbing::get_query_impl
  13: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_promoted
  14: rustc_mir::borrow_check::mir_borrowck
  15: core::ops::function::FnOnce::call_once
  16: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  17: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  18: rustc_data_structures::stack::ensure_sufficient_stack
  19: rustc_query_system::query::plumbing::force_query_with_job
  20: rustc_query_system::query::plumbing::get_query_impl
  21: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
  22: rustc_middle::ty::<impl rustc_middle::ty::context::TyCtxt>::par_body_owners
  23: rustc_interface::passes::analysis
  24: rustc_middle::dep_graph::<impl rustc_query_system::dep_graph::DepKind for rustc_middle::dep_graph::dep_node::DepKind>::with_deps
  25: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  26: rustc_data_structures::stack::ensure_sufficient_stack
  27: rustc_query_system::query::plumbing::force_query_with_job
  28: rustc_query_system::query::plumbing::get_query_impl
  29: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  30: rustc_interface::passes::QueryContext::enter
  31: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  32: rustc_span::with_source_map
  33: rustc_interface::interface::create_compiler_and_run
  34: 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.53.0-nightly (6df26f897 2021-04-20) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z instrument-coverage -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:
#0 [mir_promoted] processing `OSMesaColorClamp`
#1 [mir_borrowck] borrow-checking `OSMesaColorClamp`
#2 [analysis] running analysis passes on this crate
end of query stack
warning: 3 warnings emitted

error: could not compile `osmesa-sys`

To learn more, run the command again with --verbose.
@sdroege sdroege added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 22, 2021
@sdroege
Copy link
Contributor Author

sdroege commented Apr 22, 2021

cargo bisect-rustc points at the following:

searched nightlies: from nightly-2021-04-18 to nightly-2021-04-22
regressed nightly: nightly-2021-04-21
searched commits: from 9d9c2c9 to 6df26f8
regressed commit: 6af1e63

gstreamer-github pushed a commit to sdroege/gstreamer-rs that referenced this issue Apr 22, 2021
It's using the nightly compiler and can easily break every now and then,
like it does now with rust-lang/rust#84421 .
gstreamer-github pushed a commit to sdroege/gst-plugin-rs that referenced this issue Apr 22, 2021
It's using the nightly compiler and can easily break every now and then,
like it does now with rust-lang/rust#84421 .
@jonas-schievink jonas-schievink added the A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) label Apr 22, 2021
@richkadel
Copy link
Contributor

Because it was a small change, I have a guess about what I may need to check, but it would help to have an MCVE. I can't tell what code you're compiling that caused this.

Can you provide a small example I can build locally?

Thanks!

cc: @tmandry @wesleywiser

@richkadel
Copy link
Contributor

By the way, where is the source for https://crates.io/crates/osmesa-sys ? It looks like it is gone from github. I tried building osmesa-rs, on the off chance that it might cause the same ICE with -Zinstrument-coverage, but it built without issues.

@rajivshah3
Copy link

rajivshah3 commented Apr 22, 2021

We're having the same issue, if this helps: https://github.com/iotaledger/wallet.rs/runs/2412321445#step:9:634. I'll see if I can get a minimal example

@sdroege
Copy link
Contributor Author

sdroege commented Apr 22, 2021

@richkadel I don't have a minimal example, had no time to dig through the osmesa-sys code yet to understand the problem.

But you can easily reproduce it via

$ wget https://crates.io/api/v1/crates/osmesa-sys/0.1.2/download
$ tar xf download
$ cd osmesa-sys-0.1.2
$ RUSTFLAGS="-Z instrument-coverage" cargo check

@richkadel
Copy link
Contributor

Ah! Thanks for providing the link to the source. I wasn't sure how to get it without access to the repo.

Yes I can reproduce this. Looking into it now. Thanks!

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Apr 23, 2021
Fix ICE if original_span(fn_sig) returns a span not in body sourcefile

Fixes: rust-lang#84421

r? `@tmandry`

fyi: `@wesleywiser` `@sdroege` `@rajivshah3`
gstreamer-github pushed a commit to sdroege/gstreamer-rs that referenced this issue Apr 23, 2021
We just want to build and run the tests to generate the coverage
reports.

Workaround for rust-lang/rust#84421
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Apr 23, 2021
Fix ICE if original_span(fn_sig) returns a span not in body sourcefile

Fixes: rust-lang#84421

r? ``@tmandry``

fyi: ``@wesleywiser`` ``@sdroege`` ``@rajivshah3``
JohnTitor added a commit to JohnTitor/rust that referenced this issue Apr 23, 2021
Fix ICE if original_span(fn_sig) returns a span not in body sourcefile

Fixes: rust-lang#84421

r? ```@tmandry```

fyi: ```@wesleywiser``` ```@sdroege``` ```@rajivshah3```
JohnTitor added a commit to JohnTitor/rust that referenced this issue Apr 23, 2021
Fix ICE if original_span(fn_sig) returns a span not in body sourcefile

Fixes: rust-lang#84421

r? ````@tmandry````

fyi: ````@wesleywiser```` ````@sdroege```` ````@rajivshah3````
@bors bors closed this as completed in a07bf2e Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants