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

dump more information when CONFIG_MM_DUMP_DETAILS_ON_FAILURE enabled, flush log before coredump #14094

Merged
merged 3 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions mm/mm_heap/mm_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,19 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
# endif
# ifdef CONFIG_MM_DUMP_DETAILS_ON_FAILURE
mm_memdump(heap, &dump);
mwarn("Dump leak memory(thread exit, but memory not free):\n");
dump.pid = PID_MM_LEAK;
mm_memdump(heap, &dump);
# ifdef CONFIG_MM_HEAP_MEMPOOL
mwarn("Dump block used by mempool expand/trunk:\n");
dump.pid = PID_MM_MEMPOOL;
mm_memdump(heap, &dump);
# endif
# if CONFIG_MM_BACKTRACE >= 0
mwarn("Dump allocated orphan nodes. (neighbor of free nodes):\n");
dump.pid = PID_MM_ORPHAN;
mm_memdump(heap, &dump);
# endif
# endif
#endif
#ifdef CONFIG_MM_PANIC_ON_FAILURE
Expand Down
7 changes: 6 additions & 1 deletion sched/misc/assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,12 @@ static void dump_fatal_info(FAR struct tcb_s *rtcb,

#if defined(CONFIG_BOARD_COREDUMP_SYSLOG) || \
defined(CONFIG_BOARD_COREDUMP_BLKDEV)
/* Dump core information */

/* Flush previous SYSLOG data before possible long time coredump */

syslog_flush();

/* Dump core information */

# ifdef CONFIG_BOARD_COREDUMP_FULL
coredump_dump(INVALID_PROCESS_ID);
Expand Down
Loading