zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.61k stars 6.5k forks source link

Core dump issue while enabling CONFIG_ASSERT=y #74053

Closed Jayakumar-bot closed 1 month ago

Jayakumar-bot commented 3 months ago

Crash dump data is corrupted after enabling the ASSERT project configuration.

Describe the bug After adding CONFIG_ASSERT this config i am not able to get the proper back trace using the Zephyr logging mechanism.

CONFIG_ASSERT=y

CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_COREDUMP_DEVICE=y CONFIG_DEBUG_COREDUMP=y CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=y

CONFIG_LOG_BACKEND_UART=y CONFIG_DLT_UART_OUTPUT=y

To Reproduce Steps to reproduce the behavior:

  1. Modified the project configuration
  2. Create a crash(division by zero, with 5 function calls for checking the back trace/ call stack)
  3. Collect the core dump using UART from logging module.
  4. Run the script coredump_serial_log_parser.py, coredump_gdbserver.py.
  5. target remote localhost:1234.
  6. bt

Expected behavior Full call stack should be available. Impact Call stack is very min(only two function trace even though the crashing functions call stack depth is 5).

Logs and console output Backtrace stopped: Cannot access memory at address 0x200080c4 (gdb)

Environment (please complete the following information):

github-actions[bot] commented 3 months ago

Hi @Jayakumar-bot! We appreciate you submitting your first issue for our open-source project. 🌟

Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙

mrkhldn commented 3 months ago

Is this on ARM Cortex-M7? I have seen a similar issue there and have submitted a PR with a fix here - https://github.com/zephyrproject-rtos/zephyr/pull/73189

Jayakumar-bot commented 3 months ago

Hi @mrkhldn i am using ARM cortex m4 based MCU.I was able to collect the back trace successfully when there is no CPP involved. After adding CONFIG_CPP=y in the project conf only i am facing this issue. Anyway i will try to test your fix on that and let you know the result.

github-actions[bot] commented 1 month ago

This issue has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this issue will automatically be closed in 14 days. Note, that you can always re-open a closed issue at any time.