Opened 8 years ago
Closed 7 years ago
#10657 closed Bugs (wontfix)
Win32 first time call to GetTimeZoneInformation crashes in launched coroutines
Reported by: | Owned by: | olli | |
---|---|---|---|
Milestone: | To Be Determined | Component: | coroutine |
Version: | Boost 1.56.0 | Severity: | Problem |
Keywords: | Cc: |
Description
When an application's first call GetTimeZoneInformation is from a launched coroutine, an unhandled exception is generated. A workaround is to call GetTimeZoneInformation at least once before launching any coroutines. This sample program compiles under Visual Studio and crashes:
#define _WIN32_WINNT 0x6000 #include <boost/asio/io_service.hpp> #include <boost/asio/spawn.hpp> #include <functional> #include <Windows.h> TIME_ZONE_INFORMATION tzi; void die(boost::asio::yield_context yield) { GetTimeZoneInformation(&tzi); } int main() { // Uncommenting the following line eliminates the crash //GetTimeZoneInformation(&tzi); boost::asio::io_service ios; boost::asio::spawn (ios, std::bind (&die, std::placeholders::_1)); ios.run(); }
Change History (3)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
I believe GetTimeZoneInformation calls LoadLibraryEx which calls BaseGetProcessDllPath which dies in TlsGetValue. TlsGetValue can die if the TLS slot is uninitialized.
comment:3 by , 7 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Unfortunately I got the info from Microsoft that some parts of the TIB have to be swapped during context switch too - but Microsoft refused to share which parts.
Stack: