openssl: Intermittent failure of rcu test in test_threads on linux-ppc64le
We can see this failure here: https://github.com/openssl/openssl/actions/runs/12682940557/job/35349171521
However sometimes the test passes.
90-test_threads.t .......................
# INFO: @ test/threadstest.c:442
# Staring rcu torture
# INFO: @ test/threadstest.c:398
# Starting reader 1INFO: @ test/threadstest.c:360
# Starting writer2
#
# INFO: @ test/threadstest.c:404
# Starting reader 2
# INFO: @ test/threadstest.c:351
# Starting writer1
# INFO: @ test/threadstest.c:383
# rcu torture value went backwards! 243373 : 0
# INFO: @ test/threadstest.c:457
# rcu_torture_result is 0
#
# INFO: @ test/threadstest.c:458
# performed 3689314 reads and 4949676 writes over 2 read and 2 write threads in 3.997268e+00 seconds
# INFO: @ test/threadstest.c:468
# Average read time 1.083472e-06/read
# INFO: @ test/threadstest.c:469
# Average write time 8.075817e-07/write
# ERROR: (int) 'rcu_torture_result == 1' failed @ test/threadstest.c:471
# [0] compared to [1]
# ERROR: (int) 'rcu_torture_result == 1' failed @ test/threadstest.c:478
# [0] compared to [1]
# OPENSSL_TEST_RAND_SEED=1736392675
not ok 6 - torture_rcu_high
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 29 (28 by maintainers)
Commits related to this issue
- Fix premature reuse of qp's in rcu locks An intermittent failure was noted on our new ppc64le CI runner, in which what appeared to be a corrupted or invalid value getting returned from a shared point... — committed to nhorman/openssl by nhorman 2 years ago
- Fix premature reuse of qp's in rcu locks An intermittent failure was noted on our new ppc64le CI runner, in which what appeared to be a corrupted or invalid value getting returned from a shared point... — committed to openssl/openssl by nhorman 2 years ago
- Fix premature reuse of qp's in rcu locks An intermittent failure was noted on our new ppc64le CI runner, in which what appeared to be a corrupted or invalid value getting returned from a shared point... — committed to openssl/openssl by nhorman 2 years ago
- Fix premature reuse of qp's in rcu locks An intermittent failure was noted on our new ppc64le CI runner, in which what appeared to be a corrupted or invalid value getting returned from a shared point... — committed to openssl/openssl by nhorman 2 years ago
That’s unfortunate… May I suggest to add this to your test loop:
just to make sure to catch any underflow on the count, as IMHO currently the assertion would not work when the ID_VAL happens to be non-zero?
Another failure even with the new fix in https://github.com/openssl/openssl/actions/runs/12942372889/job/36100002870
I think I see the problem. It has to do with the number of quiescent points (qp’s) we allocate for an rcu lock. Generally speaking we only have 2 and we toggle between them. However, it may occur, due to thread timing, that multiple qp’s get retired and reused before a write side acquires one, leading to an aliasing issue that results in us finishing synchronization operations too early. Working on a fix now.
@nhorman could you please look at this?