zephyr: qemu_cortex_a53_smp: tests/ztest/error_hook failed after enabling the FPU context switching support

Describe the bug The testcase tests/ztest/error_hook failed after the FPU context switching support. This failure is not 100% reproduced. And after git bisect, we found the issue started after commit: a82fff04ff9ce3bbb126e4f8e7af9c0fc4003c4f, or f1f63dda176f8bce7a8cebe50c30ebe01262b798.

To Reproduce Steps to reproduce the behavior: Run command:
twister -T tests/ztest/error_hook/ -p qemu_cortex_a53_smp or west build tests/ztest/error_hook/ -b qemu_cortex_a53_smp -t run -p always -DCONFIG_TEST_USERSPACE=y

Expected behavior A test case pass as expected, and the expected log should like this:

===================================================================
START - test_catch_z_oops
E: ELR_ELn: 0x000000004000258c
E: ESR_ELn: 0x0000000056000000
E:   EC:  0x15 (Unknown)
E:   IL:  0x1
E:   ISS: 0x0
E: TPIDRRO: 0x000000004002f5b0
E: x0:  0x00000000140003ff  x1:  0x0000000000000000
E: x2:  0x00000000400833ac  x3:  0x0000000000000002
E: x4:  0x0000000000000000  x5:  0x0000000000000000
E: x6:  0x0000000000000000  x7:  0x00000000644d5241
E: x8:  0x0000000000000000  x9:  0x0000000000000000
E: x10: 0x0000000000000000  x11: 0x0000000000000000
E: x12: 0x0000000000000000  x13: 0x0000000000000000
E: x14: 0x0000000000000000  x15: 0x0000000000000000
E: x16: 0x0000000000000000  x17: 0x0000000000000000
E: x18: 0x0000000000000000  x30: 0x0000000000000000
E: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
E: Current thread: 0x4002e700 (ztest_thread)
Caught system error -- reason 3 1
Fatal error expected as part of test case.
 PASS - test_catch_z_oops in 0.1 seconds

Impact It blocked the CI where the submitted PR run testcase tests/ztest/error_hook.

Logs and console output Here is error log shows in twister-out/qemu_cortex_a53_smp/tests/ztest/error_hook/testing.ztest.error_hook/handler.log:

=================================================================
START - test_catch_z_oops

or

=================================================================
START - test_catch_z_oops
E: ELR_ELn: 0x000000004001d078
E: ESR_ELn: 0x000000008600000f
E:   EC:  0x21 (Instruction Abort taken without a change in Exception level.)
E:   IL:  0x1
E:   ISS: 0xf
E: FAR_ELn: 0x000000004001d078
E: TPIDRRO: 0x010000004002f5e0
E: x0:  0x00000000fffffff5  x1:  0x0000000000000000
E: x2:  0x0000000000000000  x3:  0x0000000000000000
E: x4:  0x0000000040007e54  x5:  0x000000004000152c
E: x6:  0x000000050000000c  x7:  0x0000000000000000
E: x8:  0x0000000000000000  x9:  0x0000000000000005
E: x10: 0x000000050000000c  x11: 0x0000000000000000
E: x12: 0x0000000040080fb0  x13: 0x0000000040007e90
E: x14: 0x0000000040080fe0  x15: 0x00000000400025a8
E: x16: 0x000000004002e700  x17: 0x0000000000000000
E: x18: 0x0000000000000000  x30: 0x000000004001d078
E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 1
E: Current thread: 0x4002e700 (ztest_thread)
Caught system error -- reason 0 0
Fatal error was unexpected, aborting...

Environment (please complete the following information):

  • OS: ubuntu 18.04
  • Toolchain Zephyr SDK 0.12.4
  • Commit 86851434c8372fdd1f4f078d92a6e72a92d5ac0d , or commit after a82fff04ff9ce3bbb126e4f8e7af9c0fc4003c4f

Additional context N/A

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Came here to comment that this sounds like almost exactly the issue detailed in #35307, but it looks like @npitre is already here and aware.