Re: KVM crashes when using certain USB device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 16, 2009 at 9:15 AM, Jim Paris<jim@xxxxxxxx> wrote:
> Hi G,
>
>> >> I've continued my attempts to get the HASP dongle working, but with no success:
> ...
>> Good idea. The results from three test runs after that change are in
>> the attached files. The third was done while also dumping the USB bus,
>> and the output from that dump is also attached.
>
> The gdb output here looks questionable.  Only the second trial seems
> to have USB related stuff in the backtrace, so either gdb is wrong or
> there's some memory corruption that is causing crashes elsewhere.

My guess is that the usb code in kvm/qemu causes memory corruption
that is triggering these crashes. The crashes are definitely caused by
my use of the HASP HL USB dongle.

> Maybe valgrind could help?

To some extent. I've run three tests using valgrind, and there are
some messages that to me seem to indicate memory errors ("Invalid read
of size 1"). However, running with valgrind doesn't give me any core
files when it crashes.

I'm not too familiar with valgrind output, I have only used it on
smaller programs I've written myself, so I don't know what to think of
the messages (and amount of messages; valgrind told me to use
--error-limit=no). I do get a bit nervous from all the complaints
about uninitialized values  and byes, but maybe it's normal for an
application of kvm's size and type.

> You can also add more debugging to the usb code to try to figure out
> where things are going wrong.  See the attached patch for some printfs
> that might help.

I have applied that patch (and also uncommented the DEBUG flag).

> Try again with less memory on the guest, like -m 2048, just to reduce
> possible problems with the 32-bit guest and address space.

Done in these test runs.

Attached to this mail is a tarball containing a bunch of files. The
first and third testrun, doing things in a different order, have
output from the qemu monitor (including all debug printf()s),
valgrind, and usb sniffs generated by wireshark. The second testrun
only have qemu monitor and valgrind output. I have inserted some
comments in the qemu monitor and valgrind files, look for square
brackets at the beginning of lines to find them.

> I didn't see anything obviously wrong with the usbmon dumps you sent,
> or the debugging that qemu printed out, but I'm not familiar with this
> code.
>
> Even though you're having problems with -no-kvm, I suspect this is an
> upstream qemu issue, so you should probably try the qemu list too.

qemu-devel@xxxxxxxxxx? I'll try to figure out the -no-kvm issue first,
so I can run any commands they might want me to run.

And thanks for your help and suggestions so far, btw.

Attachment: test_with_valgrind.tgz
Description: GNU Zip compressed data


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux