Skip to content

LTO Compilation failure with generic systems "exit code: 0xc0000005, STATUS_ACCESS_VIOLATION" #11446

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

Open
UsaidPro opened this issue Jan 21, 2024 · 2 comments
Labels
A-Build-System Related to build systems or continuous integration C-Bug An unexpected or incorrect behavior O-Windows Specific to the Windows desktop operating system P-Compile-Failure A failure to compile Bevy apps S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@UsaidPro
Copy link

UsaidPro commented Jan 21, 2024

Bevy version

0.12.1

Issue does not occur in 0.9.1

Relevant system information

If you cannot get Bevy to build or run on your machine, please include:

cargo --version: cargo 1.75.0 (1d8b05cdd 2023-11-20)
OS: Windows 10

What you did

When providing FPS metrics for this issue involving multithreaded executor running slowly for lots of systems (SystemA::<0>, SystemA::<1>, etc), I was told in the Discord to run my code with LTO for most-accurate metrics.

What went wrong

When enabling lto = true, cargo run --release fails with "exit code: 0xc0000005, STATUS_ACCESS_VIOLATION". This does not occur in Bevy version 0.9.1. I was able to do lto = true in 0.9.1 with no issues (was testing Scheduler V2 vs V3 for the related issue).

I believe the root cause is the generic systems.

Additional information

I have shared a stripped-down version of my generic systems code focusing on this issue in the lto_issue branch of my BevyLotsOfSystems Github package. The code is for Bevy 0.12.1, will publish separate branch with 0.9.1 working.

Need to compile in --release with how the Cargo.toml are set up.

EDIT: lto_issue_0.9.1 has the working 0.9.1 code with LTO enabled

@UsaidPro UsaidPro added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jan 21, 2024
@Kanabenki Kanabenki added A-Build-System Related to build systems or continuous integration P-Compile-Failure A failure to compile Bevy apps and removed S-Needs-Triage This issue needs to be labelled labels Jan 23, 2024
@BD103
Copy link
Member

BD103 commented Feb 1, 2024

I tried but was unable to reproduce this issue using the branch you specified with lto. (Rust 1.75.0, MacOS) It seems that STATUS_ACCESS_VIOLATION is a segfault on Windows. Did you get this error when running the actual binary or during the compilation process?

@james7132
Copy link
Member

Gentle ping again to check the status on this with Bevy 0.13.1.

Looking at the repo, it seems like dynamic linking was turned on, but also LTO was enabled. I'm not sure if that has something to do with it.

@janhohenheim janhohenheim added O-Windows Specific to the Windows desktop operating system S-Needs-Investigation This issue requires detective work to figure out what's going wrong labels Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration C-Bug An unexpected or incorrect behavior O-Windows Specific to the Windows desktop operating system P-Compile-Failure A failure to compile Bevy apps S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

5 participants