Skip to content

ICE: found unstable fingerprints for has_global_allocator(): false #84252

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
Spaceface16518 opened this issue Apr 16, 2021 · 0 comments · Fixed by #84260
Closed

ICE: found unstable fingerprints for has_global_allocator(): false #84252

Spaceface16518 opened this issue Apr 16, 2021 · 0 comments · Fixed by #84260
Assignees
Labels
A-incr-comp Area: Incremental compilation 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

@Spaceface16518
Copy link

I just found this randomly in a GitHub Actions Workflow run, so I have no idea what could've caused it or if there's already an issue for this.

Code

I'm not sure if this is the relevant code but it's the only code that addresses a global allocator.

#[cfg(feature = "wee_alloc")]
#[global_allocator]                                                               
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;    

Permalink to source

My best guess is that the #[cfg] doesn't apply to the attribute #[global_allocator], but just to the static variable it is qualifying. This means my code is not correct (I should have used #[cfg_attr(feature = "wee_alloc")] as a guard), so I'd expect this to cause a compiler error considering #[global_allocator] isn't really attached to anything. However, this ICEd the compiler, which was unexpected.

Meta

rustc --version --verbose:

rustc 1.52.0-beta.3 (215738137 2021-04-06) running on x86_64-unknown-linux-gnu

(I hard-wrapped the following lines for readability)

compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type lib
--crate-type cdylib --crate-type staticlib
Running rustc --crate-name image_go_nord --edition=2018 src/lib.rs
--error-format=json --json=diagnostic-rendered-ansi --crate-type lib
--crate-type cdylib --crate-type staticlib --emit=dep-info,link
-C embed-bitcode=no -C debuginfo=2 --cfg 'feature="wasm-bindgen"'
-C metadata=c4fb212b5fef003f
--out-dir /home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps
--target wasm32-unknown-unknown
-C incremental=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/incremental
-L dependency=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps
-L dependency=/home/runner/work/ImageGoNord/ImageGoNord/target/debug/deps
--extern image=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps/libimage-ba9f74439a39eca4.rlib
--extern itertools=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps/libitertools-6d102d89246fb9d6.rlib
--extern num_traits=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps/libnum_traits-818b35f1d60294e4.rlib
--extern smallvec=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps/libsmallvec-e05fe29dfd99833d.rlib
--extern wasm_bindgen=/home/runner/work/ImageGoNord/ImageGoNord/target/wasm32-unknown-unknown/debug/deps/libwasm_bindgen-ff7d9e442d05e58f.rlib`

Error output

Note: image_go_nord is my crate name.

Error: thread 'rustc' panicked at 'found unstable fingerprints for has_global_allocator(image_go_nord[2695]): false', /rustc/215738137bcbef2c3637a5bd290ef612cffe6ba5/compiler/rustc_query_system/src/query/plumbing.rs:593:5
Backtrace

I will post the backtrace when I configure it, but here is the "query stack" for now.

query stack during panic:
#0 [has_global_allocator] checking if the crate has_global_allocator
end of query stack

The action run is publicly availble. If not,
I have attached the relevent log file.

@Spaceface16518 Spaceface16518 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 16, 2021
@jonas-schievink jonas-schievink added the A-incr-comp Area: Incremental compilation label Apr 16, 2021
@Aaron1011 Aaron1011 self-assigned this Apr 16, 2021
bors added a commit to rust-lang-ci/rust that referenced this issue Apr 17, 2021
…=cjgillot

Mark `has_global_allocator` query as `eval_always`

Fixes rust-lang#84252

This query reads from untracked global state in `CStore`.
@bors bors closed this as completed in 169a221 Apr 17, 2021
Spaceface16518 added a commit to Spaceface16518/ImageGoNord that referenced this issue Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation 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.

3 participants