Skip to content

Heuristic to increase chances of resolvng the stack #31

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kromych
Copy link
Contributor

@kromych kromych commented Sep 19, 2024

As it stands, the code sorts the VA region by the start address. That is neither required nor beneficial besides the aesthetic appeal of the objdump output.

When the system is under stress and might OOM, or the program whose core dump is being captured might be terminated by some watchdog, it should be preferred to save the smaller regions of the VA space first as these are more likely to have the stack memory as opposed to the heap.

As for the OOM argument, if the memory being read was paged out, reading it brings it back from the swap file increasing the memory pressure and increasing the chances of OOM-ing the system as Linux overcommits by default. That said, saving the smaller VA regions first likely helps to captre more and likely the stack memory.

Sort the VA regioon by the size increasing to have better chances of capturing the stack memory before the program goes away.

For validation, captured core dump files of the large VS code server processes. the debuggers could open the dump file, and the stacks came in before the heap memory.

As it stands, the code sorts the VA region by the start address.
That is neither required nor beneficial besides the aesthetic appeal
of the `objdump` output.

When the system is under stress and might OOM, or the program
whose core dump is being captured might be terminated by some
watchdog, it should be preferred to save the smaller regions of the
VA space first as these are more likely to have the stack memory
as opposed to the heap.

As for the OOM argument, if the memory being read was paged
out, reading it brings it back from the swap file increasing the memory
pressure and increasing the chances of OOM-ing the system as
Linux overcommits by default. That said, saving the smaller VA
regions first likely helps to captre more and likely the stack memory.

Sort the VA regioon by the size increasing to have better chances of
capturing the stack memory before the program goes away.

For validation, captured core dump files of the large VS code server
processes. the debuggers could open the dump file, and the stacks
came in before the heap memory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant