Skip to content
  • Luite Stegeman's avatar
    fcf092dd
    Windows: remove StgAsyncIOResult and fix crash/leaks · fcf092dd
    Luite Stegeman authored and Marge Bot's avatar Marge Bot committed
    In stg_block_async{_void}, a stack slot was reserved for
    an StgAsyncIOResult. This slot would be filled by the IO
    manager upon completion of the async call.
    
    However, if the blocked thread was interrupted by an async
    exception, we would end up in an invalid state:
    
     - If the blocked computation was never re-entered, the
       StgAsyncIOResult would never be freed.
     - If the blocked computation was re-entered, the thread would
       find an unitialized stack slot for the StgAsyncIOResult,
       leading to a crash reading its fields, or freeing the pointer.
    
    We fix this by removing the StgAsyncIOResult altogether and writing
    the result directly to the stack.
    
    Fixes #26341
    fcf092dd
    Windows: remove StgAsyncIOResult and fix crash/leaks
    Luite Stegeman authored and Marge Bot's avatar Marge Bot committed
    In stg_block_async{_void}, a stack slot was reserved for
    an StgAsyncIOResult. This slot would be filled by the IO
    manager upon completion of the async call.
    
    However, if the blocked thread was interrupted by an async
    exception, we would end up in an invalid state:
    
     - If the blocked computation was never re-entered, the
       StgAsyncIOResult would never be freed.
     - If the blocked computation was re-entered, the thread would
       find an unitialized stack slot for the StgAsyncIOResult,
       leading to a crash reading its fields, or freeing the pointer.
    
    We fix this by removing the StgAsyncIOResult altogether and writing
    the result directly to the stack.
    
    Fixes #26341
Loading