Ticket #5475 (closed bug: fixed)

Opened 21 months ago

Last modified 19 months ago

Unthrown exceptions

Reported by: daniel.is.fischer Owned by: igloo
Priority: high Milestone: 7.4.1
Component: Compiler Version: 7.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

With today's HEAD, I got five unexpected failures because some exceptions weren't thrown as they should've been:

   ../../libraries/stm/tests  stm060 [bad stdout] (hpc)
   codeGen/should_run         cgrun059 [bad exit code] (hpc,optasm,threaded2,dyn)

Change History

Changed 19 months ago by igloo

  • owner set to simonpj
  • priority changed from normal to high
  • milestone set to 7.4.1

Hmm, with q.hs:

module Main (main) where

main :: IO ()
main = do local <- testPackage
          case (local, False) of
               ([x], _)     -> putStrLn "X"
               (_,   True)  -> putStrLn "Y"
               ([],  False) -> error "A"
               (as,  bs)    -> error "B"
    
testPackage :: IO [Int]
testPackage = return []

and HEAD I get:

$ ghc -fforce-recomp -dcore-lint -dcmm-lint -O --make q
[1 of 1] Compiling Main             ( q.hs, q.o )
Linking q ...
$ ./q
$ echo $?
0

Changed 19 months ago by igloo

(and expected q: A on stderr, and exit code 1)

Changed 19 months ago by simonpj@…

commit b8abb31f649f0b3eeb691f92a8310b73c520658e

Author: Simon Peyton Jones <simonpj@microsoft.com>
Date:   Wed Nov 9 21:56:50 2011 +0000

    Fix Trac #5475: another bug in exprArity
    
    As usual it was to do with the handling of bottoms,
    but this time it wasn't terribly subtle; I was using
    andArityType (which is designed for case branches) as
    a cheap short cut for the arity trimming needed with
    a cast.  That did the Wrong Thing for bottoming
    expressions.  Sigh.

 compiler/coreSyn/CoreArity.lhs    |   27 ++++++++++++++++-----------
 compiler/simplCore/SimplUtils.lhs |    2 +-
 2 files changed, 17 insertions(+), 12 deletions(-)

Changed 19 months ago by simonpj

  • owner changed from simonpj to igloo

Nice bug thank you. I'm travelling with a slow laptop so I can't do a full validate, but I'm pretty sure this fix will be fine. Ian can you check?

Also can you add a regression test? I wasn't sure how to add one that expects a non-zero exit code. Moreover Windows prints "T5475.exe: A" whereas presumably Unix will not print the "exe" part. thanks

Simon

Changed 19 months ago by daniel.is.fischer

cgrun059 passes now all ways, stm060 passed already before.

Changed 19 months ago by igloo

  • status changed from new to closed
  • resolution set to fixed

passes here too, and cgrun059 already tests this bug, so no need to add a new testcase.

Note: See TracTickets for help on using tickets.