Skip to content

os/mm/mm_heap: Dump previous to previous node in heap dump.#7147

Merged
sunghan-chang merged 1 commit intoSamsung:masterfrom
vivek1-j:prev_to_prev_node_dump
Feb 11, 2026
Merged

os/mm/mm_heap: Dump previous to previous node in heap dump.#7147
sunghan-chang merged 1 commit intoSamsung:masterfrom
vivek1-j:prev_to_prev_node_dump

Conversation

@vivek1-j
Copy link
Copy Markdown
Contributor

@vivek1-j vivek1-j commented Feb 6, 2026

When we get a stackoverflow, it could be a stackoverflow OR previous node could corrupt next node (stack). To know which one corrupts, we should check previous node of the previous node (stack). Now we are priting 3 nodes like:
prev to prev node > prev node > corrupted node in forward traversal.

Signed-Off By: Vivek Jain (vivek1.j@samsung.com)

@vivek1-j vivek1-j force-pushed the prev_to_prev_node_dump branch from 26ff49c to 586c874 Compare February 6, 2026 08:57
Copy link
Copy Markdown
Contributor

@sunghan-chang sunghan-chang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prev to prev node is necessary when the prev node is a stack.
Is it possible to show it with conditional?

@sunghan-chang
Copy link
Copy Markdown
Contributor

I think user could be confused with too many information.

@vivek1-j vivek1-j force-pushed the prev_to_prev_node_dump branch from 586c874 to 08cefcf Compare February 9, 2026 12:34
@vivek1-j
Copy link
Copy Markdown
Contributor Author

vivek1-j commented Feb 9, 2026

The prev to prev node is necessary when the prev node is a stack. Is it possible to show it with conditional?

I have added check.

@vivek1-j
Copy link
Copy Markdown
Contributor Author

vivek1-j commented Feb 9, 2026

I think user could be confused with too many information.

Added the dump in condition

Comment on lines +150 to +152
if (prev->pid < 0) { //-ve value means prev is stack allocated node, therefore we will print prev to prev node.
mm_dump_node(prevtoprev, "PREV TO PREV NODE");
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to add #ifdef CONFIG_DEBUG_MM_HEAPINFO

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, thankyou

start_corrupt = (uint32_t)prevtoprev + prevtoprev->size - MM_LAST_CORRUPT_SIZE;
}
} else if (prev->size <= MM_LAST_CORRUPT_SIZE) {
start_corrupt = (uint32_t)prevtoprev;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this right? start_corrupt = (uint32_t)prev;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks for catching that.

When we get a stackoverflow, it could be a stackoverflow OR previous node could corrupt next node (stack).
To know which one corrupts, we should check previous node of the previous node (stack).
Now we are priting 3 nodes like:
    prev to prev node > prev node > corrupted node in forward traversal.

Signed-Off By: Vivek Jain (vivek1.j@samsung.com)
@vivek1-j vivek1-j force-pushed the prev_to_prev_node_dump branch from 08cefcf to 2d9c3f9 Compare February 10, 2026 09:00
@sunghan-chang sunghan-chang merged commit c7fe2ec into Samsung:master Feb 11, 2026
17 checks passed
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.

4 participants