Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#4895 closed Bugs (fixed)

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

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

Description

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 (7)

comment:1 by anonymous, 12 years ago

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 by anonymous, 12 years ago

Milestone: To Be DeterminedBoost 1.46.0
Severity: ProblemShowstopper

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

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 by Marshall Clow, 12 years ago

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

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

comment:6 by Kai K. , 11 years ago

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

comment:7 by anonymous, 11 years ago

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

Note: See TracTickets for help on using tickets.