Menu

#501 GHCi doesn't run computations in a new thread

6.4
open
nobody
GHCi (16)
5
2005-12-02
2005-08-27
Don Stewart
No

A broken QuickCheck property cause ghci to panic after
reloading the module. Seen in stable and head branch.

paprika$ ghci T.hs
*Main> do_test
test : *
(0)
*Main> :reload
ghc-6.5: panic! (the `impossible' happened, GHC version
6.5):
<<loop>>

Please report it as a compiler bug to
glasgow-haskell-bugs@haskell.org,
or http://sourceforge.net/projects/ghc/.

Changing the property to check for empty lists causes
the test to pass, and reload to work fine.

-- Don Stewart

Discussion

  • Don Stewart

    Don Stewart - 2005-08-27

    Test case

     
  • Don Stewart

    Don Stewart - 2005-08-27

    Logged In: YES
    user_id=880987

    Here's the test case, since uploading files is annoying in
    sourceforge:

    import Test.QuickCheck.Batch

    prop_silly :: [()] -> Bool
    prop_silly xs = head xs == head xs

    do_test = runTests "test" defOpt [ run prop_silly ]

     
  • Simon Peyton Jones

    Logged In: YES
    user_id=50165

    Test.Quickcheck.Batch.run forks a "watcher" thread that
    sends a NonTermination exception to the parent; the idea is
    to time-out tests that run too long. The parent kills the
    watcher when the test completes.

    Sadly, the parent doesn't kill the watcher when the test itself
    throws an exception.

    So, two problems:

    1. The "run" in QuickCheck.Batch is wrong and should be
    fixed. I'm not sure who wrote it.

    2. GHCi itself can be killed by a thread spawned by an
    evaluation started by GHCi. That's really a bug; but I'm not
    sure about the best way to fix it.

    I'm going to leave this until Simon gets back from paternity
    leave!

    Simon

     
  • Simon Marlow

    Simon Marlow - 2005-12-02
    • summary: QuickCheck induced panic on :reload --> GHCi doesn't run computations in a new thread
     

Log in to post a comment.