Skip to content

Conversation

Ekam219
Copy link

@Ekam219 Ekam219 commented Apr 3, 2025

Problem Summary

A race condition in the build pipeline leads to corrupted build artifacts when multiple threads or processes concurrently access shared resources. This occurs due to the lack of synchronization mechanisms in critical sections of the build process.
#963

Affected Components

  • File I/O Operations: Concurrent writes to shared files (e.g., build.sh, target.o, coverage reports).
  • OSS-Fuzz Configuration: Simultaneous modifications to project configurations.
  • Artifact Generation: Race conditions during binary compilation and coverage data aggregation.

Proposed Fix

This PR introduces a semaphore to control concurrent build operations and ensure proper synchronization:

  • Added Semaphore(4) to limit concurrent builds to four at a time, reducing the risk of corrupted artifacts.
  • The execute() method now acquires a semaphore before running the build process, ensuring proper access control.

Impact & Benefits

  • Prevents build artifacts from being corrupted.
  • Ensures stability for distributed fuzzing experiments.
  • Reduces flaky builds and improves reproducibility.

Next Steps & Considerations

  • The semaphore limit (4) is currently hardcoded—should this be configurable?
  • Further testing required to evaluate performance impact, especially in high-concurrency scenarios.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant