Re: [Boost-bugs] [Boost C++ Libraries] #5392: Message queue temporary dir named "Select LastBootUpTime from Win32_OperatingSystem" (on win XP)

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5392: Message queue temporary dir named "Select LastBootUpTime from Win32_OperatingSystem" (on win XP)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-31 23:19:53


#5392: Message queue temporary dir named "Select LastBootUpTime from
Win32_OperatingSystem" (on win XP)
-------------------------------+--------------------------------------------
  Reporter: wsx22@… | Owner: igaztanaga
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: interprocess
   Version: Boost 1.46.1 | Severity: Problem
Resolution: | Keywords: interprocess, message queue, temporary directory, temp
-------------------------------+--------------------------------------------

Comment (by anonymous):

 I've debugged get_wmi_class_attribute function


 with orginal code from 1_46_1

 during new
 boost::interprocess::message_queue(boost::interprocess::create_only, ... )
 instruction there are 3 invocations of get_wmi_class_attribute function,
 all of it returns correct string

 first execution looks like this:
 {{{
 long co_init_ret = CoInitialize(0);
 co_init_ret = 0x00000001 (S_FALSE_IG)

 long sec_init_ret = CoInitializeSecurity
 sec_init_ret = 0x00000000

 pWbemServices->ExecQuery(..)
 returns 0

 pEnumObject->Reset()
 returns 0

 pEnumObject->Next( WBEM_INFINITE_IG, uCount, &pClassObject, &uReturned )
 returns 0
 goes into while body

 pClassObject->Get( L"LastBootUpTime", 0, &vwchar, 0, 0 )
 returns 0

 strValue = vwchar.value.pbstrVal;
 ok, returns correct value

 return bRet;
 bRet = true
 }}}

 second and third execution looks like this:
 {{{
 long co_init_ret = CoInitialize(0);
 co_init_ret = 0x00000001 (S_FALSE_IG)

 long sec_init_ret = CoInitializeSecurity
 sec_init_ret = 0x80010119

 pWbemServices->ExecQuery(..)
 returns 0

 pEnumObject->Reset()
 returns 0

 pEnumObject->Next( WBEM_INFINITE_IG, uCount, &pClassObject, &uReturned )
 returns 0
 program goes into while body

 pClassObject->Get( L"LastBootUpTime", 0, &vwchar, 0, 0 )
 returns 0

 strValue = vwchar.value.pbstrVal;
 ok, returns correct value

 return bRet;
 bRet = true
 }}}



 during boost::interprocess::message_queue
 mq(boost::interprocess::open_only, ... ) instruction there are 2
 invocations of get_wmi_class_attribute function,
 all of it returns wrong string

 first and second execution looks like this:
 {{{
 long co_init_ret = CoInitialize(0);
 co_init_ret = 0x00000001 (S_FALSE_IG)

 long sec_init_ret = CoInitializeSecurity
 sec_init_ret = 0x80010119 (RPC_E_TOO_LATE_IG)

 pWbemServices->ExecQuery(..)
 returns 0

 pEnumObject->Reset()
 returns 0

 pEnumObject->Next( WBEM_INFINITE_IG, uCount, &pClassObject, &uReturned )
 returns 0x80041003
 program not goes into while body

 return bRet;
 bRet = false
 }}}




 with orginal code from 1_46_1 witch wmi.patch

 during new
 boost::interprocess::message_queue(boost::interprocess::create_only, ... )
 instruction there are 3 invocations of get_wmi_class_attribute function,
 all of it returns correct string

 first execution looks like this:
 {{{
 long co_init_ret = CoInitialize(0);
 co_init_ret = 0x00000001 (S_FALSE_IG)

 long sec_init_ret = CoInitializeSecurity
 sec_init_ret = 0x00000000

 pWbemServices->ExecQuery(..)
 returns 0

 pEnumObject->Next( WBEM_INFINITE_IG, uCount, &pClassObject, &uReturned )
 returns 0
 goes into while body

 pClassObject->Get( L"LastBootUpTime", 0, &vwchar, 0, 0 )
 returns 0

 strValue = vwchar.value.pbstrVal;
 ok, returns correct value

 return bRet;
 bRet = true
 }}}


 second and third execution looks like this:
 {{{
 long co_init_ret = CoInitialize(0);
 co_init_ret = 0x00000001 (S_FALSE_IG)

 long sec_init_ret = CoInitializeSecurity
 sec_init_ret = 0x80010119 (RPC_E_TOO_LATE_IG)

 pWbemServices->ExecQuery(..)
 returns 0

 pEnumObject->Next( WBEM_INFINITE_IG, uCount, &pClassObject, &uReturned )
 returns 0
 goes into while body

 pClassObject->Get( L"LastBootUpTime", 0, &vwchar, 0, 0 )
 returns 0

 strValue = vwchar.value.pbstrVal;
 ok, returns correct value

 return bRet;
 bRet = true
 }}}


 during boost::interprocess::message_queue
 mq(boost::interprocess::open_only, ... ) instruction there are 2
 invocations of get_wmi_class_attribute function,
 all of it returns wrong string

 first and second execution looks like this:
 {{{
 long co_init_ret = CoInitialize(0);
 co_init_ret = 0x00000001 (S_FALSE_IG)

 long sec_init_ret = CoInitializeSecurity
 sec_init_ret = 0x80010119 (RPC_E_TOO_LATE_IG)

 pWbemServices->ExecQuery(..)
 returns 0x80041003

 return bRet;
 bRet = false
 }}}




 implications:

 - CoInitializeSecurity returns 0x80010119
 if it was executed before

 - pEnumObject->Next(..)or pWbemServices->ExecQuery(..) fails if
 if it was executed before from another process

 - this bug is related to:
 https://svn.boost.org/trac/boost/ticket/4895 and
 https://svn.boost.org/trac/boost/ticket/4907

 - get_wmi_class_attribute function executes multiple times per one
 boost::interprocess::message_queue instruction, maybe its result should be
 cached somewhare

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5392#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC