← Back to events
ActiveAIRelease

trunk/769c18b73de9dd328fd434728589fffdf47846e0: [rpc] Fix dangling this in RRef::handleError static map (#192960)

Photo: PyTorch Releases

What happened

The static errorHandlers map in RRef::handleError() used lambdas that captured this. Since the map is initialized once, all subsequent calls from any RRef instance would use the first caller's this pointer. This can cause a use-after-free if the first RRef is destroyed first, and even if not, the wrong RRef's timedOut_ flag is set, leading to incorrect error handling. Pass this as a parameter to the lambdas instead…

Summary assembled by rule from the sources below

Why it's spreading

Sources