Boost C++ Libraries: Ticket #5306: get_wmi_class_attribute crashes https://svn.boost.org/trac10/ticket/5306 <p> Dears, </p> <p> Independently of <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4895" title="#4895: Bugs: Wrong temporary path determined by ... (closed: fixed)">#4895</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5120" title="#5120: Bugs: boost.interprocess.detail tmp_dir_helpers.hpp ... (closed: fixed)">#5120</a> and <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/4350" title="#4350: Bugs: Shared memory permission limitations (closed: fixed)">#4350</a> there is yet another bug in function: </p> <p> inline bool get_wmi_class_attribute( std::wstring&amp; strValue, const wchar_t *wmi_class, const wchar_t *wmi_class_var) </p> <p> in the file: </p> <p> boost\interprocess\detail\win32_api.hpp </p> <p> The problem is that at the end of function there is a sequence: </p> <blockquote> <p> pIWbemLocator-&gt;Release(); pWbemServices-&gt;Release(); pEnumObject-&gt;Release(); pClassObject-&gt;Release(); </p> </blockquote> <p> But there is no guarantee that pClassObject != NULL especially that it is initilized to be NULL and then perhaps modification is made in: </p> <p> pEnumObject-&gt;Next( WBEM_INFINITE_IG, uCount, &amp;pClassObject, &amp;uReturned ) </p> <p> but under some conditions pClassObject remains NULL and then </p> <p> pClassObject-&gt;Release(); </p> <p> crashes with memory violation error. Obviously when pClassObject == NULL then pClassObject-&gt;Release(); dereferences NULL pointer. </p> <p> My honest suggestion would be to carefully track all execution paths in that function to observe its complete behavior. </p> <p> 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. </p> <p> Best regards, Seweryn Habdank-Wojewodzki. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5306 Trac 1.4.3 habdank@… Wed, 16 Mar 2011 09:41:05 GMT attachment set https://svn.boost.org/trac10/ticket/5306 https://svn.boost.org/trac10/ticket/5306 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">win32_api.patch</span> </li> </ul> <p> Patch for the problem </p> Ticket Ion Gaztañaga Fri, 01 Apr 2011 17:08:24 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5306#comment:1 https://svn.boost.org/trac10/ticket/5306#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> 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. </p> <p> WMI is removed in Boost 1.47 </p> Ticket