A custom eBPF-based Linux scheduler written in Java (concurrency-fuzz-scheduler) is used to reproduce a rare concurrency bug in OpenJDK's JFR CPU-time sampler test. The chaotic scheduler deliberately introduces random sleeps and disrupts normal thread scheduling to expose timing-sensitive bugs that rarely manifest under standard conditions. A real OpenJDK bug (JDK-8366486) is used as a case study: a test that should fail usually passes because an unrelated JFR internal thread gets sampled instead of the intended thread. The chaotic scheduler amplifies the variance, making the bug reproducible within minutes rather than relying on chance. The fixed version runs stably for hours under the same chaotic conditions, confirming the fix.

7m read timeFrom mostlynerdless.de
Post cover image
Table of contents
Running the Test Case NormallyRunning the Test Case with the Chaotic SchedulerRunning the Fixed Test CaseThe BugWhy does it not always fail?ConclusionAuthorRelated Posts:

Sort: