Boost C++ Libraries: Ticket #9489: boost::date_time::time_resolution_traits uses 32-bit seconds for 64-bit systems https://svn.boost.org/trac10/ticket/9489 <p> boost::date_time::time_resolution_traits defaults to boost::int32_t for its v_type parameter. This means that for 64-bit systems, such as time_resolution_traits_bi64_impl and time_resolution_traits_adapted64_impl, date-times whose seconds count exceed the int32_t limit will overflow, returning a negative value for boost::posix_time::time_duration::total_seconds. </p> <p> The attached file reproduces the issue. The output on a 64-bit Intel(R) Xeon system running Linux is: </p> <blockquote> <p> 2038-Jan-19 03:14:08 -2147483648 </p> </blockquote> <p> We have found that changing the v_type definition from boost::int32_t to typename frac_sec_type::int_type resolves the issue by associating v_type with its implementation's definition. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9489 Trac 1.4.3 mreissne@… Thu, 12 Dec 2013 19:31:19 GMT attachment set https://svn.boost.org/trac10/ticket/9489 https://svn.boost.org/trac10/ticket/9489 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-posix-date-time-overflow.cpp</span> </li> </ul> <p> Test program to reproduce the error </p> Ticket maxim.yegorushkin@… Fri, 20 Dec 2013 11:38:30 GMT <link>https://svn.boost.org/trac10/ticket/9489#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9489#comment:1</guid> <description> <p> I hit this issue as well. </p> <p> The documentation says duration::total_seconds() returns long, whereas it currently incorrectly returns int. </p> </description> <category>Ticket</category> </item> <item> <author>maxim.yegorushkin@…</author> <pubDate>Fri, 20 Dec 2013 11:40:16 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/9489 https://svn.boost.org/trac10/ticket/9489 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">date_time_ticket_9489.patch</span> </li> </ul> <p> A patch, as proposed by the ticket author. </p> Ticket Georg Sauthoff <mail@…> Sun, 19 Jan 2014 19:13:54 GMT cc set https://svn.boost.org/trac10/ticket/9489#comment:2 https://svn.boost.org/trac10/ticket/9489#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">mail@…</span> added </li> </ul> Ticket James E. King, III Thu, 18 Jan 2018 14:02:36 GMT milestone changed https://svn.boost.org/trac10/ticket/9489#comment:3 https://svn.boost.org/trac10/ticket/9489#comment:3 <ul> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.67.0</span> </li> </ul> <p> This was resolved as part of github issue 56: </p> <p> <a class="ext-link" href="https://github.com/boostorg/date_time/commit/de171954fe45e4d1338a641ebe70a84a181bd258"><span class="icon">​</span>https://github.com/boostorg/date_time/commit/de171954fe45e4d1338a641ebe70a84a181bd258</a> </p> <p> The type has been changed to int64_t. </p> <p> Additional y2038 issues were also found in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/11142" title="#11142: Bugs: boost::date_time::period_parser::delimiter_strings setter doesn't set ... (closed: fixed)">#11142</a>: </p> <p> <a class="ext-link" href="https://github.com/boostorg/date_time/commit/18b6ca816067cd143954bfb94f42eb29a1637a45#diff-b30985870682449169eb765b8e032ef1R51"><span class="icon">​</span>https://github.com/boostorg/date_time/commit/18b6ca816067cd143954bfb94f42eb29a1637a45#diff-b30985870682449169eb765b8e032ef1R51</a> </p> Ticket James E. King, III Thu, 18 Jan 2018 14:02:44 GMT owner, status changed https://svn.boost.org/trac10/ticket/9489#comment:4 https://svn.boost.org/trac10/ticket/9489#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">az_sw_dude</span> to <span class="trac-author">James E. King, III</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket James E. King, III Sun, 28 Jan 2018 16:24:09 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9489#comment:5 https://svn.boost.org/trac10/ticket/9489#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fix merged to master; resolved. </p> Ticket