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)
Fri, Jul 17, 5:22 PM
Unknown Object (File)
Wed, Jul 15, 6:57 AM
Unknown Object (File)
Wed, Jul 15, 6:57 AM
Unknown Object (File)
Tue, Jul 14, 4:54 AM
Unknown Object (File)
Sun, Jul 12, 3:28 AM
Unknown Object (File)
Fri, Jul 10, 2:49 PM
Unknown Object (File)
Sat, Jul 4, 11:46 AM
Unknown Object (File)
Fri, Jul 3, 9:37 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.