locked
Windows 10 usbser.sys has a bug: it corrupts data. How can I report it and how can I demonstrate it? RRS feed

  • Question

  • I am developing microcontroller-based applications. Several of my devices provide a virtual COM port via their USB device controller and observe the following erratic behavior:

    If data is read from the COM port, then this data is not always correct. Sometimes, data is lost and sometimes data is even corrupted. This problem does not occur on Windows 7 or 8. It also does not occur on Linux. It only occurs with Windows 10.

    As far as I know, usbser.sys has been rewritten for Windows 10. That would explain why the problems occur only on Windows 10. It would also mean, that Windows 10 suffers from some regression of sorts.

    The problem does not seem to arise with interactive protocols. By that I mean that if you just sent a little but of data (e.g. a command for the device), wait for an answer of the device (which must not be too big), and repeat those 2 steps over and over again, then nothing bad happens.

    But if the device actually sends megabytes of data in response to some command, then usbser.sys seems to run into some sort of internal buffer management issues.

    It must be noted that virtual COM ports do not behave like real COM ports in the sense that data should not be dropped or corrupted. On the physical layer, USB uses checksums to ensure that transferred data is correct. Also, USB transfers are explicitly flow controlled: the host cannot send more data than a device can handle and a device can only send data if the hosts asks for it. No data corruption should occur and no data should be lost.

    I can reproduce this problem using different microcontrollers: for example a Xilinx Zynq, an STM32F1, and an STM32L4.

    Also, if I run a virtual machine (Linux, Windows 7, Windows 8), then the virtual machine can read all data properly while the Windows 10 host cannot. Also a Windows 10 virtual machine (using usbser.sys) on a any host suffers from the problem described above. Also, if I switch from usbser.sys to using winusb.sys on Windows 10, then I can read all data just fine.

    Everything indicates that usbser.sys is bugged and should be fixed.

    Problem is: how can I report this problem to Microsoft?

    I can also provide C code for the host-side. I can provide firmware for the microcontroller that I mentioned above. But I'm not certain how useful that would be for a microsoft engineer, if you don't have the same devices.

    Wednesday, July 31, 2019 8:32 AM

Answers

  • I've never understood why designers use a CDC interface for raw data streams like this, instead of just using a straight bulk pipe and WinUSB.  It's not any more programming.

    The formal way to report a bug is to contact Microsoft support and open a support ticket.  They will take a credit card and charge you something like $250, but they will refund the money if it turns out to be a Microsoft problem.


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    • Marked as answer by Brian Catlin Wednesday, July 31, 2019 8:48 PM
    Wednesday, July 31, 2019 7:02 PM

All replies

  • I've never understood why designers use a CDC interface for raw data streams like this, instead of just using a straight bulk pipe and WinUSB.  It's not any more programming.

    The formal way to report a bug is to contact Microsoft support and open a support ticket.  They will take a credit card and charge you something like $250, but they will refund the money if it turns out to be a Microsoft problem.


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    • Marked as answer by Brian Catlin Wednesday, July 31, 2019 8:48 PM
    Wednesday, July 31, 2019 7:02 PM
  • I've never understood why designers use a CDC interface for raw data streams like this, instead of just using a straight bulk pipe and WinUSB.  It's not any more programming.

    I do understand, and yes, it's more programming.

    • Companies like ST give you an easy way to let your microcontroller behave like a virtual COM port. In particular, you don't need to buy a USB VID/PID. A simple way to provide a WinUSB device is not provided.
    • Virtual COM ports are plug&play. For example ST provides a virtual COM port driver for such devices. The driver uses usbser.sys, of course.
    • I did all the research add Microsoft OS 2.0 descriptors to a USB device so the device would appear as a WinUSB device without the need for a custom INF file. It was a considerable amount of work and only works with Windows 10 and above.
    • On operating systems other than Windows, virtual COM ports appear as a tty device without the need for any special drivers.
    • People don't know that WinUSB exists or what it is but they do know what a COM port is and how to access it. Also, their earlier designs may have been based on a USB to UART chip (FTDI etc.).
    • Last time I looked, the WinUSB header files were part of the WDK, not the Windows SDK. People usually do not have the WDK installed.
    • I have found that using libusb is a good way to access a WinUSB device and it works on other operating systems as well.



    Saturday, August 3, 2019 1:30 AM
  • The formal way to report a bug is to contact Microsoft support and open a support ticket.  They will take a credit card and charge you something like $250, but they will refund the money if it turns out to be a Microsoft problem.

    That sound strange. Define "Microsoft problem". Do they have to prove that is it not their problem? Or do I have to prove that it is their problem?

    If they don't have a device to generate a "raw data stream", as you call it, or the problem doesn't surface with that device because it has different timings, then I fear somebody at Microsoft might simply claim, that it's not their problem.

    Saturday, August 3, 2019 1:37 AM
  •  Define "Microsoft problem"

    This means, if the MS support confirms a bug in usbser or other component of Windows 10.

     Do they have to prove that is it not their problem? Or do I have to prove that it is their problem?

    If you can provide them your device(s) with "streaming" fimware for test, would be super great.

    -- pa


    • Edited by Pavel A Sunday, August 4, 2019 11:49 PM
    Sunday, August 4, 2019 11:46 PM
  • It's almost exactly one year after your initial post and we are facing an issue that matches your description completely. (Missing and corrupted data when sending lots of data over USB virtual COM port/Usbser.sys). Did you file an issue report to Microsoft or found another way to solve the issue?
    Tuesday, July 14, 2020 3:09 PM
  • Hi ,

    Same issue I am facing with a product using V850 controller.  USB configuration looks fine and works fine in Windows7, but byte get missed or corrupted in windows 10. Any solution or workaround for this you know.

    Thanks,


    • Edited by MoRiaz Wednesday, December 2, 2020 2:52 PM
    Wednesday, December 2, 2020 2:50 PM
  • Same issue, same advise.

    -- pa

    Thursday, December 3, 2020 3:27 AM