Skip to content
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

Dwarf Error: Cannot find DIE #119

Closed
robin-nitrokey opened this issue Nov 26, 2022 · 6 comments · Fixed by #340
Closed

Dwarf Error: Cannot find DIE #119

robin-nitrokey opened this issue Nov 26, 2022 · 6 comments · Fixed by #340
Labels
bug Something isn't working

Comments

@robin-nitrokey
Copy link
Member

Only occurs with FEATURES=alpha on the lpc55, probably caused by a compiler bug related to LTO. rust-lang/rust#66118 suggests that replacing fat LTO with thin LTO should fix this, but that causes a hardfault for me. Should be investigated and reported upstream.

Dwarf Error: Cannot find DIE at 0x53752 referenced from DIE at 0xae6b4

Related tickets:

@robin-nitrokey robin-nitrokey added the bug Something isn't working label Nov 26, 2022
@robin-nitrokey
Copy link
Member Author

It turns out that using thin LTO actually fixes this. The hardfault was caused by the stack overflow that we were debugging at the time. Still, it’s probably better to use fat LTO for firmware releases. As a short-term solution, we can just set lto = "thin" in Cargo.toml when debugging. In the long term, we probably should introduce different build profiles for development and releases. Maybe we can go back to using the debug profile per default and the release profile in the CI?

https://doc.rust-lang.org/cargo/reference/profiles.html#lto

@daringer
Copy link
Collaborator

Oh there is a ticket for that. @sosthene-nitrokey and I recently also stumbled across this, disabling lto fixes it.

Long-term I would also suggest that we disable this only for the develop build.
....and in the meantime lto should be switched of by-hand for debugging ?

@robin-nitrokey
Copy link
Member Author

We no longer have to use nightly, so we can close this for the time being.

@szszszsz
Copy link
Member

Just for the completeness: shows up as well for the NRF52, when lto = true is used during build, on a gdb debugging attempt.

@robin-nitrokey
Copy link
Member Author

Possible actions:

  • submit bug report to rust-lang/rust
  • setup a develop profile with thin lto and a release profile with fat lto

@szszszsz
Copy link
Member

szszszsz commented Jul 3, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants