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

tests/ztest/error_hook failed on ARC boards #31419

Closed
IRISZZW opened this issue Jan 19, 2021 · 1 comment · Fixed by #31773
Closed

tests/ztest/error_hook failed on ARC boards #31419

IRISZZW opened this issue Jan 19, 2021 · 1 comment · Fixed by #31773
Assignees
Labels
area: ARC ARC Architecture bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Milestone

Comments

@IRISZZW
Copy link
Contributor

IRISZZW commented Jan 19, 2021

Describe the bug
tests/ztest/error_hook failed on ARC boards

To Reproduce
Steps to reproduce the behavior:

  1. west build -b nsim_em -d build tests/ztest/error_hook
  2. west flash
  3. See error

Logs and console output

*** Booting Zephyr OS build zephyr-v2.4.0-3232-gf0145f9f3e37  ***
Running test suite error_hook_tests
===================================================================
START - test_catch_assert_fail
ASSERTION FAIL [a != ((void *)0)] @ WEST_TOPDIR/zephyr/tests/ztest/error_hook/src/main.c:41
        parameter a should not be NULL!
Caught assert failed
Assert error expected as part of test case.
 PASS - test_catch_assert_fail
===================================================================
START - test_catch_fatal_error
case type is 0
b is 11588
 FAIL - test_catch_fatal_error
===================================================================
START - test_catch_assert_in_isr
ASSERTION FAIL [a != ((void *)0)] @ WEST_TOPDIR/zephyr/tests/ztest/error_hook/src/main.c:41
        parameter a should not be NULL!
Caught assert failed
Assert error expected as part of test case.
 PASS - test_catch_assert_in_isr
===================================================================
START - test_catch_z_oops
E: ***** Exception vector: 0x6, cause code: 0x1, parameter 0x4
E: Address 0x80000af4
E: EV_ProtV
E: Memory read protection violation (MPU)
E:  r0: 0x80000aec  r1: 0x00000000  r2: 0x00000000  r3: 0x00000000
E:  r4: 0x00000000  r5: 0x00000000  r6: 0x0000011d  r7: 0x00000000
E:  r8: 0x00000000  r9: 0x00000000 r10: 0x00000000 r11: 0x00000000
E: r12: 0x000037c0 r13: 0x8000003c  pc: 0x00000304
E:  blink: 0x000002f4 status32: 0x80184086
E: lp_end: 0x00000000 lp_start: 0x00000000 lp_count: 0x00000000
E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
E: Current thread: 0x800008e4 (unknown)
Caught system error -- reason 0 1
Fatal error expected as part of test case.
 PASS - test_catch_z_oops
===================================================================
Test suite error_hook_tests failed.
===================================================================
PROJECT EXECUTION FAILED

Environment (please complete the following information):

  • OS: (Linux)
  • Toolchain (Zephyr SDK)
  • zephyr-v2.4.0-3232-gf0145f9f3e37
@IRISZZW IRISZZW added bug The issue is a bug, or the PR is fixing a bug area: ARC ARC Architecture labels Jan 19, 2021
@abrodkin abrodkin added this to the v2.5.0 milestone Jan 19, 2021
@nashif nashif added the priority: low Low impact/importance bug label Jan 19, 2021
@evgeniy-paltsev
Copy link
Collaborator

evgeniy-paltsev commented Jan 25, 2021

This is new test and it fails due to the specifics of ARC/nSIM.

It fails on sub-test which checks that userspace task will be terminated on null-pointer access. On nSIM boards we don't have memory in 0x0 location. And, as I understand, we cover with MPU only the memory which is declared (CCMs for UP nSIM boards). IOW, the 0x0 address isn't protected by MPU.

However the nSIM simulates full address space of memory, so all accesses outside of CCMs are valid and access to 0x0 address doesn't generate any exception.

Previously we couldn't disable this 'feature', we should check if it is possible with latest nSIM.

@enjiamai enjiamai self-assigned this Jan 29, 2021
enjiamai pushed a commit to enjiamai/zephyr that referenced this issue Feb 2, 2021
Fix issue zephyrproject-rtos#31339 and zephyrproject-rtos#31419, test case fail due to access NULL did not
trigger a fatal error in some platform such as nsim_em and iotdk.

Signed-off-by: Enjia Mai <[email protected]>
nashif pushed a commit that referenced this issue Feb 3, 2021
Fix issue #31339 and #31419, test case fail due to access NULL did not
trigger a fatal error in some platform such as nsim_em and iotdk.

Signed-off-by: Enjia Mai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARC ARC Architecture bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants