[ofw] Add Assert to debug BS while deleting WDF device
Uri Habusha
urih at mellanox.co.il
Wed Dec 1 11:44:11 PST 2010
Okay I found the problem.
WmCreateControlDevice is called but get an error after creating the device object, as a result the function calls to WdfObjectDelete to delete the control device.
Afterwards WmPowerD0Exit function is called. Since the DevList is empty it sets the destroy flag to true and then try to delete the device object. However this object already deleted and we got a BS
I think that the right fix is not delete it on error in WmCreateControlDevice, and always delete it in WmPowerD0Exit function
Sean what do you think.
BTW, if the winmad\winverb has debug print we can find the problem more easily without wasting too much time. Sean any objection to add debug print. If it's okay with you I will add it.
Uri
-----Original Message-----
From: Hefty, Sean [mailto:sean.hefty at intel.com]
Sent: Thursday, November 18, 2010 6:16 PM
To: Uri Habusha; ofw at lists.openfabrics.org; Smith, Stan
Subject: RE: Add Assert to debug BS while deleting WDF device
> It's SM 3.3.6 if I understand correctly it uses winmad
Stan, can you confirm this?
There is an issue in the code that I can see. If during D0Entry, winmad fails to create the ControlDevice for some reason, then it will crash during D0Exit. Additional error handling or a couple of simple checks are needed to prevent this.
However, if opensm was using winmad at the time of the crash, then the ControlDevice must be valid. If this is the case, then tracking down the problem is going to prove more difficult, and it may not be associated with the ControlDevice at all. Possibly stack corruption, since WdfObjectDelete is called with a stack variable..?
- Sean
More information about the ofw
mailing list