+RTS -xc sometimes results in segfault
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.
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |