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)
Wed, Dec 10, 1:57 PM
Unknown Object (File)
Nov 24 2025, 5:38 AM
Unknown Object (File)
Nov 24 2025, 5:38 AM
Unknown Object (File)
Nov 24 2025, 5:38 AM
Unknown Object (File)
Nov 24 2025, 5:38 AM
Unknown Object (File)
Nov 24 2025, 5:36 AM
Unknown Object (File)
Nov 11 2025, 12:41 PM
Unknown Object (File)
Nov 9 2025, 2:13 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.