[crac] RFR: CRaC: Fix fds opened for logging [v5]

Jan Kratochvil jkratochvil at openjdk.org
Thu Oct 5 07:38:43 UTC 2023

On Mon, 2 Oct 2023 18:34:50 GMT, Radim Vansa <rvansa at openjdk.org> wrote:

>> I hope the stop() and resume() do fix it. But there is no testcase for that, do you want it?
> I guess that a testcase for the synchronization would be quite difficult to do, as you'd be trying to simulate a race.
> However, I am not convinced the `stop()` and `resume()` work correctly: the log writer does not need to own the lock while writing messages to the (potentially nulled) outputs; you flush the buffer and then acquire the lock, effectively blocking all log producers from enqueuing further messages. However if someone enqueues a message right after flush, the log writer has a chance to dequeue it (actually swap queues) and even if you acquire lock then, continue writing these messages to the closed output.

Race reproducers are also a part of testsuites - [ptrace-testsuite](https://sourceware.org/systemtap/wiki/utrace/tests) limits their run by its `TESTTIME` parameter. I sure did not try how easily would be to reproduce this race and I am sure happy not to write such a testcase.


PR Review Comment: https://git.openjdk.org/crac/pull/113#discussion_r1346938564

More information about the crac-dev mailing list