[GHC] #8159: Uses of Binary decode should have a proper error message

#8159: Uses of Binary decode should have a proper error message -------------------------------------------+------------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.6.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Easy (less than 1 hour) | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: -------------------------------------------+------------------------------- In #8144 I changed the interface file format. That can happen without you noticing because it just uses the Binary instance. To deserialize it, we also use Binary. When that fails, the error message is {{{ Binary.get(Usage): 50 }}} The error message should at least also mention: {{{ Reading the interface file failed }}} This is not a specific problem with interface files (it is actually a minor problem there since ghc will refrain from reading .hi files created by an older version), but it is in development, and independent from that, all uses of Binary decode should be guarded as it is a very partial function. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8159 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8159: Uses of Binary decode should have a proper error message -------------------------------+------------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.6.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Easy (less than 1 hour) Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | Blocking: | -------------------------------+------------------------------------------- Comment (by adamgundry): It would be nice to give this a better error message that explains what is going on. I quite often get messages like this when changing the interface file format: {{{ ghc-stage2: panic! (the 'impossible' happened) (GHC version 7.7.20130821 for i386-unknown-linux): Ix{Int}.index: Index (4352) out of range ((0,582)) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8159#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC