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

#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

#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 | Milestone: Component: Compiler | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: x86_64 (amd64) | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -------------------------------+-------------------------------------------- Changes (by simonpj): * difficulty: => Unknown Comment: Does anyone feel able to investigate/characterise this report further? Thanks! Simon -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7680#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 | Milestone: Component: Compiler | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: x86_64 (amd64) | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -------------------------------+-------------------------------------------- Comment(by wwiser): Seems to work fine in HEAD: {{{ ./ghc-stage2 --make Main.hs -prof -fforce-recomp -o Main.buggy && ./Main.buggy [1 of 1] Compiling Main ( Main.hs, Main.o ) Linking Main.buggy ... 1.0 }}} Ubuntu 12.10 64-bit, i7, gcc 4.7.2 -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7680#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 | Milestone: Component: Compiler | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: x86_64 (amd64) | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -------------------------------+-------------------------------------------- Comment(by igloo): I can't reproduce this with 7.6.2 on Linux/x86_64 either. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7680#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#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 | Milestone: Component: Compiler | Version: 7.6.2 Keywords: | Os: Unknown/Multiple Architecture: x86_64 (amd64) | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | -------------------------------+-------------------------------------------- Comment(by slyfox): My '''mk/build.mk''': {{{ # Gentoo changes docdir = /usr/share/doc/ghc-7.6.2 htmldir = /usr/share/doc/ghc-7.6.2 SRC_HC_OPTS+= -optc-march=corei7-avx -opta-march=corei7-avx -optc- mtune=corei7-avx -opta-mtune=corei7-avx -optc-ggdb -optl-Wl,--hash- style=gnu -optc-Wa,--noexecstack -opta-Wa,--noexecstack SRC_CC_OPTS+=-march=corei7-avx -mtune=corei7-avx -O2 -pipe -ggdb -march=corei7-avx -march=corei7-avx -mtune=corei7-avx -mtune=corei7-avx -ggdb -Wa,--noexecstack -Wa,--noexecstack SRC_LD_OPTS+= -Wl,--hash-style=gnu BUILD_DOCBOOK_PDF = NO BUILD_DOCBOOK_PS = NO BUILD_DOCBOOK_HTML = NO HADDOCK_DOCS = NO SRC_HC_OPTS+=-w GhcWithLlvmCodeGen=NO INTEGER_LIBRARY=integer-gmp }}} I guess -march breaks some RTS bits. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7680#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#7680: -prof build: trying to 'show' a 'Double' leads to 'Char.intToDigit: not a digit' crash -------------------------------+-------------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.2 Resolution: invalid | Keywords: Os: Unknown/Multiple | Architecture: x86_64 (amd64) Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Changes (by slyfox): * status: new => closed * resolution: => invalid Comment: Rebuilt ghc with gcc-7.4.2-r1 (gentoo's fix for gcc) and can't reproduce failure anymore. Sorry for the noise. -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7680#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC