https://bugs.openldap.org/show_bug.cgi?id=9947
Issue ID: 9947 Summary: Race in epoch.c Product: OpenLDAP Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: lloadd Assignee: bugs@openldap.org Reporter: ondra@mistotebe.net Target Milestone: ---
When epoch_leave() tests whether other threads might still be alive, it can test things in reverse order, testing too early to catch a thread to come in and too late to see a thread that just left. If those two saw each other, the clock would not advance and the data in refs might actually still be a reachable pointer.
The tests in epoch_leave can actually be simplified leading to machine code not all compilers could figure out by themselves.