[GHC] #8817: segmentation fault in 7.8 RC1

#8817: segmentation fault in 7.8 RC1 ----------------------------------+------------------------------------- Reporter: hamishmack | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 7.8.1-rc1 Keywords: | Operating System: Unknown/Multiple Architecture: x86_64 (amd64) | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | ----------------------------------+------------------------------------- I get a segmentation fault if I do the following on OS X... * cabal install cpphs --reinstall --force-reinstall --ghc-options=-rtsopts * cpphs +RTS -A16384 -RTS /usr/include/stdio.h Running in gdb the stack shows we are in stg_ap_0_fast and it looks like it is trying to dereference a pointer value of 0x5000500050000 that is in the rbx register. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8817 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8817: segmentation fault in 7.8 RC1 -------------------------------------+---------------------------------- Reporter: hamishmack | Owner: Type: bug | Status: new Priority: high | Milestone: Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Comment (by luite): Same problem on linux, tested on Ubuntu 12.04 amd64. Using -A4096 seems to make the program hang instead of producing a segmentation fault. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8817#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8817: segmentation fault in 7.8 RC1 -------------------------------------+---------------------------------- Reporter: hamishmack | Owner: Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Compiler | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Changes (by hvr): * milestone: => 7.8.1 Old description:
I get a segmentation fault if I do the following on OS X...
* cabal install cpphs --reinstall --force-reinstall --ghc- options=-rtsopts * cpphs +RTS -A16384 -RTS /usr/include/stdio.h
Running in gdb the stack shows we are in stg_ap_0_fast and it looks like it is trying to dereference a pointer value of 0x5000500050000 that is in the rbx register.
New description: I get a segmentation fault if I do the following on OS X... {{{ cabal install cpphs --reinstall --force-reinstall --ghc-options=-rtsopts cpphs +RTS -A16384 -RTS /usr/include/stdio.h }}} Running in gdb the stack shows we are in `stg_ap_0_fast` and it looks like it is trying to dereference a pointer value of `0x5000500050000` that is in the `rbx` register. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8817#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8817: segmentation fault in 7.8 RC1 -------------------------------------+---------------------------------- Reporter: hamishmack | Owner: simonmar Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Changes (by hvr): * cc: simonmar (added) * owner: => simonmar * component: Compiler => Runtime System Comment: I suspect this is actually GC/RTS related; when using `-A4096`, the output of `+RTS -S` looks as below (I had to `CTRL-C` as it won't stop otherwise): {{{ Alloc Copied Live GC GC TOT TOT Page Flts bytes bytes bytes user elap user elap 1256 1232 1224 0.00 0.00 0.00 0.00 0 0 (Gen: 0) 0 1208 1224 0.00 0.00 0.00 0.00 0 0 (Gen: 0) 0 0 1224 0.00 0.00 0.00 0.00 0 0 (Gen: 0) 0 0 1224 0.00 0.00 0.00 0.00 0 0 (Gen: 0) 0 0 1224 0.00 0.00 0.00 0.00 0 0 (Gen: 0) 0 0 1224 0.00 0.00 0.00 0.00 0 0 (Gen: 0) ... 0 0 1224 0.00 0.00 0.98 0.98 0 0 (Gen: 0) 0 0 1224 0.00 0.00 0.98 0.98 0 0 (Gen: 0) 0 0 1224 0.00 0.00 0.98 0.98 0 0 (Gen: 0) 72 72 1296 0.00 0.00 0.98 0.98 0 0 (Gen: 0) cpphs: interrupted 1024 0.00 0.00 2,352 bytes allocated in the heap 2,512 bytes copied during GC 6,968 bytes maximum slop 1 MB total memory in use (0 MB lost due to fragmentation) Tot time (elapsed) Avg pause Max pause Gen 0 215256 colls, 0 par 0.29s 0.29s 0.0000s 0.0000s Gen 1 0 colls, 0 par 0.00s 0.00s 0.0000s 0.0000s INIT time 0.00s ( 0.00s elapsed) MUT time 0.69s ( 0.70s elapsed) GC time 0.29s ( 0.29s elapsed) EXIT time 0.00s ( 0.00s elapsed) Total time 0.98s ( 0.98s elapsed) %GC time 29.3% (29.1% elapsed) Alloc rate 3,390 bytes per MUT second Productivity 70.7% of total user, 70.8% of total elapsed }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8817#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8817: segmentation fault in 7.8 RC1 -------------------------------------+---------------------------------- Reporter: hamishmack | Owner: simonmar Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Comment (by simonmar): Well -A4k/-A16k is a bit silly, but it should work. I'll take a look. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8817#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8817: segmentation fault in 7.8 RC1 -------------------------------------+---------------------------------- Reporter: hamishmack | Owner: simonmar Type: bug | Status: new Priority: high | Milestone: 7.8.1 Component: Runtime System | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Comment (by luite): Hamishmack and me were debugging the random GHCJS segfaults we we've been having for a while, trying to reproduce them with a smaller program, and then stumbled into this. So I hope the fix for this will also affect non- silly scenarios :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8817#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8817: segmentation fault in 7.8 RC1 -------------------------------------+---------------------------------- Reporter: hamishmack | Owner: simonmar Type: bug | Status: new Priority: highest | Milestone: 7.8.1 Component: Runtime System | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Changes (by simonmar): * priority: high => highest -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8817#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8817: segmentation fault in 7.8 RC1
-------------------------------------+----------------------------------
Reporter: hamishmack | Owner: simonmar
Type: bug | Status: new
Priority: highest | Milestone: 7.8.1
Component: Runtime System | Version: 7.8.1-rc1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: x86_64 (amd64)
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+----------------------------------
Comment (by Simon Marlow

#8817: segmentation fault in 7.8 RC1 -------------------------------------+---------------------------------- Reporter: hamishmack | Owner: simonmar Type: bug | Status: merge Priority: highest | Milestone: 7.8.1 Component: Runtime System | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Changes (by simonmar): * status: new => merge Comment: I fixed the problem with `-A16k`, which is actually a nasty codegen bug. I suspect the problem with `-A4k` is more benign and only occurs with very tiny `-A` values, and I think it's been around for a while. So merge this patch, then leave the ticket open with a lower prio for the -A4k fix. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8817#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8817: segmentation fault in 7.8 RC1 -------------------------------------+---------------------------------- Reporter: hamishmack | Owner: simonmar Type: bug | Status: merge Priority: normal | Milestone: 7.8.1 Component: Runtime System | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Changes (by luite): * priority: highest => normal Comment: Thanks, this appears to have fixed our GHCJS segfaults! Since the other problem is easily avoided, I set it to normal priority. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8817#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8817: segmentation fault in 7.8 RC1 -------------------------------------+---------------------------------- Reporter: hamishmack | Owner: simonmar Type: bug | Status: merge Priority: highest | Milestone: 7.8.1 Component: Runtime System | Version: 7.8.1-rc1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Changes (by luite): * priority: normal => highest Comment: Oops, let's leave at highest until merged -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8817#comment:10 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8817: segmentation fault in 7.8 RC1 -------------------------------------+---------------------------------- Reporter: hamishmack | Owner: simonmar Type: bug | Status: closed Priority: highest | Milestone: 7.8.1 Component: Runtime System | Version: 7.8.1-rc1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+---------------------------------- Changes (by thoughtpolice): * status: merge => closed * resolution: => fixed Comment: Merged in 7.8 for RC2. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8817#comment:11 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC