
#13916: Optimizations create run time seg faults
-------------------------------------+-------------------------------------
Reporter: newthin | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.2
(CodeGen) |
Resolution: | Keywords: optimization
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 bgamari):
Oh dear, this looks quite bad indeed. Thanks for providing such a nice
reproducer!
`gdb` places the crash in,
{{{
Program received signal SIGSEGV, Segmentation fault.
stg_takeMVarzh () at rts/PrimOps.cmm:1483
1483 rts/PrimOps.cmm: No such file or directory.
(gdb) bt
#0 stg_takeMVarzh () at rts/PrimOps.cmm:1483
#1 0x000000000064dc88 in
base_GHCziIOziHandleziInternals_zdwdozuoperation_info () at
libraries/base/GHC/IO/Handle/Internals.hs:163
#2 0x0000000000646ce0 in sb1n_info () at
libraries/base/GHC/IO/Handle.hs:470
#3 0x0000000000407378 in s6zq_info () at ./Bracket.hs:105
#4 0x0000000000613e58 in s3E1_info () at
libraries/base/Control/Exception/Base.hs:222
#5 0x00000000006e75f0 in ?? ()
#6 0x000000000040a328 in sdbc_info () at main.hs:21
#7 0x0000000000454680 in sbFu_info ()
#8 0x0000000000000000 in ?? ()
}}}
The disassembly of the top frame is,
{{{
(gdb) disassemble
Dump of assembler code for function stg_takeMVarzh:
0x00000000006ebd70 <+0>: mov (%rbx),%rax
0x00000000006ebd73 <+3>: cmpq $0x94f088,0x18(%rbx)
0x00000000006ebd7b <+11>: je 0x6ebe97