[GHC] #11296: T8726 fails on arm
#11296: T8726 fails on arm -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Keywords: | Operating System: Linux Architecture: arm | Type of failure: Incorrect result | at runtime Test Case: T8726 | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{ cd ./numeric/should_run && ./T8726 </dev/null > T8726.run.stdout 2> T8726.run.stderr Wrong exit code (expected 0 , actual 1 ) Stdout: Stderr: T8726: user error (divMod0 -2 79228162514264337593543950336) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11296> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11296: T8726 fails on arm -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Incorrect result | Test Case: T8726 at runtime | Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Hmmm... {{{#!hs n,d :: Integer (n,d) = (-2, 79228162514264337593543950337) f :: Integer -> Integer -> Integer f n d = (n `div` d) * d + (n `mod` d) main :: IO () main = let r = f n d in print (n, r, r-n, r==n, r/=n) }}} results in, {{{ $ inplace/bin/ghc-stage2 -O Hello.hs [1 of 1] Compiling Main ( Hello.hs, Hello.o ) Linking Hello ... $ ./Hello (-2,-2,0,False,True) }}} What a world we live in. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11296#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11296: T8726 fails on arm -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Incorrect result | Test Case: T8726 at runtime | Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by hvr): More trimmed down repro-case: {{{#!hs {-# LANGUAGE MagicHash #-} {-# OPTIONS_GHC -O0 #-} import GHC.Integer.GMP.Internals import GHC.Exts main :: IO () main = do print (x, isValidInteger x) print (y, isValidInteger y) print (z, isValidInteger z) -- reports (-2,False) on 32bit where z = x + y x = 0x0ffffffffffffffffffffffff :: Integer -- 3 limbs y = -0x1000000000000000000000001 :: Integer -- 4 limbs isValidInteger i = isTrue# (isValidInteger# i) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11296#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11296: T8726 fails on arm -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: new Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Incorrect result | Test Case: T8726 at runtime | Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): The first bad commit appears to be, {{{ commit 9e8562ae02701270e2c1dfcee3279d862dc5b7b6 Author: Ben Gamari <bgamari.foss@gmail.com> Date: Fri Aug 21 10:37:39 2015 +0200 Implement getSizeofMutableByteArrayOp primop Now since ByteArrays are mutable we need to be more explicit about when the size is queried. Test Plan: Add testcase and validate Reviewers: goldfire, hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1139 GHC Trac Issues: #9447 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11296#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11296: T8726 fails on arm -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Incorrect result | Test Case: T8726 at runtime | Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1707 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D1707 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11296#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11296: T8726 fails on arm -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Incorrect result | Test Case: T8726 at runtime | Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1707 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"11778f74da669b13e3748191e89e3c3cafed903b/ghc" 11778f7/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="11778f74da669b13e3748191e89e3c3cafed903b" Add testcase for getSizeofMutableByteArray# In an attempt to track down #11296. Unfortunately the primop appears to be working as expected. Test Plan: validate Reviewers: hvr, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1706 GHC Trac Issues: #11296 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11296#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11296: T8726 fails on arm -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: | Keywords: Operating System: Linux | Architecture: arm Type of failure: Incorrect result | Test Case: T8726 at runtime | Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1707 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"07b3be76a14a061a43846ef41f1dd7819603be4e/ghc" 07b3be76/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="07b3be76a14a061a43846ef41f1dd7819603be4e" integer-gmp: Fix #11296 This was introduced by a mental fumble in 9e8562ae02701270e2c1dfcee3279d862dc5b7b6 wherein I replaced `getSizeofMutableByteArray` with `getSizeofMutBigNat`. This was noticed by invalid integers being produced on 32-bit machines in #11296. Test Plan: Validate Reviewers: hvr, goldfire, austin Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1707 GHC Trac Issues: #11296 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11296#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11296: T8726 fails on arm -------------------------------------+------------------------------------- Reporter: bgamari | Owner: bgamari Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler | Version: 7.10.3 Resolution: fixed | Keywords: Operating System: Linux | Architecture: arm Type of failure: Incorrect result | Test Case: T8726 at runtime | Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1707 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11296#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC