[GHC] #7680: -prof build: trying to 'show' a 'Double' leads to 'Char.intToDigit: not a digit' crash

GHC cvs-ghc at haskell.org
Mon Feb 11 11:14:21 CET 2013


#7680: -prof build: trying to 'show' a 'Double' leads to 'Char.intToDigit: not a
digit' crash
-----------------------------+----------------------------------------------
Reporter:  slyfox            |          Owner:                
    Type:  bug               |         Status:  new           
Priority:  normal            |      Component:  Compiler      
 Version:  7.6.2             |       Keywords:                
      Os:  Unknown/Multiple  |   Architecture:  x86_64 (amd64)
 Failure:  None/Unknown      |      Blockedby:                
Blocking:                    |        Related:                
-----------------------------+----------------------------------------------
 The source is very simple:

 {{{
 main :: IO ()
 main = putStrLn $ show (1 :: Double)
 }}}

   Run as:
       ghc --make double.hs -prof -fforce-recomp -o double.buggy &&
 ./double.buggy
   Dies as:
       [1 of 1] Compiling Main             ( 144.hs, 144.o )
       Linking double.buggy ...
       double.buggy: Char.intToDigit: not a digit 7488688

 It's an amd64 gentoo linux with **gcc-4.7.2**.
 Core i7 system with avx support.

 If I drop **-prof** the bug goes away.
 If I change **Double** to **Float**, **Int**, **Integer** the bug goes
 away.

 I might have miscompiled RTS or something.
 Which is the best way to verify?

 {{{
  [("Project name","The Glorious Glasgow Haskell Compilation System")
  ,("GCC extra via C opts"," -fwrapv")
  ,("C compiler command","x86_64-pc-linux-gnu-gcc")
  ,("C compiler flags"," -fno-stack-protector  -Wl,--hash-size=31 -Wl
 ,--reduce-memory-overheads")
  ,("ar command","/usr/bin/ar")
  ,("ar flags","q")
  ,("ar supports at file","YES")
  ,("touch command","touch")
  ,("dllwrap command","/bin/false")
  ,("windres command","/bin/false")
  ,("perl command","/usr/bin/perl")
  ,("target os","OSLinux")
  ,("target arch","ArchX86_64")
  ,("target word size","8")
  ,("target has GNU nonexec stack","True")
  ,("target has .ident directive","True")
  ,("target has subsections via symbols","False")
  ,("LLVM llc command","/usr/bin/llc")
  ,("LLVM opt command","/usr/bin/opt")
  ,("Project version","7.6.2")
  ,("Booter version","7.6.2")
  ,("Stage","2")
  ,("Build platform","x86_64-unknown-linux")
  ,("Host platform","x86_64-unknown-linux")
  ,("Target platform","x86_64-unknown-linux")
  ,("Have interpreter","YES")
  ,("Object splitting supported","YES")
  ,("Have native code generator","YES")
  ,("Support SMP","YES")
  ,("Unregisterised","NO")
  ,("Tables next to code","YES")
  ,("RTS ways","l debug  thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn
 thr_debug_dyn")
  ,("Leading underscore","NO")
  ,("Debug on","False")
  ,("LibDir","/usr/lib64/ghc-7.6.2")
  ,("Global Package DB","/usr/lib64/ghc-7.6.2/package.conf.d")
  ,("Gcc Linker flags","[\"-Wl,--hash-size=31\",\"-Wl,--reduce-memory-
 overheads\"]")
  ,("Ld Linker flags","[\"--hash-size=31\",\"--reduce-memory-overheads\"]")
  ]
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7680>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the ghc-tickets mailing list