[GHC] #11317: Test prog003 fails with segfault on Windows (GHCi)

#11317: Test prog003 fails with segfault on Windows (GHCi)
--------------------------------------+-------------------------------
Reporter: rdragon | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: GHCi | Version: 7.11
Keywords: | Operating System: Windows
Architecture: x86_64 (amd64) | Type of failure: GHCi crash
Test Case: | Blocked By:
Blocking: | Related Tickets: #11234
Differential Rev(s): | Wiki Page:
--------------------------------------+-------------------------------
On my `x86_64` Windows machine test `prog003` fails with a segfault:
{{{
cd ./ghci/prog003 && ghciWayFlags=-static HC="/home/Rik/ghc/inplace/bin
/ghc-stage2.exe" HC_OPTS="-dcore-lint -dcmm-lint -dno-debug-output -no-
user-package-db -rtsopts -fno-warn-tabs -fno-warn-missed-specialisations
-fno-ghci-history " "/home/Rik/ghc/inplace/bin/ghc-stage2.exe" -dcore-lint
-dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-warn-tabs
-fno-warn-missed-specialisations -fno-ghci-history --interactive -v0
-ignore-dot-ghci +RTS -I0.1 -RTS

#11317: Test prog003 fails with segfault on Windows (GHCi) -------------------------------+-------------------------------------- Reporter: rdragon | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: #11234 | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Changes (by thomie): * cc: Phyx- (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11317: Test prog003 fails with segfault on Windows (GHCi) -------------------------------+-------------------------------------- Reporter: rdragon | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: Operating System: Windows | Architecture: x86_64 (amd64) Type of failure: GHCi crash | Test Case: Blocked By: | Blocking: Related Tickets: #11234 | Differential Rev(s): Wiki Page: | -------------------------------+-------------------------------------- Comment (by Phyx-): That's peculiar.. When I ran the tests after #11234 it was working. In anycase, making a `devel2` build should compile the RTS with symbols. Instructions for debugging are [https://ghc.haskell.org/trac/ghc/wiki/Debugging/CompiledCode?redirectedfrom=... here] I will try to reproduce, thanks for the report! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11317: Test prog003 fails with segfault on Windows (GHCi) ---------------------------------+---------------------------------------- Reporter: rdragon | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: GC Operating System: Windows | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: prog003 Blocked By: | Blocking: Related Tickets: #11234 #3408 | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by Phyx-): * keywords: => GC * testcase: => prog003 * architecture: x86_64 (amd64) => Unknown/Multiple * related: #11234 => #11234 #3408 Comment: This seems like it's related to #3408. The `GC` timeout `-I` is at fault. The default timeout for Windows was changed to 5secs in https://github.com/ghc/ghc/blob/master/ghc/hschooks.c#L42 to avoid issues with the `GC` and `haskeline` on Windows. Coincidentally I don't know why this was done there (which is rather hidden) rather than in `RtsFlags.c`. The helptext for RTS opts is also wrong (says the default is 0.3s for all platforms). In any case, the test is setting a value so low that it's causing a segfault. On a normal run the GC ends with {{{ Memory inventory: gen 0 blocks : 16 blocks ( 0.1 MB) gen 1 blocks : 5541 blocks ( 21.6 MB) nursery : 5379 blocks ( 21.0 MB) retainer : 0 blocks ( 0.0 MB) arena blocks : 0 blocks ( 0.0 MB) exec : 1 blocks ( 0.0 MB) free : 1411 blocks ( 5.5 MB) total : 12348 blocks ( 48.2 MB) 84f44: cap 0: all caps stopped for GC 84f44: cap 0: finished GC 84f44: exitHpc 84f44: cap 0: shutting down }}} but when it segfaults {{{ Memory inventory: gen 0 blocks : 51 blocks ( 0.2 MB) gen 1 blocks : 5470 blocks ( 21.4 MB) nursery : 5202 blocks ( 20.3 MB) retainer : 0 blocks ( 0.0 MB) arena blocks : 0 blocks ( 0.0 MB) exec : 1 blocks ( 0.0 MB) free : 3388 blocks ( 13.2 MB) total : 14112 blocks ( 55.1 MB) 84cd4: cap 0: all caps stopped for GC 84cd4: cap 0: finished GC }}} So GC does finish, but something happens between then and `exitHpc` -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11317: Test prog003 fails with segfault on Windows (GHCi)
---------------------------------+----------------------------------------
Reporter: rdragon | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: GHCi | Version: 7.11
Resolution: | Keywords: GC
Operating System: Windows | Architecture: Unknown/Multiple
Type of failure: GHCi crash | Test Case: prog003
Blocked By: | Blocking:
Related Tickets: #11234 #3408 | Differential Rev(s):
Wiki Page: |
---------------------------------+----------------------------------------
Comment (by Tamar Christina

#11317: Test prog003 fails with segfault on Windows (GHCi) ---------------------------------+---------------------------------------- Reporter: rdragon | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: fixed | Keywords: GC Operating System: Windows | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: prog003 Blocked By: | Blocking: Related Tickets: #11234 #3408 | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by Phyx-): * status: new => closed * resolution: => fixed Comment: This commit seems to fix `prog003` as well. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11317: Test prog003 fails with segfault on Windows (GHCi) ---------------------------------+---------------------------------------- Reporter: rdragon | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: GC Operating System: Windows | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: prog003 Blocked By: | Blocking: Related Tickets: #11234 #3408 | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by bgamari): * status: closed => new * resolution: fixed => -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11317: Test prog003 fails with segfault on Windows (GHCi)
---------------------------------+----------------------------------------
Reporter: rdragon | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: GHCi | Version: 7.11
Resolution: | Keywords: GC
Operating System: Windows | Architecture: Unknown/Multiple
Type of failure: GHCi crash | Test Case: prog003
Blocked By: | Blocking:
Related Tickets: #11234 #3408 | Differential Rev(s):
Wiki Page: |
---------------------------------+----------------------------------------
Comment (by Ben Gamari

#11317: Test prog003 fails with segfault on Windows (GHCi) ---------------------------------+---------------------------------------- Reporter: rdragon | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: GC Operating System: Windows | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: prog003 Blocked By: | Blocking: Related Tickets: #11234 #3408 | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by bgamari): This failure is actually quite flaky. It seems to fail most of the time, but occasionally doesn't. Unfortunately gdb isn't of much help here, {{{ GHCi, version 8.1.20161216: http://www.haskell.org/ghc/ :? for help [New Thread 7512.0xb0c] Warning: ignoring unrecognised input `prog003.script' Prelude> :script prog003.script [1 of 1] Compiling Main ( shell.hs, interpreted ) Ok, modules loaded: Main. Run 1 [1 of 4] Compiling D ( D.hs, interpreted ) [2 of 4] Compiling C ( C.hs, interpreted ) [3 of 4] Compiling B ( B.hs, interpreted ) [4 of 4] Compiling A ( A.hs, interpreted ) Ok, modules loaded: A, B, C, D. a :: Int -> Int 168 Run 2 [1 of 4] Compiling D ( D.hs, interpreted ) [2 of 4] Compiling C ( C.hs, interpreted ) [D changed] [3 of 4] Compiling B ( B.hs, interpreted ) [D changed] [4 of 4] Compiling A ( A.hs, interpreted ) [B changed] Ok, modules loaded: A, B, C, D. (A.a,B.b,C.c,D.d) :: (Float -> Float, Float -> Float, Float -> Float, Float -> Float) 28.0 Run 3 Ok, modules loaded: A, B, C, D. (A.a,B.b,C.c,D.d) :: (Float -> Float, Float -> Float, Float -> Float, Float -> Float) 28.0 Run 4 [2 of 4] Compiling C ( C.hs, interpreted ) [3 of 4] Compiling B ( B.hs, interpreted ) [4 of 4] Compiling A ( A.hs, interpreted ) Ok, modules loaded: A, B, C, D (D.o). (A.a,B.b,C.c,D.d) :: (Float -> Float, Float -> Float, Float -> Float, Float -> Float) 28.0 Run 5 [3 of 4] Compiling B ( B.hs, interpreted ) [4 of 4] Compiling A ( A.hs, interpreted ) Ok, modules loaded: A, B, C (C.o), D (D.o). (A.a,B.b,C.c,D.d) :: (Float -> Float, Float -> Float, Float -> Float, Float -> Float) 28.0 Run 6 [4 of 4] Compiling A ( A.hs, interpreted ) Ok, modules loaded: A, B (B.o), C (C.o), D (D.o). (A.a,B.b,C.c,D.d) :: (Float -> Float, Float -> Float, Float -> Float, Float -> Float) 28.0 Run 7 Program received signal SIGSEGV, Segmentation fault. 0x000000000af36d2f in ?? () (gdb) bt #0 0x000000000af36d2f in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?) (gdb) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11317: Test prog003 fails with segfault on Windows (GHCi)
---------------------------------+----------------------------------------
Reporter: rdragon | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: GHCi | Version: 7.11
Resolution: | Keywords: GC
Operating System: Windows | Architecture: Unknown/Multiple
Type of failure: GHCi crash | Test Case: prog003
Blocked By: | Blocking:
Related Tickets: #11234 #3408 | Differential Rev(s):
Wiki Page: |
---------------------------------+----------------------------------------
Comment (by Tamar Christina

#11317: Test prog003 fails with segfault on Windows (GHCi) ---------------------------------+---------------------------------------- Reporter: rdragon | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: GC Operating System: Windows | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: prog003 Blocked By: | Blocking: Related Tickets: #11234 #3408 | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by mnislaih): * cc: mnislaih (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11317: Test prog003 fails with segfault on Windows (GHCi) ---------------------------------+---------------------------------------- Reporter: rdragon | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: GC Operating System: Windows | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: prog003 Blocked By: | Blocking: Related Tickets: #11234 #3408 | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by bmjames): * cc: bmjames (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11317: Test prog003 fails with segfault on Windows (GHCi) ---------------------------------+---------------------------------------- Reporter: rdragon | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: GC Operating System: Windows | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: prog003 Blocked By: | Blocking: Related Tickets: #11234 #3408 | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by alexandersgreen): * cc: alexandersgreen (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:12 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11317: Test prog003 fails with segfault on Windows (GHCi) ---------------------------------+---------------------------------------- Reporter: rdragon | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: GC Operating System: Windows | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: prog003 Blocked By: | Blocking: Related Tickets: #11234 #3408 | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Changes (by meteficha): * cc: meteficha (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:13 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11317: Test prog003 fails with segfault on Windows (GHCi) ---------------------------------+---------------------------------------- Reporter: rdragon | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: GC Operating System: Windows | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: prog003 Blocked By: | Blocking: Related Tickets: #11234 #3408 | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by mnislaih): We are seeing segmentation faults (in Windows only) quite regularly while trying to run things in ghci, or even just off lens TH splices while compiling code. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:14 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11317: Test prog003 fails with segfault on Windows (GHCi) ---------------------------------+---------------------------------------- Reporter: rdragon | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: GHCi | Version: 7.11 Resolution: | Keywords: GC Operating System: Windows | Architecture: Unknown/Multiple Type of failure: GHCi crash | Test Case: prog003 Blocked By: | Blocking: Related Tickets: #11234 #3408 | Differential Rev(s): Wiki Page: | ---------------------------------+---------------------------------------- Comment (by Phyx-): Hi, do you have a small example where this occurs? prog003 is quote hard to debug due to the shell interactions. If you have a Haskell only example could you report it under a new issue? Thanks! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11317#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC