[GHC] #15544: Non-deterministic segmentation fault in cryptohash-sha256 testsuite
GHC
ghc-devs at haskell.org
Wed Aug 22 22:04:11 UTC 2018
#15544: Non-deterministic segmentation fault in cryptohash-sha256 testsuite
-------------------------------------+-------------------------------------
Reporter: bgamari | Owner: (none)
Type: bug | Status: new
Priority: highest | Milestone: 8.6.1
Component: Compiler | Version: 8.4.3
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: |
-------------------------------------+-------------------------------------
Comment (by bgamari):
The previous debugging session ended up looking a bit messy. Starting
afresh, this time with `+RTS -DS`. Things are looking much clearer now.
We get the following segfault:
{{{
Thread 2 received signal SIGSEGV, Segmentation fault.
0x00000000007c8370 in stg_IND_STATIC_info () at
rts/StgMiscClosures.cmm:270
270 {
>>> bt
#0 0x00000000007c8370 in stg_IND_STATIC_info () at
rts/StgMiscClosures.cmm:270
#1 0x00000000006ae1f0 in
bytestringzm0zi10zi8zi2_DataziByteStringziLazzy_fromChunkszugo_info () at
libraries/bytestring/Data/ByteString/Lazy.hs:267
#2 0x00000000007c5388 in ?? () at rts/Updates.cmm:31
#3 0x00000000006adc50 in
bytestringzm0zi10zi8zi2_DataziByteStringziLazzy_toChunkszugo_info () at
libraries/bytestring/Data/ByteString/Lazy.hs:271
#4 0x00000000007c5388 in ?? () at rts/Updates.cmm:31
#5 0x0000000000624d20 in s7zn_info ()
#6 0x0000000000000000 in ?? ()
}}}
where `$rbx` points to memory cleared by the RTS:
{{{
>>> x/8a $rbx
0x4200365960: 0xaaaaaaaaaaaaaaaa 0xaaaaaaaaaaaaaaaa
0x4200365970: 0xaaaaaaaaaaaaaaaa 0xaaaaaaaaaaaaaaaa
0x4200365980: 0xaaaaaaaaaaaaaaaa 0xaaaaaaaaaaaaaaaa
0x4200365990: 0xaaaaaaaaaaaaaaaa 0xaaaaaaaaaaaaaaaa
}}}
Tracing this back it looks like this once resided in a nursery that has
since been freed. It sounds like something is being freed too soon
(perhaps something like #14346/#15260). Looking at the package
implementation it looks like there are a few `withForeignPtr` uses. This
is quite suspicious.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15544#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list