This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit badc31f291356fc6ca8471b4eb80029f8f169dda
Author: tengshuangshuang <[email protected]>
AuthorDate: Tue Jul 29 17:25:41 2025 +0800

    sched/coredump: read each memory region when printing it
    
    A wrong BOARD_MEMORY_RANGE makes the core dump fault halfway through,
    after part of the dump has been written.  When the regions are printed,
    also read the first and the last word of each region, so that a bad
    range faults right after its "Region[n]" line, before any dump data is
    written, and the log shows which range is wrong.
    
    Signed-off-by: tengshuangshuang <[email protected]>
---
 sched/misc/coredump.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sched/misc/coredump.c b/sched/misc/coredump.c
index 83d86b1ed81..90ac09ef18b 100644
--- a/sched/misc/coredump.c
+++ b/sched/misc/coredump.c
@@ -736,6 +736,8 @@ coredump_print_memory_regions(FAR const struct 
memory_region_s *regions)
     {
       _alert("Region[%d] start=0x%" PRIxPTR ", end=0x%" PRIxPTR "\n",
              i, regions[i].start, regions[i].end);
+      *(volatile int *)regions[i].start;
+      *(volatile int *)(regions[i].end - sizeof(int));
     }
 }
 #endif

Reply via email to