[GHC] #15608: Segfault in retainer profiling

#15608: Segfault in retainer profiling -------------------------------------+------------------------------------- Reporter: osa1 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Profiling | Version: 8.5 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: -------------------------------------+------------------------------------- To reproduce, build ghc using "prof" flavor, then {{{ $ ghc-stage2 --interactive +RTS -hr GHCi, version 8.7.20180905: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/omer/rcbackup/.ghci λ:1> sequence_ (replicate 100000000 (return ())) zsh: segmentation fault (core dumped) ghc-stage2 --interactive +RTS -hr }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15608 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15608: Segfault in retainer profiling -------------------------------------+------------------------------------- Reporter: osa1 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Profiling | Version: 8.5 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 osa1: Old description:
To reproduce, build ghc using "prof" flavor, then
{{{ $ ghc-stage2 --interactive +RTS -hr GHCi, version 8.7.20180905: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/omer/rcbackup/.ghci λ:1> sequence_ (replicate 100000000 (return ())) zsh: segmentation fault (core dumped) ghc-stage2 --interactive +RTS -hr }}}
New description: To reproduce, build ghc using "prof" flavor, then {{{ $ ghc-stage2 --interactive +RTS -hr GHCi, version 8.7.20180905: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/omer/rcbackup/.ghci λ:1> sequence_ (replicate 100000000 (return ())) zsh: segmentation fault (core dumped) ghc-stage2 --interactive +RTS -hr }}} If I use debug runtime in stage2 compiler I can't even run the repl: {{{ haskell $ ghc-stage2 --interactive +RTS -hr rr: Saving execution to trace directory `/home/omer/.local/share/rr/ghc- stage2-13'. GHCi, version 8.7.20180906: http://www.haskell.org/ghc/ :? for help zsh: segmentation fault ghc-stage2 --interactive +RTS -hr }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15608#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15608: Segfault in retainer profiling -------------------------------------+------------------------------------- Reporter: osa1 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Profiling | Version: 8.5 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5134 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * differential: => Phab:D5134 Comment: I fixed a few bugs in Phab:D5134. There are still more bugs to fix until this works. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15608#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15608: Segfault in retainer profiling
-------------------------------------+-------------------------------------
Reporter: osa1 | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone: 8.6.1
Component: Profiling | Version: 8.5
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5134
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by osa1):
One of the problems is that because of recursive `retainClosure()` calls
retainer profiler sometimes fills the C stack. I currently see 14000+
stack frames because of this loop:
{{{
#174645 retainClosure
(c0=<optimized out>, cp0=cp0@entry=0x4201ecaa20, r0=r0@entry=0x6810bc0

#15608: Segfault in retainer profiling -------------------------------------+------------------------------------- Reporter: osa1 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Profiling | Version: 8.5 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5134 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari):
One of the problems is that because of recursive retainClosure() calls retainer profiler sometimes fills the C stack.
Note that this misfeature of the retainer profiler is being tracked as #14758. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15608#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15608: Segfault in retainer profiling -------------------------------------+------------------------------------- Reporter: osa1 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Profiling | Version: 8.5 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5134 Wiki Page: | -------------------------------------+------------------------------------- Comment (by MikolajKonarski): I see that Phab:D5134 is merged, but not to 8.4 branch. Could we milestone this to 8.4.5 once such milestone exists? Ömer says this should be rather safe to merge to 8.4. Thank you! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15608#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15608: Segfault in retainer profiling -------------------------------------+------------------------------------- Reporter: osa1 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.5 Component: Profiling | Version: 8.5 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5134 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.6.1 => 8.4.5 Comment: I am quite doubtful that there will be a 8.4.5 but nevertheless, done. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15608#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15608: Segfault in retainer profiling -------------------------------------+------------------------------------- Reporter: osa1 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.5 Component: Profiling | Version: 8.5 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5134 Wiki Page: | -------------------------------------+------------------------------------- Changes (by maoe): * cc: maoe (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15608#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15608: Segfault in retainer profiling -------------------------------------+------------------------------------- Reporter: osa1 | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.3 Component: Profiling | Version: 8.5 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5134 Wiki Page: | -------------------------------------+------------------------------------- Changes (by osa1): * milestone: 8.4.5 => 8.6.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15608#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15608: Segfault in retainer profiling -------------------------------------+------------------------------------- Reporter: osa1 | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.6.3 Component: Profiling | Version: 8.5 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5134 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => closed * resolution: => fixed * milestone: => 8.6.3 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15608#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC