
#12757: Compiled program segfaults at -O1 -------------------------------------+------------------------------------- Reporter: hvr | Owner: Type: bug | Status: new Priority: highest | Milestone: 8.0.2 Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: #11312, #12585 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Siarheit had some insight on this. The problem here is essentially that `bytestring` traverses a `ByteString` by walking until `currPtr == ( "literal"# +# length "literal"# )` where `currPtr` is initialized with `"literal"#`. This means that if `"literal"#` is inlined twice, you will end up with `currPtr` and `"literal"# +# length "literal"#` pointing into two separate chunks of memory, with who-knows-what in between. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12757#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler