Opened 11 years ago
#6494 new Bugs
Using BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG flag ruins date_time library under MinGW
Reported by: | Owned by: | az_sw_dude | |
---|---|---|---|
Milestone: | To Be Determined | Component: | date_time |
Version: | Boost 1.49.0 | Severity: | Problem |
Keywords: | BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG date_time MinGW | Cc: |
Description
I've built static boost libraries under windows (Win7 64) with MinGW 3.20 (32 bit, GCC 4.6.1) with BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG option and threading=multi link=static runtime-link=static address-model=32
Simple test like
#include <iostream> #include <boost/thread/thread.hpp> #include <boost/date_time/posix_time/posix_time.hpp> using namespace std; using namespace boost; void func() { this_thread::sleep(boost::posix_time::milliseconds(5000)); } int main() { thread trd(func); trd.join(); cout << "wait ok" << endl; return 0; }
When built statically with date_time and thread libraries.
It fails with segfault in date_time library. That happens in ctor of structure simple_time_rep, but I didn't dig too much. I guess the problem is in date_time library.
Without flag BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG it's going all right with timings and threads.
I also tried flags BOOST_HAS_WINTHREADS and _REENTRANT(for MinGW) - that does not affect the case. BOOST_THREAD_USE_LIB was defined (to let it work with static libs).
I've tested this for boost 1.48.0 and 1.49.0-beta1. Neither did work. I asked about this problem in boost mailing lists but got no answer, so I post it as a possible bug.
Sincerely, Yana A. Kireyonok