Comments (5)
Hey @drewcrawford! The Window
is getting disposed when OnLaunched
returns, which is a bit awkward for WinUI.
Stash the main window instance in the App structure (that's why that field is there). There's a sample here as well: https://github.com/microsoft/windows-samples-rs/blob/master/windows_app_sdk/simple_window/src/main.rs#L59
from windows-app-rs.
I appreciate that workaround! However, this is a soundness issue. STATUS_ACCESS_VIOLATION is a memory violation, which isn't expected in safe rust. Assuming that's not a winui bug, it implies the rust projection ought to be marked unsafe
.
For the rust side, see https://github.com/microsoft/windows-rs/blob/bf9da585055128b423473aae5e36df7bd5c91019/.github/safety.md#safety
For the winui side, it seems a bit awkward that an API like Window::new
would be unsafe. Rust developers have a tendency to make wrappers for these cases, I'm a little uncertain whether that's in-scope here or more of a third-party crate.
from windows-app-rs.
In general, the xaml api will call C's abort function when used incorrectly in order to produce a Watson dump. This is considered safe on Windows because the process is immediately suspended and then terminated to prevent curruption.
from windows-app-rs.
Wouldn’t abort raise SIGABRT? Here we have access_violation, which I assume is some different signal (SIGSEGV presumably)
It’s a bit surprising that C abort could present like this crash, although maybe that is just how windows implements it?
from windows-app-rs.
I'm not a debugging expert but I think it depends on whether the abort was explicit or implicit. On Windows at least, you can abort explicitly via terminate/abort functions or implicitly by dereferencing a null pointer. The result is the same - suspension, dump, termination. This is a long-standing practice in COM code particularly and provides reliable crash dump information.
from windows-app-rs.
Related Issues (18)
- Message box not themed HOT 2
- XAML markup support HOT 2
- Append to CommandBar.PrimaryCommands HOT 4
- Xaml::Controls::MenuBar crashes HOT 9
- windows_app_sdk `STATUS_STACK_BUFFER_OVERRUN` HOT 3
- the second sample in your readme produces an error HOT 9
- Feature "UI_Xaml" doesn't compile with windows-rs 0.29-git HOT 3
- Unidiomatic use of `Result::and_then` in README
- Can't use `implement` macro for `Application` HOT 3
- Where do the winmd files come from? (besides the generated one) HOT 4
- Cross compilation from Linux? HOT 5
- Error 0xc0000409 occurs in updated crate (Win App SDK 1.1) during bootstrap if .exe does not have a manifest HOT 1
- Error despite success HOT 1
- WinUI 3 support HOT 1
- Wondering why some controls work in xamlapp sample and some do not HOT 12
- Roadmap HOT 1
- Add an example HOT 3
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 windows-app-rs.