Opened 7 years ago

Closed 7 years ago

Last modified 6 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:


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?

Attachments (0)

Change History (7)

comment:1 Changed 7 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 7 years ago by anonymous

Milestone: To Be DeterminedBoost 1.46.0
Severity: ProblemShowstopper

comment:3 Changed 7 years ago by Ion Gaztañaga

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

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

comment:5 Changed 7 years ago by Ion Gaztañaga

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 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.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ion Gaztañaga.
The resolution will be deleted.

Add Comment

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

Note: See TracTickets for help on using tickets.