Opened 12 years ago

Closed 12 years ago

#5306 closed Bugs (fixed)

get_wmi_class_attribute crashes

Reported by: habdank@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.45.0 Severity: Showstopper
Keywords: Cc:

Description

Dears,

Independently of #4895, #5120 and #4350 there is yet another bug in function:

inline bool get_wmi_class_attribute( std::wstring& strValue, const wchar_t *wmi_class, const wchar_t *wmi_class_var)

in the file:

boost\interprocess\detail\win32_api.hpp

The problem is that at the end of function there is a sequence:

pIWbemLocator->Release(); pWbemServices->Release(); pEnumObject->Release(); pClassObject->Release();

But there is no guarantee that pClassObject != NULL especially that it is initilized to be NULL and then perhaps modification is made in:

pEnumObject->Next( WBEM_INFINITE_IG, uCount, &pClassObject, &uReturned )

but under some conditions pClassObject remains NULL and then

pClassObject->Release();

crashes with memory violation error. Obviously when pClassObject == NULL then pClassObject->Release(); dereferences NULL pointer.

My honest suggestion would be to carefully track all execution paths in that function to observe its complete behavior.

I would appreciate to get patch for that problem. Temporarily I could patch myself, but that will have limited focus, as I have no big picture.

Best regards, Seweryn Habdank-Wojewodzki.

Attachments (1)

win32_api.patch (1.9 KB ) - added by habdank@… 12 years ago.
Patch for the problem

Download all attachments as: .zip

Change History (2)

by habdank@…, 12 years ago

Attachment: win32_api.patch added

Patch for the problem

comment:1 by Ion Gaztañaga, 12 years ago

Resolution: fixed
Status: newclosed

WMI is provoking a lot of problems for Boost Interprocess users. I've decided to remove bootstamp use in windows to obtain kernel persistence in Windows. This means that windows shared memory/queues will survive to reboots, but this behaviour is allowed by POSIX. Using bootstamps to detect reboots is doing more harm than good.

WMI is removed in Boost 1.47

Note: See TracTickets for help on using tickets.