#7680 closed bug (invalid)

-prof build: trying to 'show' a 'Double' leads to 'Char.intToDigit: not a digit' crash

Reported by: slyfox Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: x86_64 (amd64)
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

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\"]")
 ]

Change History (5)

comment:1 Changed 14 months ago by simonpj

  • Difficulty set to Unknown

Does anyone feel able to investigate/characterise this report further? Thanks!

Simon

comment:2 Changed 14 months ago 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

comment:3 Changed 13 months ago by igloo

I can't reproduce this with 7.6.2 on Linux/x86_64 either.

comment:4 Changed 13 months ago 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.

comment:5 Changed 13 months ago by slyfox

  • Resolution set to invalid
  • Status changed from new to closed

Rebuilt ghc with gcc-7.4.2-r1 (gentoo's fix for gcc)
and can't reproduce failure anymore.

Sorry for the noise.

Note: See TracTickets for help on using tickets.