Page MenuHomeFreeBSD

time: switch to fences for siginfo_recvd
ClosedPublic

Authored by kevans on Jun 13 2024, 5:29 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 31, 9:43 AM
Unknown Object (File)
Wed, Mar 11, 8:46 PM
Unknown Object (File)
Mar 4 2026, 5:53 PM
Unknown Object (File)
Feb 28 2026, 8:52 PM
Unknown Object (File)
Feb 28 2026, 8:06 AM
Unknown Object (File)
Feb 24 2026, 7:26 PM
Unknown Object (File)
Feb 24 2026, 5:46 AM
Unknown Object (File)
Feb 23 2026, 4:54 PM
Subscribers

Details

Summary

This effectively reverts
6e824f3713011 ("time: siginfo_recvd needs to be marked volatile")
because it was actually wrong. Switch to C11 signal fence, which
provides a compiler barrier that will do the right thing.

Reported by: kib

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

usr.bin/time/time.c
130–133

I think that the right code is

local_siginfo_recvd = siginfo_recvd;
atomic_signal_fence(acq);
if (local siginfo_recvd) {
  ....

[Fence should come after reading the flag variable]

usr.bin/time/time.c
130–133

Ubernit: bool?

This revision is now accepted and ready to land.Jun 29 2024, 3:02 AM
This revision was automatically updated to reflect the committed changes.
kevans marked an inline comment as done.