Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

3 changed files:

Changes:

  • changelog.d/windows-rethrow-overlapped-exception
    1
    +section: rts
    
    2
    +synopsis: Rethrow exceptions in overlapped IO when using the WinIO IO manager.
    
    3
    +issues: #27283
    
    4
    +mrs: !15887
    
    5
    +
    
    6
    +description: {
    
    7
    +  This change was made to support WinIO in the network library; see https://github.com/haskell/network/issues/602.
    
    8
    +}

  • compiler/GHC/SysTools/Cpp.hs
    ... ... @@ -148,7 +148,7 @@ doCpp logger tmpfs dflags unit_env opts input_fn output_fn = do
    148 148
             -- and BUILD is the same as our HOST.
    
    149 149
     
    
    150 150
         let io_manager_defs =
    
    151
    -          [ "-D__IO_MANAGER_WINIO__=1" | isWindows ] ++
    
    151
    +          [ "-D__IO_MANAGER_WINIO__=2" | isWindows ] ++
    
    152 152
               [ "-D__IO_MANAGER_MIO__=1"               ]
    
    153 153
     
    
    154 154
         let sse_defs =
    

  • libraries/ghc-internal/src/GHC/Internal/Event/Windows.hsc
    ... ... @@ -690,7 +690,11 @@ withOverlappedEx mgr fname h async offset startCB completionCB = do
    690 690
                                  -- can go into an unbounded alertable wait.
    
    691 691
                                  delay <- runExpiredTimeouts mgr
    
    692 692
                                  registerAlertableWait delay
    
    693
    -                        return $ IOFailed Nothing
    
    693
    +                        -- Re-throw the original exception rather than
    
    694
    +                        -- returning IOFailed. This ensures that async
    
    695
    +                        -- exceptions (e.g. Timeout from System.Timeout)
    
    696
    +                        -- propagate correctly to their handlers.
    
    697
    +                        E.throw e
    
    694 698
             let runner = do debugIO $ (dbgMsg ":: waiting ") ++ " | "  ++ show lpol
    
    695 699
                             res <- readMVar signal `catch` cancel
    
    696 700
                             debugIO $ dbgMsg ":: signaled "