[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 <CCS_SYSTEM>) at rts/RetainerProfile.c:1598 #174646 0x00000000059b48c7 in retain_small_bitmap (c_child_r=<optimized out>, c=0x4201ecaa20, bitmap=0, size=<optimized out>, p=0x4201ecaa50) at rts/RetainerProfile.c:1140 #174647 retain_PAP_payload (n_args=<optimized out>, payload=0x4201ecaa50, fun=<optimized out>, c_child_r=<optimized out>, pap=0x4201ecaa20) at rts/RetainerProfile.c:1334 #174648 retainClosure (c0=<optimized out>, cp0=cp0@entry=0x4203affe88, r0=r0@entry=0x6810bc0 <CCS_SYSTEM>) at rts/RetainerProfile.c:1598 }}} I don't understand how retainer profiler works yet. It has a stack, and a maxStack variable, but I don't understand why we sometimes push work to the stack and sometimes recurse, and maxStack seems to be unused. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15608#comment:3> 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 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