Ticket #5120 (closed Bugs: fixed)
boost.interprocess.detail tmp_dir_helpers.hpp get_bootstamp(std::string, bool) function problem
|Reported by:||Darko Nesovic <nesovicdarko@…>||Owned by:||igaztanaga|
|Milestone:||To Be Determined||Component:||interprocess|
Because of bug #4230, I switched to boost 1.45.0 from 1.42.0, but, application unexpectedly crashes on Windows platform. After short investigation in source code, I noticed that problem lies in get_bootstamp(std::string&, bool) function, which has changed in latest release, more precisely, folder name construction has changed. In some cases, function winapi::get_last_bootup_time(std::string&) which calls get_wmi_class_attribute, returns empty string instead of last bootup time. In that case, code inside if statement: if( 0 == CoInitializeSecurity?( 0, -1, 0, 0, RPC_C_AUTHN_LEVEL_PKT_IG, RPC_C_IMP_LEVEL_IMPERSONATE_IG, 0, EOAC_NONE_IG, 0 ) )
IWbemLocator_IG * pIWbemLocator = 0;
.... } has not been reached, actually, CoInitializeSecurity? returns: RPC_E_TOO_LATE CoInitializeSecurity? has already been called. In this case, shared memory is created in: C:\ProgramData?\boost_interprocess\foo.shm instead of C:\ProgramData?\boost_interprocess\last_boot_time\foo.shm.
This causes that next time when application tries to open created shared memory, it has been deleted, and interprocess exception file not found has been thrown. I don't know is this behavior a real bug, or I'm doing something wrong, but application has worked perfectly with 1.42.0 version, but due to bug #4320 I had to switch on 1.45.0. Also, I'm interesting about reasons for shared memory folder name construction has been changed, because, I tried 1.45.0 with an old way (I edit get_bootstamp), and it worked!