Subject: [Boost-bugs] [Boost C++ Libraries] #10657: Win32 first time call to GetTimeZoneInformation crashes in launched coroutines
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-10-15 02:22:18
#10657: Win32 first time call to GetTimeZoneInformation crashes in launched
coroutines
------------------------------+-----------------------
Reporter: vinnie.falco@⦠| Owner: olli
Type: Bugs | Status: new
Milestone: To Be Determined | Component: coroutine
Version: Boost 1.56.0 | Severity: Problem
Keywords: |
------------------------------+-----------------------
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();
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/10657> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:17 UTC