Outputable instance for Unique sometimes generates null bytes
Steps to reproduce:
[ezyang@hs01 ghc-validate]$ inplace/bin/ghc-stage2 --interactive -package ghc
GHCi, version 7.9.20140805: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.5.0.0 ... linking ... done.
Loading package deepseq-1.3.0.2 ... linking ... done.
Loading package bytestring-0.10.4.0 ... linking ... done.
Loading package containers-0.5.5.1 ... linking ... done.
Loading package filepath-1.3.0.2 ... linking ... done.
Loading package old-locale-1.0.0.6 ... linking ... done.
Loading package time-1.4.2 ... linking ... done.
Loading package unix-2.7.0.2 ... linking ... done.
Loading package directory-1.2.1.0 ... linking ... done.
Loading package pretty-1.1.1.1 ... linking ... done.
Loading package process-1.2.0.0 ... linking ... done.
Loading package Cabal-1.21.0.0 ... linking ... done.
Loading package binary-0.7.1.0 ... linking ... done.
Loading package bin-package-db-0.0.0.0 ... linking ... done.
Loading package hoopl-3.10.0.1 ... linking ... done.
Loading package hpc-0.6.0.1 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package transformers-0.4.1.0 ... linking ... done.
Loading package ghc ... linking ... done.
Prelude> :m +Unique
Prelude Unique> :m +Outputable
Prelude Unique Outputable> :m +FastString
Prelude Unique Outputable FastString> :m +DynFlags
Prelude Unique Outputable FastString DynFlags> showSDoc (defaultDynFlags undefined) $ ppr (getUnique (mkFastString "foo"))
"\NUL3bS"
We should do something so this doesn't happen. Caused grief due to #9395 (closed)
Trac metadata
Trac field | Value |
---|---|
Version | 7.9 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |