-
Notifications
You must be signed in to change notification settings - Fork 6
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
Release build is crashing on startup #8
Comments
I've add this .cargo/config.toml [target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
[profile.release]
codegen-units = 1
lto = true
opt-level = 0
debug = false
rpath = false
panic = 'unwind'
incremental = false
overflow-checks = true It crashes on anything but opt-level 0. |
I think it makes sense to leave optimizations at 0 for now. It's not like the code is huge or taking up a bunch of resources. |
Looks like some sort of mis-compilation issue, but I'd like to avoid disabling optimizations for release builds. I'm not too familiar with the flags you added to the cargo config, what are they for? |
Agreed. This issue is reproducible on main without any of the changes listed. I do see that the binary you'd released is 756kB in size whereas the one I am producing is 752kB. I wonder if there is anything in your environment? A .cargo folder? |
I've done a bit of debugging and I'm able to reproduce it. It seems like the |
Possibly hard for the compiler to see that count is anything other than 0 here? Because count is first transferred to count_ptr then transmuted? Could it be passed |
Not quite that, but the fact that the compiler gets very angry when you materialize references from thin air, you basically run into instant undefined behavior when you do that. I have a patch that fixes the issue, sadly |
The patch consists of replacing this transmute and this transmute with pointer casts. |
Would have been nice if the compiler said anything about it. It seems like working with the Windows APIs is filled with unsafe and UB. NWG last release is 4 years ago. I will consider port to Tauri but realistically IDK when I'll have time. |
I opened a PR to |
@nickbeth yay! BTW, what do you recommend for debug (in Windows)? Something like GDB, or VSCode or VS would be OK. |
I've used the CodeLLDB extension in VSCode without many issues, very easy to setup. I guess you need LLDB installed though? I had it already and it didn't complain. |
Fix confirmed! |
I was working on the MSI. It's working OK, but I've discovered that --release builds are crashing on startup, whether installed via MSI or not. Debug builds work fine both with and without the installer.
The text was updated successfully, but these errors were encountered: