Skip to content

LTO + >=O2 cripples panics #47965

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

Closed
MageSlayer opened this issue Feb 2, 2018 · 4 comments
Closed

LTO + >=O2 cripples panics #47965

MageSlayer opened this issue Feb 2, 2018 · 4 comments
Labels
C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@MageSlayer
Copy link

Hi

I am trying to investigate LTO issue.
It appears when I build my project with opt-level = 2 (or 3) and lto = true.
For some reason panics stop working, I mean __rust_maybe_catch_panic is triggered but never returns.

I am under Linux x64 rust compiler nightly-2017-12-07.
Unfortunately I cannot reproduce it in isolation or on any later compiler (due to other regressions).

Any help?

@MageSlayer
Copy link
Author

@alexcrichton
Alex, you might be the person to discuss as I found your comments on
#32900

@alexcrichton
Copy link
Member

Ah sorry there's not much information to go on here so I'm not sure what's happening :(

You may want to try specifying -Z thinlto=no via RUSTFLAGS if you can, as I think this was around the time that ThinLTO was enabled.

@MageSlayer
Copy link
Author

Nope, it does not help.
Looks like compiler somehow generates broken seh.
I can see in gdb that rust_eh_personality is called until some frame.

@kennytm kennytm added C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 2, 2018
@MageSlayer
Copy link
Author

Related to #48088
Adding #[unwind] to all extern functions fixed the issue with LTO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants