Heuristic to increase chances of resolvng the stack #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.