zephyr: upsquared: tests/kernel/spinlock/kernel.multiprocessing.spinlock fails.
Describe the bug
tests/kernel/spinlock/kernel.multiprocessing.spinlock fails.
kernel.multiprocessing.spinlock
and
kernel.multiprocessing.spinlock.minimallibc
Bisect report
28a8b151cf54d8482c1518e2a120a6c54a463c93 is the first bad commit
commit 28a8b151cf54d8482c1518e2a120a6c54a463c93
Author: Christopher Friedt <cfriedt@meta.com>
Date: Sun Jul 2 10:58:38 2023 +0200
tests: kernel: spinlock: add test for k_spin_trylock()
Add a testcase to exercise two cases:
* when `k_spin_trylock()` fails (lock is busy)
* when `k_spin_trylock()` succeeds (lock is acquired)
We use the same machinery for checking for a recursive mutex
as `k_spin_lock()`.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
tests/kernel/spinlock/src/main.c | 58 +++++++++++++++++++++++++++++++++++++---
1 file changed, 54 insertions(+), 4 deletions(-)
To Reproduce
twister --device-testing --hardware-map $HOME/up2_double.map -T tests/kernel/spinlock/ -v
Logs and console output
INFO - Using Ninja..
INFO - Zephyr version: v3.5.0-rc3-17-g3b9acef1ba5f
INFO - Using 'zephyr' toolchain.
INFO - Building initial testsuite list...
INFO - Writing JSON report /home/ztest/zephyrproject/zephyr/twister-out/testplan.json
Device testing on:
| Platform | ID | Serial device |
|------------|------|-----------------|
| up_squared | up2 | /dev/ttyUP2 |
INFO - JOBS: 8
INFO - Adding tasks to the queue...
INFO - Added initial list of jobs to queue
INFO - 1/2 up_squared tests/kernel/spinlock/kernel.multiprocessing.spinlock.minimallibc FAILED Failed (device: up2, 25.023s)
ERROR - see: /home/ztest/zephyrproject/zephyr/twister-out/up_squared/tests/kernel/spinlock/kernel.multiprocessing.spinlock.minimallibc/handler.log
INFO - 2/2 up_squared tests/kernel/spinlock/kernel.multiprocessing.spinlock FAILED Failed (device: up2, 25.849s)
ERROR - see: /home/ztest/zephyrproject/zephyr/twister-out/up_squared/tests/kernel/spinlock/kernel.multiprocessing.spinlock/handler.log
INFO - 2 test scenarios (2 test instances) selected, 0 configurations skipped (0 by static filter, 0 at runtime).
INFO - 0 of 2 test configurations passed (0.00%), 2 failed, 0 errored, 0 skipped with 0 warnings in 59.43 seconds
INFO - In total 16 test cases were executed, 0 skipped on 1 out of total 626 platforms (0.16%)
INFO - 2 test configurations executed on platforms, 0 test configurations were only built.
hanlder.log contains.
...
===================================================================
58 START - test_trylock
59 Assertion failed at WEST_TOPDIR/zephyr/tests/kernel/spinlock/src/main.c:222: spinlock_test_trylock: trylock_failures > 0 is false
60 FAIL - test_trylock in 1.034 seconds
61 ===================================================================
62 TESTSUITE spinlock failed.
63 ------ TESTSUITE SUMMARY START ------
64 SUITE FAIL - 85.71% [spinlock]: pass = 6, fail = 1, skip = 1, total = 8 duration = 2.112 seconds
65 - PASS - [spinlock.test_spinlock_basic] duration = 0.001 seconds
66 - PASS - [spinlock.test_spinlock_bounce] duration = 1.021 seconds
67 - SKIP - [spinlock.test_spinlock_lock_time_limit] duration = 0.001 seconds
68 - PASS - [spinlock.test_spinlock_mutual_exclusion] duration = 0.001 seconds
69 - PASS - [spinlock.test_spinlock_no_recursive] duration = 0.018 seconds
70 - PASS - [spinlock.test_spinlock_release_error] duration = 0.018 seconds
71 - PASS - [spinlock.test_spinlock_unlock_error] duration = 0.018 seconds
72 - FAIL - [spinlock.test_trylock] duration = 1.034 seconds
73 ------ TESTSUITE SUMMARY END ------
74 ===================================================================
75 RunID: d685f227c8978498acdaab3119a8c20d
76 PROJECT EXECUTION FAILED
Running TESTSUITE spinlock
===================================================================
START - test_spinlock_basic
PASS - test_spinlock_basic in 0.001 seconds
===================================================================
START - test_spinlock_bounce
PASS - test_spinlock_bounce in 0.122 seconds
===================================================================
START - test_spinlock_lock_time_limit
SKIP - test_spinlock_lock_time_limit in 0.001 seconds
===================================================================
START - test_spinlock_mutual_exclusion
PASS - test_spinlock_mutual_exclusion in 0.001 seconds
===================================================================
START - test_spinlock_no_recursive
ASSERTION FAIL [z_spin_lock_valid(l)] @ WEST_TOPDIR/zephyr/include/zephyr/spinlock.h:114
Invalid spinlock 0x59c480
Caught an assert.
Assert error expected as part of test case.
PASS - test_spinlock_no_recursive in 0.018 seconds
===================================================================
START - test_spinlock_release_error
ASSERTION FAIL [z_spin_unlock_valid(l)] @ WEST_TOPDIR/zephyr/include/zephyr/spinlock.h:287
Not my spinlock 0x59c470
Caught an assert.
Assert error expected as part of test case.
PASS - test_spinlock_release_error in 0.018 seconds
===================================================================
START - test_spinlock_unlock_error
ASSERTION FAIL [z_spin_unlock_valid(l)] @ WEST_TOPDIR/zephyr/include/zephyr/spinlock.h:240
Not my spinlock 0x59c470
Caught an assert.
Assert error expected as part of test case.
PASS - test_spinlock_unlock_error in 0.018 seconds
===================================================================
START - test_trylock
Assertion failed at WEST_TOPDIR/zephyr/tests/kernel/spinlock/src/main.c:227: spinlock_test_trylock: trylock_failures > 0 is false
FAIL - test_trylock in 1.077 seconds
===================================================================
TESTSUITE spinlock failed.
------ TESTSUITE SUMMARY START ------
SUITE FAIL - 85.71% [spinlock]: pass = 6, fail = 1, skip = 1, total = 8 duration = 1.256 seconds
- PASS - [spinlock.test_spinlock_basic] duration = 0.001 seconds
- PASS - [spinlock.test_spinlock_bounce] duration = 0.122 seconds
- SKIP - [spinlock.test_spinlock_lock_time_limit] duration = 0.001 seconds
- PASS - [spinlock.test_spinlock_mutual_exclusion] duration = 0.001 seconds
- PASS - [spinlock.test_spinlock_no_recursive] duration = 0.018 seconds
- PASS - [spinlock.test_spinlock_release_error] duration = 0.018 seconds
- PASS - [spinlock.test_spinlock_unlock_error] duration = 0.018 seconds
- FAIL - [spinlock.test_trylock] duration = 1.077 seconds
------ TESTSUITE SUMMARY END ------
===================================================================
RunID: 7999285b25c21472dff4a181a3260c24
PROJECT EXECUTION FAILED
Environment (please complete the following information):
- OS: Linux
- Toolchain: zephyr-sdk-0.16.0
- Zephyr version: zephyr-v3.4.0-1052-gf2e0f787bf83
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 23 (12 by maintainers)
There is no reproduction anymore. Please reopen if needed.
@cfriedt could you look into this?