[GHC] #16182: Retainer Profiling is broken

#16182: Retainer Profiling is broken -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.3 Keywords: profiling | Operating System: Unknown/Multiple Architecture: | Type of failure: Runtime crash Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- I had a large program which I was trying to profile, and I noticed that the program always ran into a segfault when running with `+RTS -hr`. I was able to able to reliably get segfaults in both the `warp-tls` and `http- client-tls` packages, as well as a third large and independent package with essentially no overlapping dependencies. This led me to believe that the bug is in the retainer profiler itself, and is not (much) dependent on the code being profiled. To that point, I was able to reproduce the bug with the `bytestring` test suites. I've modified bytestring (attached) enough to make it compile with GHC 8.6.3*. To reproduce the segfault, run {{{ $ stack build --profile $ stack exec prop-compiled -- +RTS -hr }}} * Renamed the package to bytestring2 to avoid circular packages. * Removed a duplicate instance in tests/QuickCheckUtils.hs * Changed all test-suites to executables in the cabal file so that they could be compiled with profiling. I have confirmed the problem on Linux (Ubuntu 18.04), where prop-compiled quickly segfaults, and on Windows 10, where the program just hangs. [I observed the same behavior in all the other programs I tested: Linux sefaulted, and Windows just hung.] -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16182 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16182: Retainer Profiling is broken -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.3 Resolution: | Keywords: profiling Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by crockeea): * Attachment "bytestring-0.10.8.2.zip" added. modified bytestring to easily demonstrate bug -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16182 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16182: Retainer Profiling is broken -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.3 Resolution: | Keywords: profiling Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): There have been a number of issues fixed in the profiler recently. Could you try with a recent build of GHC? You can download a generic linux bindist from here: https://gitlab.haskell.org/ghc/ghc/-/jobs/11660 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16182#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16182: Retainer Profiling is broken -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.3 Resolution: | Keywords: profiling Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by crockeea: Old description:
I had a large program which I was trying to profile, and I noticed that the program always ran into a segfault when running with `+RTS -hr`. I was able to able to reliably get segfaults in both the `warp-tls` and `http-client-tls` packages, as well as a third large and independent package with essentially no overlapping dependencies. This led me to believe that the bug is in the retainer profiler itself, and is not (much) dependent on the code being profiled. To that point, I was able to reproduce the bug with the `bytestring` test suites.
I've modified bytestring (attached) enough to make it compile with GHC 8.6.3*. To reproduce the segfault, run
{{{ $ stack build --profile $ stack exec prop-compiled -- +RTS -hr }}}
* Renamed the package to bytestring2 to avoid circular packages. * Removed a duplicate instance in tests/QuickCheckUtils.hs * Changed all test-suites to executables in the cabal file so that they could be compiled with profiling.
I have confirmed the problem on Linux (Ubuntu 18.04), where prop-compiled quickly segfaults, and on Windows 10, where the program just hangs. [I observed the same behavior in all the other programs I tested: Linux sefaulted, and Windows just hung.]
New description: I had a large program which I was trying to profile, and I noticed that the program always ran into a segfault when running with `+RTS -hr`. I was able to able to reliably get segfaults in both the `warp-tls` and `http- client-tls` packages, as well as a third large and independent package with essentially no overlapping dependencies. This led me to believe that the bug is in the retainer profiler itself, and is not (much) dependent on the code being profiled. To that point, I was able to reproduce the bug with the `bytestring` test suites. I've modified bytestring (attached) enough to make it compile with GHC 8.6.3. To reproduce the segfault, run {{{ $ stack build --profile $ stack exec prop-compiled -- +RTS -hr }}} I have confirmed the problem on Linux (Ubuntu 18.04), where prop-compiled quickly segfaults, and on Windows 10, where the program just hangs. [I observed the same behavior in all the other programs I tested: Linux segfaulted, and Windows just hung.] Changes to bytestring: 1. Renamed the package to bytestring2 to avoid circular packages. 2. Removed a duplicate instance in tests/QuickCheckUtils.hs 3. Changed all test-suites to executables in the cabal file so that they could be compiled with profiling. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16182#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16182: Retainer Profiling is broken -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.3 Resolution: | Keywords: profiling Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by crockeea): mpickering, I'm not able to build my example due to changes in GHC. Specifically, the `primitive` package fails to build, and that's not something I'm equipped to figure out. Perhaps you can try the attached example? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16182#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#16182: Retainer Profiling is broken -------------------------------------+------------------------------------- Reporter: crockeea | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.6.3 Resolution: fixed | Keywords: profiling Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => fixed * milestone: => 8.8.1 Comment: I cannot reproduce this using GHC 8.7.20190114 and [https://github.com/hvr/head.hackage/tree/60d797cd2e94757d65d2ca43121d7540a61... head.hackage]'s patches for `primitive` //et al.//: {{{ $ cabal new-exec prop-compiled -- +RTS -hr ... Properties Total Passed 582 582 Failed 49 49 Total 631 631 }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/16182#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC