[GHC] #7319: +RTS -xc sometimes results in segfault
GHC
cvs-ghc at haskell.org
Thu Oct 11 15:55:32 CEST 2012
#7319: +RTS -xc sometimes results in segfault
------------------------------+---------------------------------------------
Reporter: edsko | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 7.6.1 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Testcase:
Blockedby: | Blocking:
Related: |
------------------------------+---------------------------------------------
I have so far been unable to reproduce this in a small example, but in my
larger examples code compiled with profiling enabled (and -fprof-auto)
often crashes on an exception. Here's a gdb session illustrating the
problem:
{{{
(gdb) run
Starting program: /Users/edsko/wt/distributed-process/network-transport-
tcp/dist/build/TestTCP/TestTCP +RTS -xc
Reading symbols for shared libraries ++............................. done
Running "InvalidAddress": *** Exception (reporting due to +RTS -xc):
(THUNK_2_0), stack trace:
Network.Transport.TCP.Mock.Socket.getAddrInfo,
called from Network.Transport.TCP.Internal.forkServer,
called from Network.Transport.TCP.createTransportExposeInternals,
called from Network.Transport.TCP.createTransport,
called from Main.testInvalidAddress.\,
called from Main.testInvalidAddress,
called from Main.main,
called from Main.CAF
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x0000000100398c06 in fprintCCS_stderr ()
(gdb) bt
#0 0x0000000100398c06 in fprintCCS_stderr ()
#1 0x00000001003c1e3c in stg_raisezh ()
Previous frame inner to this frame (gdb could not unwind past this frame)
}}}
with ghc 7.4.1; with ghc 7.6.1, it is
{{{
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
0x000000010037a676 in fprintCCS_stderr ()
(gdb) bt
#0 0x000000010037a676 in fprintCCS_stderr ()
#1 0x00000001003a3e27 in stg_raisezh ()
Previous frame inner to this frame (gdb could not unwind past this frame)
}}}
Without gdb, it looks something like
{{{
# dist/build/TestTCP/TestTCP +RTS -xc
Running "InvalidAddress": *** Exception (reporting due to +RTS -xc):
(THUNK_2_0), stack trace:
Network.Transport.TCP.Mock.Socket.getAddrInfo,
called from Network.Transport.TCP.Internal.forkServer,
called from Network.Transport.TCP.createTransportExposeInternals,
called from Network.Transport.TCP.createTransport,
called from Main.testInvalidAddress.\,
called from Main.testInvalidAddress,
called from Main.main,
called from Main.CAF
*** Exception (reporting due to +RTS -xc): (BLACKHOLE), stack trace:
Network.Transport.TCP.Mock.Socket.getAddrInfo,
called from Network.Transport.TCP.Internal.forkServer,
called from Network.Transport.TCP.createTransportExposeInternals,
called from Network.Transport.TCP.createTransport,
called from Main.testInvalidAddress.\,
called from Main.testInvalidAddress,
called from Main.main,
called from Main.CAF
*** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace:
Network.Transport.TCP.Mock.Socket.getAddrInfo,
called from Network.Transport.TCP.Internal.forkServer,
called from Network.Transport.TCP.createTransportExposeInternals,
called from Network.Transport.TCP.createTransport,
called from Main.testInvalidAddress.\,
called from Main.testInvalidAddress,
called from Main.main,
called from Main.CAF
*** Exception (reporting due to +RTS -xc): (THUNK_STATIC), stack trace:
Main.main
*** Exception (reporting due to +RTS -xc): (THUNK_2_0), stack trace:
Network.Transport.TCP.Mock.Socket.getAddrInfo,
called from Network.Transport.TCP.Internal.forkServer,
called from Network.Transport.TCP.createTransportExposeInternals,
called from Network.Transport.TCP.createTransport,
called from Main.testInvalidAddress.\,
called from Main.testInvalidAddress,
called from Main.main,
called from Main.CAF
Segmentation fault: 11
}}}
Note that the place of the Segmentation fault is the place where normally
the exception would be printed.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7319>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list