Skip to content

Unthreaded RTS incorrectly attributes time to safe foreign calls

Currently the following program reports CPU time being spent in the MAIN cost centre when run using the non-threaded runtime. This is true despite the program being blocked in a safe foreign call:

{-# LANGUAGE ForeignFunctionInterface #-}

foreign import ccall safe "sleep" sleep :: Int -> IO ()

main = sleep 42

This disagrees with both the specification of the profiler's behavior and the threaded runtime.

Edited by Ben Gamari
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information