Ticket #4895 (closed Bugs: fixed)

Opened 7 years ago

Last modified 6 years ago

Wrong temporary path determined by boost::interprocess::managed_shared_memory

Reported by: simon.gysi@… Owned by: igaztanaga
Milestone: Boost 1.46.0 Component: interprocess
Version: Boost 1.45.0 Severity: Showstopper
Keywords: Cc:


Creating a boost::interprocess::managed_shared_memory object (create_only) may determine a wrong temporary path for the shared memory file, if the COM environment has already been initialized for the current thread.

The 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 doesn't always work correct. It gets called to fetch the last bootup time from WMI. The last bootup is then used to build the temporary path.

The call to CoInitializeSecurity?(..) may fail due to various reasons, which are not always a failure. Eg. the CoInitializeSecurity?(..) has already been called with different settings (-> HRESULT is 0x80010119).

Remarks for the function mention above:

Both are constraints are broken due to the several early returns.

  • Also the call to CoInitialize? may fail - how to deal with that?


Change History

comment:1 Changed 6 years ago by anonymous

This may be related to ticket:4907.

Please fix this in boost 1.46 if possible. Or post a patch here and I'll be happy to test it on Windows 7 and Windows XP.

comment:2 Changed 6 years ago by anonymous

  • Severity changed from Problem to Showstopper
  • Milestone changed from To Be Determined to Boost 1.46.0

comment:3 Changed 6 years ago by igaztanaga

Please try SVN for recent changes. I've balanced all calls and the code supports already initialized security. I'm not an expert in COM issues, so I would need some help with this issue. Thanks for the report.

comment:4 Changed 6 years ago by marshall

So, is this fixed or not? Does anyone know?

comment:5 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

comment:6 Changed 6 years ago by Kai K.

Since WMI usage was not removed for 1.47.0 please have a look at my additions to #5392!

comment:7 Changed 6 years ago by anonymous

This has not been fixed in Boost 1.47.0. The svn versions have had this fix for quite some time now.


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.