|
|
Subscribe / Log in / New account

Adding package information to ELF objects

Adding package information to ELF objects

Posted Nov 3, 2021 3:38 UTC (Wed) by wtarreau (subscriber, #51152)
Parent article: Adding package information to ELF objects

What I've always really be missing in core dumps as a developer would be the few sections from the executable that are not being dumped, i.e. basically include .text, .rodata and so on so that we could have full-blown core dumps that do not require to have the exact executable, and so that the core is self-contained. It's always a pain for users to reliably collect executable and core and feed them to developers. Sometimes even in good faith they think they're bringing the correct executable while the file was replaced on the file-system due to an upgrade, but not restarted, so they do not match. And for developers it requires to properly store them when dealing with multiple reports. Quite frankly the size of an extra .text section is nothing compared to a full memory dump!


to post comments

Adding package information to ELF objects

Posted Nov 3, 2021 14:16 UTC (Wed) by madscientist (subscriber, #16861) [Link]

There are sections of the executable that are never loaded into memory, and so cannot appear in a coredump (unless the coredumper were to go read them off of disk). Without those sections it's not really feasible to debug cores except in the most dire of situations. So, I just dumping all of memory will not be sufficient to debug a core without needing any other files.

In any event, the problem you discuss is already somewhat solved via the build ID feature which most everyone implements these days: core files now contain unique IDs for the binary and all shared libraries they loaded at runtime. While you still have to go find them (using debuginfod or similar) at least you are 100% confident whether you have the right ones or not.

Adding package information to ELF objects

Posted Nov 4, 2021 9:23 UTC (Thu) by jezz (subscriber, #59547) [Link] (2 responses)

You can control which sections are dumped. See "Controlling which mappings are written to the core dump" of core(5):

echo 0xF > /proc/self/coredump_filter

Adding package information to ELF objects

Posted Nov 4, 2021 15:32 UTC (Thu) by wtarreau (subscriber, #51152) [Link]

I already found that one but didn't get the impression it would serve my purpose. But reading it again with that hint in mind, it possibly could. If so that would be awesome! I'm going to try right now!

Adding package information to ELF objects

Posted Nov 4, 2021 15:37 UTC (Thu) by wtarreau (subscriber, #51152) [Link]

Just tested, it adds a substantial number of sections but not the .text ones. But that gives me an entry point about what to look for in the code however, as .text is just an executable shared mapping and maybe it's explicitly disabled and could be re-enabled. That would then allow to get the executable and all the loaded libs at once without the hassle of trying to open in the exact same environment to figure the condition.

Thanks for your hint!


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds