diff --git a/components/espcoredump/src/core_dump_elf.c b/components/espcoredump/src/core_dump_elf.c index be99de2496..183962908e 100644 --- a/components/espcoredump/src/core_dump_elf.c +++ b/components/espcoredump/src/core_dump_elf.c @@ -482,7 +482,7 @@ static int elf_write_tasks_data(core_dump_elf_t *self) #if CONFIG_ESP_COREDUMP_CAPTURE_DRAM /* Only crashed task data will be saved here. The other task's data will be automatically saved within the sections */ - if (esp_core_dump_get_current_task_handle() != task_iter.pxTaskHandle) + if (esp_core_dump_get_current_task_handle() == task_iter.pxTaskHandle) #endif { ret = elf_save_task(self, &task_hdr); diff --git a/tools/test_apps/system/panic/CMakeLists.txt b/tools/test_apps/system/panic/CMakeLists.txt index 5d922b1b13..e9db4327f5 100644 --- a/tools/test_apps/system/panic/CMakeLists.txt +++ b/tools/test_apps/system/panic/CMakeLists.txt @@ -17,7 +17,7 @@ if(CONFIG_TEST_MEMPROT) endif() endif() -if(NOT CONFIG_TEST_MEMPROT) +if(NOT CONFIG_TEST_MEMPROT AND NOT CONFIG_ESP_COREDUMP_CAPTURE_DRAM) # Enable UBSAN checks # # shift-base sanitizer is disabled due to the following pattern found in register header files: diff --git a/tools/test_apps/system/panic/pytest_panic.py b/tools/test_apps/system/panic/pytest_panic.py index e59ff117ea..8aac3af75d 100644 --- a/tools/test_apps/system/panic/pytest_panic.py +++ b/tools/test_apps/system/panic/pytest_panic.py @@ -957,10 +957,19 @@ def test_illegal_access(dut: PanicTestDut, config: str, test_func_name: str) -> @pytest.mark.generic def test_capture_dram(dut: PanicTestDut, config: str, test_func_name: str) -> None: dut.run_test_func(test_func_name) - + regex_pattern = rb'assert failed:[\s\w()]*?\s[.\w/]*\.(?:c|cpp|h|hpp):\d.*$' + dut.expect(re.compile(regex_pattern, re.MULTILINE)) + if dut.is_xtensa: + dut.expect_backtrace() + else: + dut.expect_stack_dump() dut.expect_elf_sha256() dut.expect_none(['Guru Meditation', 'Re-entered core dump']) + dut.expect_exact('Save core dump to flash...') + dut.expect_exact('Core dump has been saved to flash.') + dut.expect('Rebooting...') + core_elf_file = dut.process_coredump_flash() dut.start_gdb_for_coredump(core_elf_file) diff --git a/tools/test_apps/system/panic/sdkconfig.ci.coredump_flash_capture_dram b/tools/test_apps/system/panic/sdkconfig.ci.coredump_flash_capture_dram index 03f5a73805..d8e5231dc1 100644 --- a/tools/test_apps/system/panic/sdkconfig.ci.coredump_flash_capture_dram +++ b/tools/test_apps/system/panic/sdkconfig.ci.coredump_flash_capture_dram @@ -4,3 +4,4 @@ CONFIG_ESP_COREDUMP_CHECKSUM_SHA256=y CONFIG_ESP_COREDUMP_CAPTURE_DRAM=y CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_capture_dram.csv" +CONFIG_LOG_DEFAULT_LEVEL_INFO=y