Boost C++ Libraries: Ticket #8391: boost::local_time::tz_database::load_from_file uses unchecked iterator https://svn.boost.org/trac10/ticket/8391 <p> Program exits with: </p> <p> /usr/local/include/boost/token_iterator.hpp:56: const Type&amp; boost::token_iterator&lt;<a class="missing wiki">TokenizerFunc</a>, Iterator, Type&gt;::dereference() const [with <a class="missing wiki">TokenizerFunc</a> = boost::char_separator&lt;char, std::char_traits&lt;char&gt; &gt;, Iterator = <span class="underline">gnu_cxx::</span>normal_iterator&lt;const char*, std::basic_string&lt;char&gt; &gt;, Type = std::basic_string&lt;char&gt;]: Assertion `valid_' failed. </p> <p> /boost/date_time/tz_db_base.hpp: </p> <p> tokenizer_iterator tok_iter = tokens.begin(); </p> <p> tok_iter should be verified before using atoi(). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8391 Trac 1.4.3 frank.oosterhuis@… Thu, 04 Apr 2013 12:25:27 GMT attachment set https://svn.boost.org/trac10/ticket/8391 https://svn.boost.org/trac10/ticket/8391 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">main.cpp</span> </li> </ul> <p> test program </p> Ticket frank.oosterhuis@… Thu, 04 Apr 2013 12:25:48 GMT attachment set https://svn.boost.org/trac10/ticket/8391 https://svn.boost.org/trac10/ticket/8391 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">date_time_zonespec.csv</span> </li> </ul> <p> faulty csv </p> Ticket frank.oosterhuis@… Thu, 04 Apr 2013 12:26:22 GMT severity, milestone changed https://svn.boost.org/trac10/ticket/8391#comment:1 https://svn.boost.org/trac10/ticket/8391#comment:1 <ul> <li><strong>severity</strong> <span class="trac-field-old">Problem</span> → <span class="trac-field-new">Showstopper</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.54.0</span> </li> </ul> Ticket frank.oosterhuis@… Thu, 04 Apr 2013 12:39:07 GMT attachment set https://svn.boost.org/trac10/ticket/8391 https://svn.boost.org/trac10/ticket/8391 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">b8391.patch</span> </li> </ul> <p> patch </p> Ticket frank@… Fri, 05 Apr 2013 11:10:17 GMT cc set https://svn.boost.org/trac10/ticket/8391#comment:2 https://svn.boost.org/trac10/ticket/8391#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">frank@…</span> added </li> </ul> Ticket Marshall Clow Tue, 04 Jun 2013 20:11:26 GMT owner changed https://svn.boost.org/trac10/ticket/8391#comment:3 https://svn.boost.org/trac10/ticket/8391#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">az_sw_dude</span> to <span class="trac-author">Marshall Clow</span> </li> </ul> <p> When I run this test, I get <em>execption: bad lexical cast: source type value could not be interpreted as target</em>, and applying the supplied patch does not change this. </p> <p> I agree there's a problem here, and I think that the code you're patching can be made more robust, but the bug that your code is triggering is (I think) not the one that your patch fixes. </p> <p> Then again, I'm not running in gcc debug mode. </p> Ticket frank.oosterhuis@… Wed, 05 Jun 2013 09:49:18 GMT <link>https://svn.boost.org/trac10/ticket/8391#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8391#comment:4</guid> <description> <p> I am not able to get the same execption (bad lexical cast). Always crashes with "Assertion `valid_' failed." </p> <p> Tested with 1.53, 1.54_beta0 and trunk (<a class="changeset" href="https://svn.boost.org/trac10/changeset/84644" title="[range] Don't include &lt;istream&gt; unnecessarily in istream_range.hpp ...">r84644</a>). </p> <p> Compiled using: g++ -I ../boost_1_53_0 ./main.cpp -o ./bin/bug_boost_153 Version: gcc version 4.7.3 (<a class="missing wiki">Ubuntu/Linaro</a> 4.7.3-1ubuntu1) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Wed, 05 Jun 2013 20:04:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8391#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8391#comment:5</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/84645" title="More error checking on tz files; Refs #8391">[84645]</a>) More error checking on tz files; Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8391" title="#8391: Bugs: boost::local_time::tz_database::load_from_file uses unchecked iterator (closed: fixed)">#8391</a> </p> </description> <category>Ticket</category> </item> <item> <author>frank.oosterhuis@…</author> <pubDate>Thu, 13 Jun 2013 09:14:58 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8391#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8391#comment:6</guid> <description> <p> Fix confirmed. </p> <p> boost::local_time::bad_field_count is now thrown. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Thu, 13 Jun 2013 14:00:49 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/8391#comment:7 https://svn.boost.org/trac10/ticket/8391#comment:7 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/84755" title="Apply patch to release branch; Fixes #8391">[84755]</a>) Apply patch to release branch; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8391" title="#8391: Bugs: boost::local_time::tz_database::load_from_file uses unchecked iterator (closed: fixed)">#8391</a> </p> Ticket