-
Notifications
You must be signed in to change notification settings - Fork 36
From SourceForge: BSoD on detach. #5
Comments
What needs to be done:
|
From investigation: it seems one of the previous developers had hit a very similar bug elsewhere in the code [process_write_irp()] where he had to pad IO calls with IRQL raising and lowering. We may need to do the same elsewhere in the code, not just under complete_pending_irp(). |
FYI: recompiled with the server-side accepted version number (111) and got the following stack trace from the kernel memory dump after detaching a bluetooth dongle (bsod):
|
Hi @dennisdegryse . Thank you for your trace. I'm pretty sure I've pinpointed where the problem is, but not why this is happening. I'm mostly working on the usbip-tools for now, but I'll take whatever you can feed me on the driver side: which OS are you testing on? Which commit are you compiling? How did you disconnect your device? Did it generate a "IRQL not less or equal" or was it a different message? From what I can read, you generated a surprise removal: the PNP process is called and it deals with a Remove and Eject query, than it continues deleting devices nodes, going to a specific node and it is treated as a SupriseRemoveLockedDeviceNode... Then it calls the bluetooth driver (bthport), which in turn also deals with the suprise removal, stopping transfers, canceling all IRPs and this is where it fails under USBIPEnum, generating a page fault. |
@dennisdegryse : also, could you attach the dump file? |
ATM I only have a full memory dump of 1.2GB, from a non-sandboxed environment (may contain info I don't want to leak). I'll set up a VM for a reproduction and new dump asap. Do you want the full memory dump or will a minidump suffice? |
@dennisdegryse : If you were testing using the master/HEAD, I pushed a fix a few minutes ago (well, I hope this will work). IoCancelIrp() calls the driver's cancel IRP routine, which is cancel_irp(). At first, I tought we were hitting a wrongly assumed IRQL at DISPATCH_LEVEL. However, after digging in Microsoft's documentation, I think I have properly fixed the code. If you want to give it a try and let me know (I still haven't worked on the server-side accepted version number (111)) if this fixes your problem. |
Reported by: DanT
Date:
Link: https://sourceforge.net/p/usbip/discussion/418507/thread/7ff86875/?limit=25&page=1#f556
Description: BSoD on detach in "complete_pending_irp" in the function "bus_unplug_dev".
This may have been fixed by commit b7bfa2c I included from Daniel Mitchell's patch. There was at least two possible errors with IRQL not being set correctly. However, I suspect another error could still happen under complete_pending_irp() in pnp.c.
The text was updated successfully, but these errors were encountered: