Ticket #146 (new defect)
Opened 10 months ago
Last modified 7 months ago
Blue Screen of Death When Stopping Debugger
| Reported by: | jleveque | Owned by: | |
|---|---|---|---|
| Milestone: | Component: | libusb-1.0 Windows backend | |
| Keywords: | Cc: | ||
| Blocked By: | Blocks: |
Description
While debugging a project linked against libusb-1.0.9 in Visual C++ 2008, I can fairly regularly get Windows machines to blue screen simply by stopping the debugger (Shift-F5, or Debug->Stop Debugging). I have seen this on Windows XP machines, as well, but I haven't looked into those further. The minidump files left by Windows on Windows 7 64-bit machines claim that the crash occurred in Wdf01000.sys at address: Wdf01000.sys+4c1fb, called from WinUsb?.sys at address: WinUsb?.sys+137d. I will attach one of these minidump files to this bug report for your perusal, as well.
Attachments
Change History
Changed 10 months ago by jleveque
comment:1 Changed 10 months ago by timrprobocom
The crash was triggered by the KMDF Verifier. The driver is trying to clean up all outstanding requests as part of abnormal process termination. I'm missing a couple of key data structures here, but it looks like it pulled a request off of its pending request queue, and the request no longer exists. This looks to me like a WinUSB bug. Is it possible to get a full kernel dump of this, instead of just a minidump?
comment:2 Changed 10 months ago by jleveque
As the full kernel dump file is ~930MB (far over the size limit for attachments on this board), I have attached a text file containing the output of WinDbg? after processing the dump file. Please let me know if I can be of further assistance.
comment:3 follow-ups: ↓ 4 ↓ 5 Changed 10 months ago by jleveque
Had yet another blue screen. This time, kernel dump is ~1.3GB, so attaching another bit of output from WinDbg?. If there's a way to send you my full kernel dump, please let me know.
comment:4 in reply to: ↑ 3 Changed 10 months ago by stuge
comment:5 in reply to: ↑ 3 ; follow-up: ↓ 7 Changed 10 months ago by xiaofan
Replying to jleveque:
Just wondering if you could try out the git version of libusb to see if that helps. libusb-1.0.9 has some serious issues under Windows.
You can also try out libusbx (www.libusbx.org) which has the ready made binary (1.0.12 release) which has already integrated the fixes for Windows.
On the other hand, this is just a guess. If the bug is indeed with WinUSB.sys, then both libusb and libuxbx will be affected.
comment:6 Changed 10 months ago by timrprobocom
I have posted the problem description on the [ntdev] mailing list, and several members of the Microsoft driver team monitor that list. There is some chance they will find it interesting enough to pursue on their own, but my guess is that someone will have to file a support incident with Microsoft. That costs money, which is refunded if it does turn out to be a bug in the OS.
In the meantime, the best advice is "don't do that". Stopping debugging results in an abnormal termination of the process being debugged. Some of the steps in process cleanup are skipped. WinUSB should NOT crash, but it's not a situation that will be encountered in production use.
comment:7 in reply to: ↑ 5 Changed 8 months ago by jleveque
Replying to xiaofan:
xiaofan - Just wanted to let you know I updated to the latest git revision as of August 6th, and the problem persists.
comment:8 Changed 7 months ago by stuge
Thanks for the update! Yes, any bluescreen means that there is a kernel problem, and since we are operating in userspace and only calling a userspace API there's not a whole lot libusb can do.
Windows Minidump file of Blue Screen crash