
#14675: GHC 8.4.1 regression: segfault when loading doctest on a module with ANNs on Ubuntu 16.04 or later -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: alpmestan Type: bug | Status: new Priority: highest | Milestone: 8.4.1 Component: GHC API | Version: 8.4.1-alpha1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: #14603 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by alpmestan): I ended up chasing down the problem with `gdb` a little bit but didn't really know where to break and stepping through everything was just not conceivable so I ended up going about it the good old way, by printing a bunch of things along the code path that leads to the error. Long story short, it looks like the `unsafeCoerce#` from `compiler/typecheck/TcSplice.hs:convertAnnotationWrapper` is the cause of the segfault. And the content of the annotation doesn't seem to matter, even `{-# ANN module () #-}` makes the program crash. You can see [https://gist.github.com/alpmestan/145fc5783f00bab9214b7302418aef49 here] my variant of `convertAnnotationWrapper` that prints a bunch of things all along, as well as the relevant section of the output (the "trace"). The program never makes it to "unsafeCoerce# went fine". I will next try to look into what the value we're coercing actually represents and why it's not what we expect. If anyone has any tips for figuring that out quickly, I'm all ears :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14675#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler