Ticket #5306 (closed Bugs: fixed)

Opened 6 years ago

Last modified 6 years ago

get_wmi_class_attribute crashes

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



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:


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


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.


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

Change History

Changed 6 years ago by habdank@…

Patch for the problem

comment:1 Changed 6 years ago by igaztanaga

  • Status changed from new to closed
  • Resolution set to fixed

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


Add a comment

Modify Ticket

Change Properties
<Author field>
as closed
The resolution will be deleted. Next status will be 'reopened'

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.