-
Notifications
You must be signed in to change notification settings - Fork 106
Bevy dynamic-linking makes the program crash #1530
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
Comments
I don't use Windows, so I'm not sure I will be able to figure out what is going wrong. In any case could you please post a backtrace of the segfault?
This panic happens when trying to spawn a new thread. The error is not really informative about which parameter of the thread spawn function is incorrect. |
I tried yesterday, but I'm not sure how to GDB a Rust dynamically linked program since it complains about I'll try later today. |
Well, I couldn't figure out a way to debug the builds, but apparently |
You need to add both the full path to the |
Is this still an issue? |
My apologies for disappearing- yes, it still happens. Forgive my ignorance, but I (still) have no idea how to debug with WinDBG, and all sources that I've found has no straight forward way to give a small gist for what we need (run a program, wait until crash, show backtrace). The minimum reproducible example is still up! |
Hi, after some thorough search using both Google and ChatGPT, I finally came up with some debugging information:
Relevant system information:
|
This is still occurring on Bevy 1.15.4. Is there anything else that can be done to help with a fix? |
Does this also occur with a version of cg_clif downloaded from https://github.com/rust-lang/rustc_codegen_cranelift/releases/tag/dev rather than from rustup? If not, there is a fair chance that this is an ABI compatibility issue between Cranelift and LLVM: #1525 |
|
While it could still be an ABI issue with respect to C, it is a lot less likely that this is the cause as C FFI tends to cause less issues and the crash here happens within rust code seemingly without any C code in between. I think I will need to get access to a Windows machine at some point and see if I can either poke around with lldb or if lldb doesn't work, learn windbg. Or maybe if this reproduces with mingw, I could enable DWARF debuginfo on mingw targets and poke around with gdb. (Currently there is exactly zero debuginfo support on Windows as PDB doesn't have any official documentation other than a header dump microsoft did a couple years back and even LLVM needed to reverse-engineer it) |
Minimal reproducible example: https://github.com/GlennFolker/cranedrop
The
dynamic_linking
feature flag, which converts bevy and std into a dylib for compile-time speedup, completely fails when using the Cranelift codegen backend.System information:
rustc 1.83.0-nightly (0609062a9 2024-09-13)
.~/.cargo/Config.toml
:cargo run
withmulti_threading
disabled made the program encounter a segfault:cargo run
withmulti_threading
enabled made the program panic:The text was updated successfully, but these errors were encountered: