Boost logo

Boost :

Subject: Re: [boost] [interprocess] Getting boot-up time is unreliable on Windows
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2016-12-30 16:31:11


On 22/12/2016 10:01, Thomas Dahms wrote:
> Dear developers, dear Ion,
>
> We are experiencing issues on Windows where boost::interprocess relies
> on a certain event in the system event log to get the system's boot-up
> time. This has proven to be unreliable, because that event is not always
> present in the log. In that case, initialization of boost::interprocess
> fails.
> Several bug reports exist for that issue, e.g. [1, 2].
>
> Report [1] contains a proposed fix to use GetTickCount64() and there is
> an open PR with an alternative fix to fall back to WMI mechanisms [3]. I
> understand that the fix [1] would need some polishing, because
> GetTickCount64() is not available in pre-Vista.
>
> Nevertheless, both proposed fixes have been uncommented and unconsidered
> for a while now. Is there any chance that the maintainers could look
> into this?

Thanks for the ping. I don't think GetTickCount64 is very reliable, as
other methods also have problems with time correction, hibernation, fast
bootup, etc.

In [1] one the last bootup log is lost new processes won't be able to
communicate with others. The same happens with [3]

In
http://www.boost.org/doc/libs/1_63_0/doc/html/interprocess/acknowledgements_notes.html#interprocess.acknowledgements_notes.notes_windows.notes_windows_shm_folder

there are some instructions to give up on kernel persistence and define
the directory at compile time or run-time. This is the best workaround
so far.

I've trying to find a solution with no luck. I tried:

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory
Management\PrefetchParameters\BootId

in modern Windows systems but hybrid shutdown (default since Windows 8)
does not seem to update it as kernel is suspended. Searching for a
unique bootup id in windows that does not suffer when hibernating or
correcting the RTC is really complicated.

Any suggestion welcomed. Best,

Ion


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk