On 08/11/2016 05:41 AM, Emilio G. Cota wrote: > On Thu, Aug 11, 2016 at 10:45:02 +0200, Igor Mammedov wrote: >> On Wed, 10 Aug 2016 17:19:48 +0200 >> Paolo Bonzini <pbonz...@redhat.com> wrote: >>> The patch makes sense, but I think we don't need to call qht_reset_size >>> at all. >>> >>> tb_flush should not do anything if using KVM. There are several ways to >>> do this: >>> >>> - put the tb_flush call under "if (tcg_enabled())" >>> >>> - add an "if (!tcg_enabled()) return;" in tb_flush > > I like this option the most.
I can still reproduce the crash even with 2.7.0-rc4, so the fix does not seem to help on my system. (gdb) bt #0 0x000000001043a726 in qht_reset_size (ht=0x10625d98 <tcg_ctx+216>, n_elems=32768) at /home/cborntra/REPOS/qemu/util/qht.c:422 #1 0x0000000010021ab8 in tb_flush (cpu=0x0) at /home/cborntra/REPOS/qemu/translate-all.c:855 #2 0x0000000010076d02 in gdb_vm_state_change (opaque=0x0, running=0, state=RUN_STATE_DEBUG) at /home/cborntra/REPOS/qemu/gdbstub.c:1276 #3 0x000000001018f106 in vm_state_notify (running=0, state=RUN_STATE_DEBUG) at /home/cborntra/REPOS/qemu/vl.c:1585 #4 0x00000000100632e6 in do_vm_stop (state=RUN_STATE_DEBUG) at /home/cborntra/REPOS/qemu/cpus.c:743 #5 0x0000000010065450 in vm_stop (state=RUN_STATE_DEBUG) at /home/cborntra/REPOS/qemu/cpus.c:1476 #6 0x000000001018fc46 in main_loop_should_exit () at /home/cborntra/REPOS/qemu/vl.c:1856 #7 0x000000001018fe6a in main_loop () at /home/cborntra/REPOS/qemu/vl.c:1912 #8 0x000000001019809c in main (argc=11, argv=0x3fffffff368, envp=0x3fffffff3c8) at /home/cborntra/REPOS/qemu/vl.c:4604 (gdb) Doing the "tcg_enabled()" thing does help, though. Shall I send a patch? This should still make it into 2.7 I think. > > My patch to fix this issue was written thinking that tb_flush was > strangely needed for gdb to work under KVM. If that's not the > case, then let's go for the real fix [above]. > > Thanks, > > E. >