[GHC] #12855: ghc-8.0.2_rc1 inlines string literals too aggressively, breaks tests of http-client-0.4.30

#12855: ghc-8.0.2_rc1 inlines string literals too aggressively, breaks tests of http-client-0.4.30 -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- GHC version 8.0.1.20161117 {{{#!hs -- $ cat BodySpec.hs -- $ ghc --make -O1 -package={base,bytestring} BodySpec.hs -o a && ./a {- # OPTIONS_GHC -Wall -Werror #-} module Main (main) where import qualified Data.ByteString as S import qualified Data.ByteString.Char8 as S8 main :: IO () main = (S8.concat (map S.singleton (S.unpack (S8.pack "<foo>"))) == S8.empty) `seq` return () }}} {{{ $ ghc --make -O1 -package={base,bytestring} BodySpec.hs -o a && ./a Segmentation fault (core dumped) }}} The cause is similar to #12757: low-level optimisations inline string literal (or it's wrapping value? i don't know) in multiple places. That breaks pinter-chasing in bytestring package. {{{ $ strings a | fgrep '<foo>' <foo> <foo> <foo> <foo> }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12855 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12855: ghc-8.0.2_rc1 inlines string literals too aggressively, breaks tests of http-client-0.4.30 -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by slyfox: @@ -24,1 +24,1 @@ - breaks pinter-chasing in bytestring package. + breaks pointer-chasing in bytestring package. New description: GHC version 8.0.1.20161117 {{{#!hs -- $ cat BodySpec.hs -- $ ghc --make -O1 -package={base,bytestring} BodySpec.hs -o a && ./a {- # OPTIONS_GHC -Wall -Werror #-} module Main (main) where import qualified Data.ByteString as S import qualified Data.ByteString.Char8 as S8 main :: IO () main = (S8.concat (map S.singleton (S.unpack (S8.pack "<foo>"))) == S8.empty) `seq` return () }}} {{{ $ ghc --make -O1 -package={base,bytestring} BodySpec.hs -o a && ./a Segmentation fault (core dumped) }}} The cause is similar to #12757: low-level optimisations inline string literal (or it's wrapping value? i don't know) in multiple places. That breaks pointer-chasing in bytestring package. {{{ $ strings a | fgrep '<foo>' <foo> <foo> <foo> <foo> }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12855#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12855: ghc-8.0.2_rc1 inlines string literals too aggressively, breaks tests of http-client-0.4.30 -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12757 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => duplicate * related: => #12757 Comment: This is another case of #12757. Unfortunately, it seems that the fix for #11158 wasn't present in the 8.0.2-rc1 release due to a silly mistake on my part. I've confirmed that merging the patch for #11158 to `ghc-8.0` resolves this crash. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12855#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12855: ghc-8.0.2_rc1 inlines string literals too aggressively, breaks tests of http-client-0.4.30 -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12757 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): Thanks for the reduced testcase, slyfox! This will be a great addition to the testsuite. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12855#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12855: ghc-8.0.2_rc1 inlines string literals too aggressively, breaks tests of http-client-0.4.30 -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12757 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by slyfox): I'm a bit lost here. Can you clarify which commit in ghc-8.0 branch should fix it? I will apply it locally to -rc1 and try to rebuild ghc. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12855#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12855: ghc-8.0.2_rc1 inlines string literals too aggressively, breaks tests of http-client-0.4.30 -------------------------------------+------------------------------------- Reporter: slyfox | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: duplicate | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #12757 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): slyfox, see 58d9f9b7a7f1b4d2c94183b9b9428983e7c83fe9. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12855#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12855: ghc-8.0.2_rc1 inlines string literals too aggressively, breaks tests of
http-client-0.4.30
-------------------------------------+-------------------------------------
Reporter: slyfox | Owner:
Type: bug | Status: closed
Priority: normal | Milestone: 8.0.2
Component: Compiler | Version: 8.0.1
Resolution: duplicate | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #12757 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari
participants (1)
-
GHC