https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119258
Bug ID: 119258 Summary: All uses of relative timeouts should correctly handle overflow in duration conversions Product: gcc Version: 15.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Depends on: 113327 Target Milestone: --- This is the general case of Bug 113327. That one is specific to this_thread::sleep_for but we have the same issue in other places where we convert a relative timeout to chrono::seconds. If the original type has a coarser duration than seconds, the value might overflow chrono::seconds::rep. This affects timed mutexes, condition variables, futures ... Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113327 [Bug 113327] std::sleep_for(std::chrono::hours::max()) returns immediately