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

Handle bss sections that span multiple segments #1

Closed
pablogsal opened this issue Feb 16, 2023 · 3 comments · Fixed by #13
Closed

Handle bss sections that span multiple segments #1

pablogsal opened this issue Feb 16, 2023 · 3 comments · Fixed by #13
Labels
bug Something isn't working Critical

Comments

@pablogsal
Copy link
Member

pablogsal commented Feb 16, 2023

Is possible that the .bss section of a core file spans multiple segments. We currently handle this suboptimally as we create a virtual "segment" for the entire bss section when we pass it to the process manager. The problem with this is that when we need to copy the entire .bss section at once (or really anything that is not fully contained in a single segment) our memory copy machinery complains because is not prepared to work with a chunk of memory that spans multiple segments.

There are two possibilities here:

  • Fix the memory copy class to deal with multiple segments.
  • Change the process manager to receive a list of segments for the .bss section instead of a single one.
@pablogsal pablogsal added the bug Something isn't working label Feb 16, 2023
@godlygeek godlygeek changed the title Handle bss sections that spawn multiple segments Handle bss sections that span multiple segments Mar 2, 2023
@godlygeek
Copy link
Contributor

What platform does this happen on? I think I've written most of a fix for it, but I'm not gonna be super confident I've got it right until seeing it work with a core file that actually does have the BSS split into different segments.

@pablogsal
Copy link
Member Author

pablogsal commented Mar 17, 2023

What platform does this happen on? I think I've written most of a fix for it, but I'm not gonna be super confident I've got it right until seeing it work with a core file that actually does have the BSS split into different segments.

Not sure I recall the distro but may be one of the manylinux images that we use for wheels. Check there because there are plenty of stuff failing there and most of the failures are related to this if I recall correctly

@godlygeek
Copy link
Contributor

We were wrong about what was happening here. It wasn't that the BSS was spanning multiple segments, it's that we were incorrectly computing the offset for the BSS section, because we were assuming that the first segment for a module in the core file would be that module's first loadable segment, when in reality core files may elide read-only segments.

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

Successfully merging a pull request may close this issue.

2 participants