Comments (16)
I've uploaded jk/fix-ice
which I think should address this bug.
Can you try changing your Dioxus dependency to
dioxus = { git = "https://github.com/DioxusLabs/dioxus", branch = "jk/fix-ice", features = [ "desktop"] }
This should remove the generics around AsRef
- it makes the NodeFactory API slightly more cumbersome but I think should fix this issue.
from dioxus.
Closing this issue because we no longer cause an ICE, but looking at the other win issues.
from dioxus.
Hmm.... that's not good. I don't have a windows box but my version running on macOS checks just fine. Can you try checking the expansion too? I could release a patch that works around this bug, since given your stack trace I think I know where the ICE is coming from.
fn app(cx: Scope) -> Element {
cx.render(LazyNodes::new_some(move |__cx: NodeFactory| -> VNode {
use dioxus_elements::{GlobalAttributes, SvgAttributes};
__cx.element(
dioxus_elements::div,
[],
[],
[__cx.text(format_args!("Hello, world!"))],
None,
)
}))
}
from dioxus.
I get the same result with the expanded code:
thread 'rustc' panicked at 'assertion failed: !value.has_escaping_bound_vars()', /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\compiler\rustc_middle\src\ty\sty.rs:974: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.57.0 (f1edd0429 2021-11-29) 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
from dioxus.
Can you try cargo clean
then cargo build
?
Edit: I have been able to replicate the bug compiling from scratch. Disregard the previous suggestion.
from dioxus.
For what it's worth, any code that has a dependency on dioxus seems to yield the same error, even with my main code being fn main(){}
.
Something inside dioxus is causing the rust compiler to panic.
from dioxus.
@jkelleyrtp I'm trying (and failing) to create a minimally reproducible example for the rust compiler team. I see that the generics around AsRef seem to be the issue, so I'll check if that's in the known internal compiler errors repository.
from dioxus.
The core
crate is pretty small, so maybe just comment out module by module until the culprit is found. I've trying to spin up a windows vm.
The LazyNodes
module dances around sized/unsized types, try checking there? By getting rid of AsRef, I was able to shrink the error, so it might be in a handful of places.
from dioxus.
Looks like the bug is in LazyNodes. I use the same logic from https://docs.rs/stack_dst/latest/stack_dst/ - maybe they also cause an ICE. Found a simply workaround/fix, going to publish it. @anderslanglands @Patrick-Poitras
from dioxus.
I found a minimal example, it features the stuff from nodes and lazynodes.
use std::mem;
use std::marker::PhantomData;
struct LazyStack {}
impl Drop for LazyStack {
fn drop(&mut self) {
let g: *mut dyn FnMut(Option<NodeFactory<'_>>) -> Option<VNode<'_>> =
unsafe {make_fat_ptr()};
let clos = (unsafe { &mut *g });
clos(None);
}
}
unsafe fn make_fat_ptr<T: ?Sized>() -> *mut T {
mem::MaybeUninit::<*mut T>::uninit().assume_init()
}
enum VNode<'src> {
Fragment(&'src [VNode<'src>]),
}
struct NodeFactory<'a> {
x : &'a PhantomData<u32>,
}
I don't know what simplified into mem::MaybeUninit::<*mut T>::uninit().assume_init()
, but someone might want to have a look at that, it seems to me like that's a potential issue.
from dioxus.
The current version of Dioxus runs in my windows VM and has been pushed. Very interesting it triggered the ICE.
@Patrick-Poitras That's a pretty crazy set of incantations...
from dioxus.
@jkelleyrtp the `jk/fix-ice' branch does indeed fix the ICE but running the example gives me:
thread 'main' panicked at 'not implemented: path index.html/', C:\Users\ander\.cargo\git\checkouts\dioxus-1e619ce595d3799d\4ea5c99\packages\desktop\src\lib.rs:347:26
stack backtrace:
0: std::panicking::begin_panic_handler
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\/library\std\src\panicking.rs:517
1: core::panicking::panic_fmt
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\/library\core\src\panicking.rs:100
2: dioxus_desktop::impl$0::new_window::closure$1
at C:\Users\ander\.cargo\git\checkouts\dioxus-1e619ce595d3799d\4ea5c99\packages\desktop\src\lib.rs:347
3: alloc::boxed::impl$46::call<tuple$<ref$<wry::shared::http::request::Request> >,dyn$<core::ops::function::Fn<tuple$<ref$<wry::shared::http::request::Request> >,assoc$<Output,enum$<core::result::Result<wry::shared::http::response::Response,enum$<wry::Error>
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\alloc\src\boxed.rs:1705
4: wry::webview::webview2::impl$0::new::closure$0::closure$0::closure$4
at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\wry-0.12.2\src\webview\webview2\mod.rs:232
5: webview2::impl$4::add_web_resource_requested::closure$0<wry::webview::webview2::impl$0::new::closure$0::closure$0::closure$4>
at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\webview2-0.1.4\src\lib.rs:1023
6: alloc::boxed::impl$46::call<tuple$<ptr_mut$<ptr_mut$<webview2_sys::ICoreWebView2VTable> >,ptr_mut$<ptr_mut$<webview2_sys::ICoreWebView2WebResourceRequestedEventArgsVTable> > >,dyn$<core::ops::function::Fn<tuple$<ptr_mut$<ptr_mut$<webview2_sys::ICoreWebVie
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\alloc\src\boxed.rs:1705
7: webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0
at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\webview2-0.1.4\src\lib.rs:96
8: core::ops::function::FnOnce::call_once<webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0,tuple$<> >
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\core\src\ops\function.rs:227
9: core::panic::unwind_safe::impl$23::call_once<i32,webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0>
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\core\src\panic\unwind_safe.rs:271
10: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0>,i32>
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\std\src\panicking.rs:403
11: std::panicking::begin_panic::impl$1::take_box<str>
12: std::panicking::try<i32,core::panic::unwind_safe::AssertUnwindSafe<webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0> >
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\std\src\panicking.rs:367
13: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0>,i32>
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\std\src\panic.rs:133
14: webview2::impl$4::add_web_resource_requested::impl$0::invoke
at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\webview2-0.1.4\src\lib.rs:95
15: webview2_sys::impl$329::vtable::icorewebview2webresourcerequestedeventhandler_invoke<webview2::impl$4::add_web_resource_requested::Impl,com::offset::Zero>
at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\webview2-sys-0.1.1\src\lib.rs:3178
16: CreateWebViewEnvironmentWithOptionsInternal
17: CreateWebViewEnvironmentWithOptionsInternal
18: CreateWebViewEnvironmentWithOptionsInternal
19: CreateWebViewEnvironmentWithOptionsInternal
20: DllCanUnloadNow
21: CreateWebViewEnvironmentWithOptionsInternal
22: DllCanUnloadNow
23: DllCanUnloadNow
24: DllCanUnloadNow
25: DllCanUnloadNow
26: DllCanUnloadNow
27: DllCanUnloadNow
28: DllCanUnloadNow
29: DllCanUnloadNow
30: DllCanUnloadNow
31: DllCanUnloadNow
32: DllCanUnloadNow
33: Ordinal0
34: DllCanUnloadNow
35: CallWindowProcW
36: DispatchMessageW
37: tao::platform_impl::platform::event_loop::EventLoop<enum$<dioxus_desktop::UserWindowEvent> >::run_return<enum$<dioxus_desktop::UserWindowEvent>,dioxus_desktop::launch_with_props::closure$0>
at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\tao-0.5.2\src\platform_impl\windows\event_loop.rs:248
38: tao::platform_impl::platform::event_loop::EventLoop<enum$<dioxus_desktop::UserWindowEvent> >::run<enum$<dioxus_desktop::UserWindowEvent>,dioxus_desktop::launch_with_props::closure$0>
at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\tao-0.5.2\src\platform_impl\windows\event_loop.rs:203
39: tao::event_loop::EventLoop<enum$<dioxus_desktop::UserWindowEvent> >::run<enum$<dioxus_desktop::UserWindowEvent>,dioxus_desktop::launch_with_props::closure$0>
at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\tao-0.5.2\src\event_loop.rs:151
40: dioxus_desktop::launch_with_props<tuple$<>,dioxus_desktop::launch::closure$0>
at C:\Users\ander\.cargo\git\checkouts\dioxus-1e619ce595d3799d\4ea5c99\packages\desktop\src\lib.rs:163
41: dioxus_desktop::launch
at C:\Users\ander\.cargo\git\checkouts\dioxus-1e619ce595d3799d\4ea5c99\packages\desktop\src\lib.rs:98
42: hello_dioxus::main
at .\src\main.rs:4
43: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\core\src\ops\function.rs:227
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
webview2: panic in callback function. Aborting because it's UB to unwind across FFI boundaries.
error: process didn't exit successfully: `target\debug\hello-dioxus.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
from dioxus.
@jkelleyrtp the `jk/fix-ice' branch does indeed fix the ICE but running the example gives me:
thread 'main' panicked at 'not implemented: path index.html/', C:\Users\ander\.cargo\git\checkouts\dioxus-1e619ce595d3799d\4ea5c99\packages\desktop\src\lib.rs:347:26 stack backtrace: 0: std::panicking::begin_panic_handler at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\/library\std\src\panicking.rs:517 1: core::panicking::panic_fmt at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\/library\core\src\panicking.rs:100 2: dioxus_desktop::impl$0::new_window::closure$1 at C:\Users\ander\.cargo\git\checkouts\dioxus-1e619ce595d3799d\4ea5c99\packages\desktop\src\lib.rs:347 3: alloc::boxed::impl$46::call<tuple$<ref$<wry::shared::http::request::Request> >,dyn$<core::ops::function::Fn<tuple$<ref$<wry::shared::http::request::Request> >,assoc$<Output,enum$<core::result::Result<wry::shared::http::response::Response,enum$<wry::Error> at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\alloc\src\boxed.rs:1705 4: wry::webview::webview2::impl$0::new::closure$0::closure$0::closure$4 at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\wry-0.12.2\src\webview\webview2\mod.rs:232 5: webview2::impl$4::add_web_resource_requested::closure$0<wry::webview::webview2::impl$0::new::closure$0::closure$0::closure$4> at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\webview2-0.1.4\src\lib.rs:1023 6: alloc::boxed::impl$46::call<tuple$<ptr_mut$<ptr_mut$<webview2_sys::ICoreWebView2VTable> >,ptr_mut$<ptr_mut$<webview2_sys::ICoreWebView2WebResourceRequestedEventArgsVTable> > >,dyn$<core::ops::function::Fn<tuple$<ptr_mut$<ptr_mut$<webview2_sys::ICoreWebVie at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\alloc\src\boxed.rs:1705 7: webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0 at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\webview2-0.1.4\src\lib.rs:96 8: core::ops::function::FnOnce::call_once<webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0,tuple$<> > at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\core\src\ops\function.rs:227 9: core::panic::unwind_safe::impl$23::call_once<i32,webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0> at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\core\src\panic\unwind_safe.rs:271 10: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0>,i32> at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\std\src\panicking.rs:403 11: std::panicking::begin_panic::impl$1::take_box<str> 12: std::panicking::try<i32,core::panic::unwind_safe::AssertUnwindSafe<webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0> > at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\std\src\panicking.rs:367 13: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<webview2::impl$4::add_web_resource_requested::impl$0::invoke::closure$0>,i32> at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\std\src\panic.rs:133 14: webview2::impl$4::add_web_resource_requested::impl$0::invoke at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\webview2-0.1.4\src\lib.rs:95 15: webview2_sys::impl$329::vtable::icorewebview2webresourcerequestedeventhandler_invoke<webview2::impl$4::add_web_resource_requested::Impl,com::offset::Zero> at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\webview2-sys-0.1.1\src\lib.rs:3178 16: CreateWebViewEnvironmentWithOptionsInternal 17: CreateWebViewEnvironmentWithOptionsInternal 18: CreateWebViewEnvironmentWithOptionsInternal 19: CreateWebViewEnvironmentWithOptionsInternal 20: DllCanUnloadNow 21: CreateWebViewEnvironmentWithOptionsInternal 22: DllCanUnloadNow 23: DllCanUnloadNow 24: DllCanUnloadNow 25: DllCanUnloadNow 26: DllCanUnloadNow 27: DllCanUnloadNow 28: DllCanUnloadNow 29: DllCanUnloadNow 30: DllCanUnloadNow 31: DllCanUnloadNow 32: DllCanUnloadNow 33: Ordinal0 34: DllCanUnloadNow 35: CallWindowProcW 36: DispatchMessageW 37: tao::platform_impl::platform::event_loop::EventLoop<enum$<dioxus_desktop::UserWindowEvent> >::run_return<enum$<dioxus_desktop::UserWindowEvent>,dioxus_desktop::launch_with_props::closure$0> at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\tao-0.5.2\src\platform_impl\windows\event_loop.rs:248 38: tao::platform_impl::platform::event_loop::EventLoop<enum$<dioxus_desktop::UserWindowEvent> >::run<enum$<dioxus_desktop::UserWindowEvent>,dioxus_desktop::launch_with_props::closure$0> at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\tao-0.5.2\src\platform_impl\windows\event_loop.rs:203 39: tao::event_loop::EventLoop<enum$<dioxus_desktop::UserWindowEvent> >::run<enum$<dioxus_desktop::UserWindowEvent>,dioxus_desktop::launch_with_props::closure$0> at C:\Users\ander\.cargo\registry\src\github.com-1ecc6299db9ec823\tao-0.5.2\src\event_loop.rs:151 40: dioxus_desktop::launch_with_props<tuple$<>,dioxus_desktop::launch::closure$0> at C:\Users\ander\.cargo\git\checkouts\dioxus-1e619ce595d3799d\4ea5c99\packages\desktop\src\lib.rs:163 41: dioxus_desktop::launch at C:\Users\ander\.cargo\git\checkouts\dioxus-1e619ce595d3799d\4ea5c99\packages\desktop\src\lib.rs:98 42: hello_dioxus::main at .\src\main.rs:4 43: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> > at /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c\library\core\src\ops\function.rs:227 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. webview2: panic in callback function. Aborting because it's UB to unwind across FFI boundaries. error: process didn't exit successfully: `target\debug\hello-dioxus.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
Looks like windows redirects the WebView when it loads. Try the jk/windows-desktop
branch - I merged this fix in with the ICE fix but this fix hasn't been published to crates yet.
Sorry... I don't use windows so I didn't know about either of these!
from dioxus.
@jkelleyrtp yep that works now! Only weird thing is that the "Hello, world!" text doesn't render until I move or resize the window.
from dioxus.
@jkelleyrtp yep that works now! Only weird thing is that the "Hello, world!" text doesn't render until I move or resize the window.
Strange - but at least I know where to look. The event loop on windows probably sleeps or doesn't call the "events cleared" message. I'm getting the same behavior so at least I can debug it now.
from dioxus.
We've put the ICE into the database over on the language side.
from dioxus.
Related Issues (20)
- Collect data about builds with dx and output it somewhere HOT 3
- dx fmt deletes comments HOT 5
- `ValueDroppedError when redrawing` in `dioxus-core-0.5.1/src/events.rs` HOT 2
- `cannot reclaim ElementId(384)` in `dioxus-core-0.5.1/src/arena.rs:57:32` when redrawing HOT 2
- Desktop: Error setting the App Icon
- [Desktop] Asset inclusion not working HOT 3
- `use_effect` not running when writing to signal asynchronously HOT 1
- dx new in existing multicrate workspace HOT 1
- `dx build --release` doesn't read the `[profile.release]` table from `Cargo.toml` (`strip` doesn't work) HOT 10
- Route order matters between url string and enum fields
- Add ability to configure "always on/pin to top" option for the Dioxus Desktop HOT 3
- Dynamic rendering unresponsive for if-else-expressions where expressions are Fragments
- Shorthand notation breaking rsx! macro with conditional rendering
- `rustflags` in `./cargo/config.toml` being ignored HOT 2
- use_callback should take a closure that accepts an argument HOT 1
- Call `.into()` automatically for the default value when deriving `Props`
- use of unstable library feature 'proc_macro_byte_character' HOT 1
- Dioxus CLI MSRV
- live reload doesn't work when just modifying the css file HOT 2
- Assigning a port number when using `dx serve --port [number]` on fullstack is not respected. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dioxus.