Ticket #441 (closed bug: fixed)

Opened 8 years ago

Last modified 5 years ago

GHCi doesn't run computations in a new thread

Reported by: dons Owned by: simonmar
Priority: normal Milestone: 6.4.2
Component: GHCi Version: 6.4
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description (last modified by simonmar) (diff)

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

Attachments

T.2.hs Download (147 bytes) - added by dons 8 years ago.

Change History

Changed 8 years ago by dons

Changed 8 years ago by dons

  • summary changed from QuickCheck induced panic on :reload to GHCi doesn't run computations in a new thread

Changed 8 years ago by dons

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 ]

Changed 8 years ago by simonpj

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

Changed 7 years ago by simonmar

  • summary changed from QuickCheck induced panic on :reload to GHCi doesn't run computations in a new thread

Changed 7 years ago by simonmar

  • owner changed from nobody to simonmar
  • severity changed from normal to minor
  • status changed from assigned to new
  • description modified (diff)
  • milestone set to 6.4.2

Changed 7 years ago by simonmar

  • status changed from new to closed
  • difficulty set to Unknown
  • resolution changed from None to fixed
  • os set to Unknown
  • architecture set to Unknown

Fixed, test is ghci/should_run/ghci014.

Related to #488.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.