If kill_inferior calls pop_target it'd better be expecting to close a
native target, not the exec target further down the stack. This looks
like a bug in the checkpoint code somewhere. Ugh, the bits in
kill_inferior are a little scary. First thing to do: figure out what's
on the target stack (follow current_target.beneath), and why it's got
execution if it's popping exec_close.
The target stack looks like:
(top-gdb) print current_target->to_shortname
$2 = 0x334298 "child"
(top-gdb) print current_target->beneath->to_shortname
$3 = 0x334298 "child"
(top-gdb) print current_target->beneath->beneath->to_shortname
$4 = 0x2d7d6c "exec"
(top-gdb) print current_target->beneath->beneath->beneath->to_shortname
$5 = 0x312614 "None"
And to_close is:
(top-gdb) print current_target->to_close
$6 = (void (*)(int)) @0x38465a: 0x47954 <exec_close>