Repository navigation
Closed
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-windowsOperating system: WindowsOperating system: WindowsO-windows-msvcToolchain: MSVC, Operating system: WindowsToolchain: MSVC, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
Description
As title. Happens with both stable and nightly
Code
main.rs:
use dioxus::prelude::*;
fn main() {
dioxus::desktop::launch(App);
}
fn App(cx: Scope) -> Element {
cx.render(rsx! {
div { "Hello, world!"}
})
}Cargo.toml:
[package]
name = "hello-dioxus"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
dioxus = { version = "0.1.4", features = ["desktop"] }Meta
rustc --version --verbose:
rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: x86_64-pc-windows-msvc
release: 1.57.0
LLVM version: 13.0.0
rustc +nightly --version --verbose:
rustc 1.59.0-nightly (8f3238f89 2022-01-02)
binary: rustc
commit-hash: 8f3238f898163f09726c3d2b2cc9bafb09da26f3
commit-date: 2022-01-02
host: x86_64-pc-windows-msvc
release: 1.59.0-nightly
LLVM version: 13.0.0
Error output
thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /rustc/8f3238f898163f09726c3d2b2cc9bafb09da26f3\compiler\rustc_middle\src\ty\sty.rs:1036: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 (8f3238f89 2022-01-02) running on x86_64-pc-windows-msvc
note: compiler flags: -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 [is_sized_raw] computing whether `[nodes::VNode<'_>]` is `Sized`
#1 [layout_of] computing layout of `&[nodes::VNode<'_>]`
end of query stack
error: could not compile `dioxus-core`
warning: build failed, waiting for other jobs to finish...
error: build failed
Backtrace
thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /rustc/8f3238f898163f09726c3d2b2cc9bafb09da26f3\compiler\rustc_middle\src\ty\sty.rs:1036:9
stack backtrace:
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.59.0-nightly (8f3238f89 2022-01-02) running on x86_64-pc-windows-msvc
note: compiler flags: -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 [is_sized_raw] computing whether `[nodes::VNode<'_>]` is `Sized`
#1 [layout_of] computing layout of `&[nodes::VNode<'_>]`
#2 [layout_of] computing layout of `nodes::VFragment<'_>`
#3 [layout_of] computing layout of `nodes::VNode<'_>`
#4 [layout_of] computing layout of `core::option::Option<nodes::VNode<'_>>`
end of query stack
error: could not compile `dioxus-core`
warning: build failed, waiting for other jobs to finish...
error: build failed
Metadata
Metadata
Assignees
Labels
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)Area: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-windowsOperating system: WindowsOperating system: WindowsO-windows-msvcToolchain: MSVC, Operating system: WindowsToolchain: MSVC, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.ICE tracked in rust-lang/glacier.
Activity
Patrick-Poitras commentedon Jan 3, 2022
Can confirm bug is replicable with example above.
cbeust commentedon Jan 3, 2022
Confirmed on Windows 10 for me as well (
cargo buildis enough to produce the error).cbeust commentedon Jan 3, 2022
Including the error for completeness.
Patrick-Poitras commentedon Jan 3, 2022
Seems like they managed to get a patch out that fixes the issue.
With that information, I think this may be related to #89189.
Patrick-Poitras commentedon Jan 4, 2022
I have spent the last 2 hours whittling down the entire codebase that they had, in order to have a minimal example. It's fairly weird.
I'm not 100%, but I figure that
mem::MaybeUninit::<*mut T>::uninit().assume_init()isn't supposed to be like that. Either way, this reproduces the issue.Patrick-Poitras commentedon Jan 4, 2022
Can someone on Windows try this as well (build as lib), because I've tried to add this to glacier, but it seems to compile there, and it seems to also compile on Rust Playground. I'm a bit at a loss.
cbeust commentedon Jan 4, 2022
@Patrick-Poitras Can you be more specific? What do you want me (us) to try?
anderslanglands commentedon Jan 4, 2022
@Patrick-Poitras yep your example panics for me on Windows.
Patrick-Poitras commentedon Jan 4, 2022
@cbeust I'd like someone to try the minimal example that I've pasted above, since it doesn't compile on my machine (Windows), but it seems from the other issues thread (on dioxus) that it's a Windows-specific problem. When I've run it on linux machines, it seems to compile there.
Edit: @anderslanglands, thanks! I'll try to get a discussion going on Zulip as to what could cause this.
Alexendoo commentedon Jan 4, 2022
Doesn't ICE for windows -gnu targets, just -msvc
Alexendoo commentedon Jan 4, 2022
Seems to be debug info related, only ices with
-C debuginfo=1or-C debuginfo=2Patrick-Poitras commentedon Jan 4, 2022
I have further narrowed it down:
The key here is really in the small modifications that will make it work. I now think the bug occurs when it's trying to check if
Option<VNode<'_>>fits theT:?Sizedcondition. Theuninit().assume_init()bit seems to only be required to get something that is not type resolved once it leaves the function.Patrick-Poitras commentedon Jan 4, 2022
Here is what I've gathered so far:
Clue 1: The self-referential slice is important.
VNode<'src>can't be rewritten without the reference to the slice, asWill give the
the size for values of type `[VNode]` cannot be known at compilation timeerror.However, removing the slice compiles:
Clue 2: Not wrapping in an Option type compiles successfully.
If we change
Option<VNode<'_>>toVNode<'_>, then the code compiles.Less key bits
*mut dyn Fn(&'_ u32) -> Option<VNode<'_>>requires the&'_ u32argument to introduce the'_lifetime.Patrick-Poitras commentedon Jan 7, 2022
Bisect results:
Patrick-Poitras commentedon Jan 7, 2022
I think its #87153, it has a provision that changed the generation of MSVC-only debug information. I'm going to confirm manually.
Tagging @michaelwoerister, who might have some input on how to remedy this.
Alexendoo commentedon Mar 19, 2022
No longer ICEs since #95020
michaelwoerister commentedon Mar 21, 2022
Hi, sorry, this somehow slipped through the cracks. Yes, #95020 should be the proper fix here. The test case there should be pretty much equivalent to the one listed in #92537 (comment).