Skip to content

mps2_an385: Multiple "MPU Fault"s, "Hardware Fault"s "Stack Check Fail!" and "Bus Fault" when running code coverage #15146

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

Closed
cinlyooi-intel opened this issue Apr 3, 2019 · 0 comments
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@cinlyooi-intel
Copy link
Contributor

cinlyooi-intel commented Apr 3, 2019

Describe the bug
We are seeing a lot of MPU Fault with mps2_an385 when attempting to get code coverage data

To Reproduce
Steps to reproduce the behavior:

# To generate the errors
scripts/sanitycheck --coverage 
   --coverage-platform mps2_an385 -p mps2_an385 
   --coverage-platform qemu_x86 -p qemu_x86 
   --coverage-platform qemu_x86_nommu  -p qemu_x86_nommu -
   -gcov-tool /opt/zephyr-sdk-0.10.0/i586-zephyr-elf/bin/i586-zephyr-elf-gcov \
   -T tests/kernel -T tests/subsys/logging | tee output.log

# Open all log files referenced to when something went wrong
# the majority of them will have this fault. For list of file see Section
# "Affected log files" later
grep sanity-out output.log/mps2_an385 | cut -d : -f 2 | xargs -I{} -t gedit {}

Impact
Low codecoverage percentage

Screenshots or console output
Examples:

***** MPU FAULT *****
  Data Access Violation
  MMFAR Address: 0x2001601c
***** Hardware exception *****
Current thread ID = 0x20014348
Faulting instruction address = 0x4822
Fatal fault in essential thread! Spinning...
***** MPU FAULT *****
  Stacking error (context area might be not valid)
  Data Access Violation
  MMFAR Address: 0x2001601c
***** Hardware exception *****
Current thread ID = 0x20014348
Faulting instruction address = 0x4822
Fatal fault in essential thread! Spinning...
***** MPU FAULT *****
  Stacking error (context area might be not valid)
  Data Access Violation
  MMFAR Address: 0x20020014
***** Stack Check Fail! *****
Current thread ID = 0x200142c4
Faulting instruction address = 0x0
***** MPU FAULT *****
  Stacking error (context area might be not valid)
  Data Access Violation
  MMFAR Address: 0x2001801c
***** Stack Check Fail! *****
Current thread ID = 0x20014c58
Faulting instruction address = 0x0
Fatal fault in thread 0x20014c58! Aborting.
ASSERTION FAIL [z_spin_lock_valid(l)] @ /home/cinlyooi/tests/zephyrproject/zephyr/include/spinlock.h:78
	Recursive spinlock
***** HARD FAULT *****
  Fault escalation (see below)
***** Hardware exception *****
Current thread ID = 0x20014c58
Faulting instruction address = 0x9092
Fatal fault in ISR! Spinning...

Environment (please complete the following information):

  • OS: fedora29
  • Toolchain zephyr
  • Commit SHA or Version used: 0734b4f

Affected log files
sanity-out/mps2_an385/

  1. tests/kernel/context/kernel.common/handler.log
  2. tests/kernel/arm_irq_vector_table/arch.interrupt/handler.log
  3. tests/kernel/critical/kernel.common/handler.log (Note1)
  4. tests/kernel/fifo/fifo_timeout/kernel.fifo.timeout.poll/handler.log
  5. tests/kernel/fifo/fifo_usage/kernel.fifo.usage.poll/handler.log
  6. tests/kernel/lifo/lifo_usage/kernel.lifo.usage/handler.log
  7. tests/kernel/mbox/mbox_api/kernel.mailbox/handler.log
  8. tests/kernel/fifo/fifo_timeout/kernel.fifo.timeout/handler.log
  9. tests/kernel/mem_pool/mem_pool_api/kernel.memory_pool/handler.log
  10. tests/kernel/mem_protect/stackprot/kernel.memory_protection/handler.log
  11. tests/kernel/mem_protect/syscalls/kernel.memory_protection.syscalls/handler.log (Note1)
  12. tests/kernel/mutex/mutex/kernel.mutex/handler.log
  13. tests/kernel/msgq/msgq_api/kernel.message_queue/handler.log
  14. tests/kernel/obj_tracing/kernel.object_tracing/handler.log
  15. tests/kernel/pending/kernel.common.timing/handler.log
  16. tests/kernel/pipe/pipe_api/kernel.pipe/handler.log
  17. tests/kernel/poll/kernel.poll/handler.log
  18. tests/kernel/profiling/profiling_api/kernel.profiling/handler.log
  19. tests/kernel/queue/kernel.queue.poll/handler.log
  20. tests/kernel/sched/preempt/kernel.sched.preempt/handler.log
  21. tests/kernel/semaphore/sema_api/kernel.semaphore/handler.log
  22. tests/kernel/semaphore/semaphore/kernel.semaphore/handler.log
  23. tests/kernel/sleep/kernel.common.timing/handler.log
  24. tests/kernel/stack/stack_api/kernel.stack/handler.log
  25. tests/kernel/stack/stack_usage/kernel.stack.usage/handler.log
  26. tests/kernel/threads/dynamic_thread/kernel.threads.dynamic/handler.log
  27. tests/kernel/sched/schedule_api/kernel.sched/handler.log
  28. tests/kernel/threads/thread_init/kernel.threads/handler.log
  29. tests/kernel/threads/thread_apis/kernel.threads/handler.log
  30. tests/kernel/workq/work_queue/kernel.workqueue.poll/handler.log
  31. tests/kernel/workq/work_queue/kernel.workqueue/handler.log
  32. tests/kernel/workq/work_queue_api/kernel.workqueue/handler.log

Note1: tests/kernel/mem_protect/syscalls/kernel.memory_protection.syscalls/handler.log has "Bus Fault" as well. See below

***** Booting Zephyr OS v1.14.0-rc3-76-g0734b4fcaaea *****
Running test suite syscalls
===================================================================
starting test - test_string_nlen
***** BUS FAULT *****
  Precise data bus error
  BFAR Address: 0xfffffff0
PASS - test_string_nlen
===================================================================
starting test - test_string_nlen
***** MPU FAULT *****
  Stacking error (context area might be not valid)
  Data Access Violation
  MMFAR Address: 0x20020000
***** Stack Check Fail! *****
Current thread ID = 0x200142f4
Faulting instruction address = 0x0
Fatal fault in thread 0x200142f4! Aborting.
@cinlyooi-intel cinlyooi-intel added the bug The issue is a bug, or the PR is fixing a bug label Apr 3, 2019
@cinlyooi-intel cinlyooi-intel changed the title mps2_an385: Multiple "MPU Fault"s, multiple "Hardware Fault"s and one "Bus Fault" when running code coverage mps2_an385: Multiple "MPU Fault"s, "Hardware Fault"s "Stack Check Fail!" and "Bus Fault" when running code coverage Apr 3, 2019
@nashif nashif closed this as completed Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

2 participants