Skip to content

tests/kernel/mem_protect/mem_protect tests are failing on ARM boards #10473

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
spoorthik opened this issue Oct 10, 2018 · 4 comments · Fixed by #10696
Closed

tests/kernel/mem_protect/mem_protect tests are failing on ARM boards #10473

spoorthik opened this issue Oct 10, 2018 · 4 comments · Fixed by #10696
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: high High impact/importance bug

Comments

@spoorthik
Copy link
Contributor

Execution log:

***** Booting Zephyr OS 1.13.99 (delayed boot 1000ms) *****
Running test suite memory_protection_test_suite
===================================================================
starting test - test_permission_inheritance
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407050
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_permission_inheritance
===================================================================
starting test - test_mem_domain_valid_access
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407cfc
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_mem_domain_valid_access
===================================================================
starting test - test_mem_domain_invalid_access
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407d88
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_mem_domain_invalid_access
===================================================================
starting test - test_mem_domain_partitions_user_rw
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407f40
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_mem_domain_partitions_user_rw
===================================================================
starting test - test_mem_domain_partitions_supervisor_rw
PASS - test_mem_domain_partitions_supervisor_rw
===================================================================
starting test - test_mem_domain_partitions_user_ro
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407f40
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_mem_domain_partitions_user_ro
===================================================================
starting test - test_mem_domain_add_partitions_invalid
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407f40
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_mem_domain_add_partitions_invalid
===================================================================
starting test - test_mem_domain_add_partitions_simple
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407f40
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_mem_domain_add_partitions_simple
===================================================================
starting test - test_mem_domain_remove_partitions_simple
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407f40
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_mem_domain_remove_partitions_simple
===================================================================
starting test - test_mem_domain_remove_partitions
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407e14
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_mem_domain_remove_partitions
===================================================================
starting test - test_mem_domain_remove_thread
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407f40
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_mem_domain_remove_thread
===================================================================
starting test - test_mem_domain_destroy
PASS - test_mem_domain_destroy
===================================================================
starting test - test_kobject_access_grant
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407f40
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_kobject_access_grant
===================================================================
starting test - test_syscall_invalid_kobject
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407f40
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_syscall_invalid_kobject
===================================================================
starting test - test_thread_without_kobject_permission
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407f40
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_thread_without_kobject_permission
===================================================================
starting test - test_kobject_revoke_access
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x204076c0
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_kobject_revoke_access
===================================================================
starting test - test_kobject_grant_access_kobj
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x204072cc
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_kobject_grant_access_kobj
===================================================================
starting test - test_kobject_grant_access_kobj_invalid
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x2040774c
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_kobject_grant_access_kobj_invalid
===================================================================
starting test - test_kobject_release_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x204077d8
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_kobject_release_from_user
===================================================================
starting test - test_kobject_access_all_grant
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x204072cc
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_kobject_access_all_grant
===================================================================
starting test - test_thread_has_residual_permissions
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407864
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_thread_has_residual_permissions
===================================================================
starting test - test_kobject_access_grant_to_invalid_thread
PASS - test_kobject_access_grant_to_invalid_thread
===================================================================
starting test - test_kobject_access_invalid_kobject
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407f40
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_kobject_access_invalid_kobject
===================================================================
starting test - test_access_kobject_without_init_access
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407f40
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_access_kobject_without_init_access
===================================================================
starting test - test_access_kobject_without_init_with_access
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x204078f0
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_access_kobject_without_init_with_access
===================================================================
starting test - test_kobject_reinitialize_thread_kobj
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x204071b4
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_kobject_reinitialize_thread_kobj
===================================================================
starting test - test_create_new_thread_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x204073e4
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_create_new_thread_from_user
===================================================================
starting test - test_create_new_thread_from_user_no_access_stack
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x204074fc
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_create_new_thread_from_user_no_access_stack
===================================================================
starting test - test_create_new_thread_from_user_invalid_stacksize
SKIP - test_create_new_thread_from_user_invalid_stacksize
===================================================================
starting test - test_create_new_thread_from_user_huge_stacksize
SKIP - test_create_new_thread_from_user_huge_stacksize
===================================================================
starting test - test_create_new_supervisor_thread_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20407614
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_create_new_supervisor_thread_from_user
===================================================================
starting test - test_create_new_essential_thread_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x204072cc
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_create_new_essential_thread_from_user
===================================================================
starting test - test_create_new_higher_prio_thread_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x204073e4
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_create_new_higher_prio_thread_from_user
===================================================================
starting test - test_create_new_invalid_prio_thread_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x204074fc
Faulting instruction address = 0x4082cc
Caught system error -- reason 0
FAIL - test_create_new_invalid_prio_thread_from_user
===================================================================
===================================================================

PROJECT EXECUTION FAILED

Platforms tested: sam_e70_xplained, nrf52_pca10040, frdm_k64f, nrf52840_pca10056

@spoorthik spoorthik added the bug The issue is a bug, or the PR is fixing a bug label Oct 10, 2018
AdithyaBaglody added a commit to AdithyaBaglody/zephyr that referenced this issue Oct 11, 2018
nashif pushed a commit that referenced this issue Oct 11, 2018
This was causing an incorrect hash for privileged stack.

Fixes: GH-10473
Fixes: GH-10474
Fixes: GH-10475
Fixes: GH-10476

Signed-off-by: Adithya Baglody <[email protected]>
@spoorthik
Copy link
Contributor Author

spoorthik commented Oct 12, 2018

@nashif @AdithyaBaglody

The test suite fails on freedom_k64f with the fix.

Execution log:

***** Booting Zephyr OS 1.13.99 (delayed boot 1000ms) *****
Running test suite memory_protection_test_suite
===================================================================
starting test - test_permission_inheritance
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006884
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_permission_inheritance
===================================================================
starting test - test_mem_domain_valid_access
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x2000753c
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_mem_domain_valid_access
===================================================================
starting test - test_mem_domain_invalid_access
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x200075c8
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_mem_domain_invalid_access
===================================================================
starting test - test_mem_domain_partitions_user_rw
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007780
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_mem_domain_partitions_user_rw
===================================================================
starting test - test_mem_domain_partitions_supervisor_rw
PASS - test_mem_domain_partitions_supervisor_rw
===================================================================
starting test - test_mem_domain_partitions_user_ro
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007780
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_mem_domain_partitions_user_ro
===================================================================
starting test - test_mem_domain_add_partitions_invalid
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007780
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_mem_domain_add_partitions_invalid
===================================================================
starting test - test_mem_domain_add_partitions_simple
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007780
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_mem_domain_add_partitions_simple
===================================================================
starting test - test_mem_domain_remove_partitions_simple
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007780
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_mem_domain_remove_partitions_simple
===================================================================
starting test - test_mem_domain_remove_partitions
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007654
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_mem_domain_remove_partitions
===================================================================
starting test - test_mem_domain_remove_thread
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007780
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_mem_domain_remove_thread
===================================================================
starting test - test_mem_domain_destroy
PASS - test_mem_domain_destroy
===================================================================
starting test - test_kobject_access_grant
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007780
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_kobject_access_grant
===================================================================
starting test - test_syscall_invalid_kobject
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007780
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_syscall_invalid_kobject
===================================================================
starting test - test_thread_without_kobject_permission
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007780
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_thread_without_kobject_permission
===================================================================
starting test - test_kobject_revoke_access
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006ef4
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_kobject_revoke_access
===================================================================
starting test - test_kobject_grant_access_kobj
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006b00
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_kobject_grant_access_kobj
===================================================================
starting test - test_kobject_grant_access_kobj_invalid
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006f80
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_kobject_grant_access_kobj_invalid
===================================================================
starting test - test_kobject_release_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x2000700c
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_kobject_release_from_user
===================================================================
starting test - test_kobject_access_all_grant
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006b00
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_kobject_access_all_grant
===================================================================
starting test - test_thread_has_residual_permissions
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007098
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_thread_has_residual_permissions
===================================================================
starting test - test_kobject_access_grant_to_invalid_thread
PASS - test_kobject_access_grant_to_invalid_thread
===================================================================
starting test - test_kobject_access_invalid_kobject
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007780
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_kobject_access_invalid_kobject
===================================================================
starting test - test_access_kobject_without_init_access
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007780
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_access_kobject_without_init_access
===================================================================
starting test - test_access_kobject_without_init_with_access
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20007124
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_access_kobject_without_init_with_access
===================================================================
starting test - test_kobject_reinitialize_thread_kobj
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x200069e8
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_kobject_reinitialize_thread_kobj
===================================================================
starting test - test_create_new_thread_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006c18
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_create_new_thread_from_user
===================================================================
starting test - test_create_new_thread_from_user_no_access_stack
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006d30
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_create_new_thread_from_user_no_access_stack
===================================================================
starting test - test_create_new_thread_from_user_invalid_stacksize
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006b00
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_create_new_thread_from_user_invalid_stacksize
===================================================================
starting test - test_create_new_thread_from_user_huge_stacksize
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006c18
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_create_new_thread_from_user_huge_stacksize
===================================================================
starting test - test_create_new_supervisor_thread_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006e48
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_create_new_supervisor_thread_from_user
===================================================================
starting test - test_create_new_essential_thread_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006b00
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_create_new_essential_thread_from_user
===================================================================
starting test - test_create_new_higher_prio_thread_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006c18
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_create_new_higher_prio_thread_from_user
===================================================================
starting test - test_create_new_invalid_prio_thread_from_user
***** USAGE FAULT *****
  Attempt to execute undefined instruction
***** Hardware exception *****
Current thread ID = 0x20006d30
Faulting instruction address = 0x96a4
Caught system error -- reason 0
FAIL - test_create_new_invalid_prio_thread_from_user
===================================================================
===================================================================
PROJECT EXECUTION FAILED

@spoorthik spoorthik reopened this Oct 12, 2018
@nashif nashif added the priority: high High impact/importance bug label Oct 14, 2018
@dcpleung
Copy link
Member

@AdithyaBaglody said that #10542 should fix this.

@nashif
Copy link
Member

nashif commented Oct 16, 2018

looks like it did not, @AdithyaBaglody?

Not that the while series introducing linker orphan warning has been removed and need to be submitted cleanly and after verifying that those bugs are not introduced.

@AdithyaBaglody
Copy link
Contributor

@nashif there were 2 PRs which has the fix for the orphan sections. #10507 (merged) and #10542 (open). when these are combined with the orphan sections changes it works on all ARM platforms.

@dcpleung can u please resubmit the orphan section and just apply my patch(#10542 ) on top of it.

I have tested this on mps2_an385 and sam_e70 and frdm_k64f and it was working fine on Friday.

dcpleung pushed a commit to dcpleung/zephyr that referenced this issue Oct 19, 2018
This puts the priviledged stack at the end of RAM.
This combines PR zephyrproject-rtos#10507 and zephyrproject-rtos#10542.

Fixes zephyrproject-rtos#10473
Fixes zephyrproject-rtos#10474
Fixes zephyrproject-rtos#10515

Signed-off-by: Adithya Baglody <[email protected]>
Signed-off-by: Daniel Leung <[email protected]>
dcpleung added a commit to dcpleung/zephyr that referenced this issue Oct 19, 2018
(Previous patch set was reverted due to issue with priv_stack.
 Resubmitting after fixing the faults caused by priv_stack.noinit
 not at the end of RAM.)

This adds a linker flag and necessary changes to linker scripts
so that linker will warn about orphan sections.

Relates to zephyrproject-rtos#5534.

Fixes zephyrproject-rtos#10473, zephyrproject-rtos#10474, zephyrproject-rtos#10515.

Signed-off-by: Daniel Leung <[email protected]>
nashif pushed a commit that referenced this issue Oct 19, 2018
This puts the priviledged stack at the end of RAM.
This combines PR #10507 and #10542.

Fixes #10473
Fixes #10474
Fixes #10515

Signed-off-by: Adithya Baglody <[email protected]>
Signed-off-by: Daniel Leung <[email protected]>
nashif pushed a commit that referenced this issue Oct 19, 2018
(Previous patch set was reverted due to issue with priv_stack.
 Resubmitting after fixing the faults caused by priv_stack.noinit
 not at the end of RAM.)

This adds a linker flag and necessary changes to linker scripts
so that linker will warn about orphan sections.

Relates to #5534.

Fixes #10473, #10474, #10515.

Signed-off-by: Daniel Leung <[email protected]>
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 priority: high High impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants