[GHC] #14346: 8.2.1 regression: heap corruption after safe foreign calls
GHC
ghc-devs at haskell.org
Sat Oct 14 03:02:47 UTC 2017
#14346: 8.2.1 regression: heap corruption after safe foreign calls
-------------------------------------+-------------------------------------
Reporter: andrewchen | Owner: (none)
Type: bug | Status: infoneeded
Priority: highest | Milestone:
Component: Runtime System | Version: 8.2.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Runtime crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by andrewchen):
I managed to do a `rr` capture with `--chaos` mode.
Here's the part in main where it does the comparison:
{{{
0x404581 <Main_main1_info+361> mov ecx,DWORD PTR [rax]
0x404583 <Main_main1_info+363> cmp rcx,rbx //
compares value with 0xDEADBEEF
0x404586 <Main_main1_info+366> jne 0x40443c <Main_main1_info+36> //
goes to print "value mismatch"
}}}
{{{
(rr) p/x $rcx
$22 = 0x1
(rr) p/x $rbx
$23 = 0xdeadbeef
(rr) p/x $rax
$24 = 0x42000b7540
}}}
Putting a watch point on the the memory address and reverse continuing
leads to this:
{{{
Old value = 1
New value = -559038737
0x0000000000470b42 in base_GHCziEventziPoll_new5_info ()
=> 0x0000000000470b42 <base_GHCziEventziPoll_new5_info+1218>: 49 89 04
24 mov QWORD PTR [r12],rax
}}}
{{{
(rr) p/x $r12
$27 = 0x42000b7540
}}}
Not sure what's going on there, but I hope this is of some help.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14346#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list