Skip to content

fix lockless io-stealing

Maxim Onciul requested to merge fix-wait-free-io-stealing into master

The uninitialized continuation pointer may be returned without being written resulting in dispatching an invalid fiber pointer.

If a CQE is stolen but no fiber is blocked on the corresponding future IoContext::getContinuationsFromCompletions will call future->completeAndGetContinuation which will set the future's completion but will not return a continuation.

If no continuation is returned from Future::completeAndGetContinuation the continuation buffer is not advanced by IoContext::getContinuationsFromCompletions (emper/io/IoContext.hpp:259).

IoContext::reapSingleCompletion does not check if a continuation was created and assumed that continuation contains a valid Fiber* if a CQE was successfully stolen.

Initialize continuation with nullptr, which is a valid Fiber*.

Merge request reports

Loading