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

gdb complains about loadable section outside of ELF segments #9300

Open
bjorn3 opened this issue Sep 24, 2024 · 1 comment
Open

gdb complains about loadable section outside of ELF segments #9300

bjorn3 opened this issue Sep 24, 2024 · 1 comment
Labels
bug Incorrect behavior in the current implementation that needs fixing

Comments

@bjorn3
Copy link
Contributor

bjorn3 commented Sep 24, 2024

Test Case

Any wasm module.

Steps to Reproduce

  • wasmtime run -Ddebug-info=y /path/to/wasm
  • gdb -p $(pidof wasmtime)

Expected Results

Gdb doesn't emit any warnings.

Actual Results

Gdb emits the following warnings:

warning: Loadable section ".wasmtime.engine" outside of ELF segments
  in <in-memory@0x7f21a5259010>
warning: Loadable section ".wasmtime.bti" outside of ELF segments
  in <in-memory@0x7f21a5259010>
warning: Loadable section ".eh_frame" outside of ELF segments
  in <in-memory@0x7f21a5259010>
warning: Loadable section ".wasmtime.addrmap" outside of ELF segments
  in <in-memory@0x7f21a5259010>
warning: Loadable section ".wasmtime.traps" outside of ELF segments
  in <in-memory@0x7f21a5259010>
warning: Loadable section ".rodata.wasm" outside of ELF segments
  in <in-memory@0x7f21a5259010>
warning: Loadable section ".name.wasm" outside of ELF segments
  in <in-memory@0x7f21a5259010>
warning: Loadable section ".wasmtime.info" outside of ELF segments
  in <in-memory@0x7f21a5259010>

Versions and Environment

Wasmtime version or commit: v25.0.0

Operating system: Linux

Architecture: x86_64

Extra Info

This can probably be fixed by either clearing the loadable flag of all these sections or adding them to actual segments in case they are meant to be used at runtime like in the case of .eh_frame and .rodata.wasm.

@bjorn3 bjorn3 added the bug Incorrect behavior in the current implementation that needs fixing label Sep 24, 2024
@alexcrichton
Copy link
Member

I suspect the fix is that in this file our usage of SectionKind::ReadOnlyData is probably all wrong and it may want to be something like SectionKind::Metadata or similar. Wasmtime doesn't use these flags at all so the choice of kind here is basically arbitrary from Wasmtime's perspective, but it'd be great to remove these warnings and get a "more correct" elf file too! Would you be able to test out SectionKind::Metadata and see if gdb still emits these warnings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect behavior in the current implementation that needs fixing
Projects
None yet
Development

No branches or pull requests

2 participants