Skip to content

Option::unwrap() on a None value #165

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

Closed
rnarubin opened this issue Jun 11, 2021 · 3 comments
Closed

Option::unwrap() on a None value #165

rnarubin opened this issue Jun 11, 2021 · 3 comments

Comments

@rnarubin
Copy link

I ran into a panic when building a crate with rustc's self-profiling:

thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/registry/src/github.com-1ecc6299db9ec823/measureme-9.1.0/src/stringtable.rs:105:62
stack backtrace:
   0: rust_begin_unwind
             at /rustc/8f349be27815d43d462a32faeb270a22a68486b6/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/8f349be27815d43d462a32faeb270a22a68486b6/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/8f349be27815d43d462a32faeb270a22a68486b6/library/core/src/panicking.rs:50:5
   3: measureme::stringtable::StringTableBuilder::alloc
   4: measureme::event_id::EventIdBuilder::from_label_and_arg
   5: rustc_data_structures::profiling::SelfProfilerRef::with_profiler
   6: rustc_query_impl::profiling_support::alloc_self_profile_query_strings
   7: rustc_interface::passes::QueryContext::enter
   8: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
   9: rustc_span::with_source_map
  10: rustc_interface::interface::create_compiler_and_run
  11: rustc_span::with_session_globals
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.52.0-nightly (8f349be27 2021-03-08) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z self-profile -Z self-profile-events=default,args -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

This doesn't appear related to #149 as the unwrap happens in totally different code

@bjorn3
Copy link
Member

bjorn3 commented Jun 11, 2021

Which crate did you compile? Based on the error location it seems like there was an overflow in calculating a StringId, which could be caused by too many strings in the profile I guess.

@rnarubin
Copy link
Author

It's a private crate so unfortunately I can't share it directly. I'm trying to narrow down a minimal reproduction now.

For what it's worth, there's definitely something anomalous in my code (or rustc's handling of it), because rustc is taking 14+ minutes to build it, while just a few changes ago it was about 40 seconds. That's why i was trying to profile in the first place! I'll try to narrow down a cause

@rylev
Copy link
Member

rylev commented Oct 8, 2021

@rnarubin I'm going to close this for now. Can you reopen if you found a reproducible case?

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

No branches or pull requests

3 participants