Page MenuHomeFreeBSD

ctfmerge: fix segfault when building on macOS
ClosedPublic

Authored by mp on Dec 1 2025, 6:46 PM.
Tags
None
Referenced Files
F154671501: D54018.diff
Wed, Apr 29, 4:43 AM
Unknown Object (File)
Sat, Apr 18, 8:56 PM
Unknown Object (File)
Sat, Apr 18, 10:18 AM
Unknown Object (File)
Wed, Apr 15, 9:56 AM
Unknown Object (File)
Sun, Apr 12, 1:47 AM
Unknown Object (File)
Sun, Apr 5, 8:34 AM
Unknown Object (File)
Sat, Apr 4, 9:55 PM
Unknown Object (File)
Mar 22 2026, 5:27 AM
Subscribers

Details

Summary

The barrier code was using semaphores which have been deprecated in
macOS and not working at all, causing a race condition. Since macOS
does not have pthread_barrier_*(), this change uses a condition
variable instead.

PR: 290958
Reported by: wosch
MFC after: 2 weeks

Diff Detail

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

Event Timeline

mp requested review of this revision.Dec 1 2025, 6:46 PM
This revision is now accepted and ready to land.Dec 1 2025, 6:52 PM
This revision was automatically updated to reflect the committed changes.

Why not just replace the entirety of barrier.[ch] with pthread_barrier(3)?

Why not just replace the entirety of barrier.[ch] with pthread_barrier(3)?

I had the same thought, but apparently macOS doesn't implement it.

Why not just replace the entirety of barrier.[ch] with pthread_barrier(3)?

I had the same thought, but apparently macOS doesn't implement it.

Huh. TIL.