Page MenuHomeFreeBSD

ctfmerge: fix segfault when building on macOS
ClosedPublic

Authored by mp on Dec 1 2025, 6:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Jan 17, 10:46 PM
Unknown Object (File)
Dec 19 2025, 11:45 PM
Unknown Object (File)
Dec 19 2025, 6:58 AM
Unknown Object (File)
Dec 18 2025, 7:47 AM
Unknown Object (File)
Dec 17 2025, 11:16 PM
Unknown Object (File)
Dec 16 2025, 7:21 AM
Unknown Object (File)
Dec 15 2025, 4:42 PM
Unknown Object (File)
Dec 15 2025, 9:29 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.