Page MenuHomeFreeBSD

time: switch to fences for siginfo_recvd
ClosedPublic

Authored by kevans on Jun 13 2024, 5:29 AM.
Tags
None
Referenced Files
F143071618: D45574.id154001.diff
Sun, Jan 25, 3:36 PM
F143070460: D45574.id.diff
Sun, Jan 25, 3:23 PM
F143066070: D45574.id140355.diff
Sun, Jan 25, 2:37 PM
F142977233: D45574.id140355.diff
Sun, Jan 25, 1:27 AM
Unknown Object (File)
Thu, Jan 8, 12:11 PM
Unknown Object (File)
Sat, Jan 3, 8:45 PM
Unknown Object (File)
Dec 10 2025, 1:57 PM
Unknown Object (File)
Nov 24 2025, 5:38 AM
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.