Skip to content

Stack overflow when using monad-unlift

I found that with the following simple program I could make runghc/ghci crash with *** Exception: stack overflow:

{{{ #!/usr/bin/env stack -- stack --resolver lts-7.1 --install-ghc runghc --package monad-unlift-0.2.0

{-# LANGUAGE FlexibleContexts #-}

import Control.Monad.Trans.Unlift

f :: (MonadBaseUnlift m IO) => m a f = do

_ <- askUnliftBase

return () }}}

I'm not super sure if that's OK. Probably not; even if it does trigger an undecideable case, shouldn't ghc tell me about it instead of just crashing?

The monad-unlift code used is here: https://github.com/fpco/monad-unlift/blob/adb7869adccc66247cbb1a6175277802e9c098e1/monad-unlift/Control/Monad/Trans/Unlift.hs

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC nh2
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information