Boost C++ Libraries: Ticket #3822: boost/asio/buffer.hpp MSVC workaround is inaccurately targeted https://svn.boost.org/trac10/ticket/3822 <p> This was reported to Microsoft as a bug in VC10 Beta 2 (see <a class="ext-link" href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=522096"><span class="icon">​</span>http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=522096</a> ), but is actually a bug in Boost.Asio, caused by an inaccurately targeted workaround for a bug in VC8! </p> <p> The offending code is in boost/asio/buffer.hpp : </p> <blockquote> <p> ~buffer_debug_check() { </p> </blockquote> <p> #if BOOST_WORKAROUND(BOOST_MSVC, &gt;= 1400) </p> <blockquote> <p> <em> MSVC's string iterator checking may crash in a std::string::iterator </em> object's destructor when the iterator points to an already-destroyed <em> std::string object, unless the iterator is cleared first. iter_ = Iterator(); </em></p> </blockquote> <p> #endif <em> BOOST_WORKAROUND(BOOST_MSVC, &gt;= 1400) </em></p> <blockquote> <p> } </p> </blockquote> <p> The bug mentioned by the comment affected only VC8 (_MSC_VER == 1400). VC9 RTM and later are unaffected, as I fixed this bug in VC9 RTM. Therefore, the BOOST_WORKAROUND should check for == 1400, not &gt;= 1400. </p> <p> (This workaround uses a singular iterator as the source of an assignment, which triggers undefined behavior. This crashes VC10 Beta 2 due to the extensive changes we made in the STL. It should probably trigger an assert dialog - I've made a note to myself about that. But in any event, a conformant implementation is allowed to explode when it sees this. I believe the workaround is correct for VC8, and it appears to be harmless for VC9, but restricting it to VC8 would be ideal.) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3822 Trac 1.4.3 chris_kohlhoff Wed, 06 Jan 2010 03:49:25 GMT <link>https://svn.boost.org/trac10/ticket/3822#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3822#comment:1</guid> <description> <p> This is related to ticket <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3796" title="#3796: Bugs: &#34;Unhandled exception&#34; with boost::asio library in vs2010 beta 2 (closed: fixed)">#3796</a>. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Wed, 06 Jan 2010 03:51:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3822#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3822#comment:2</guid> <description> <p> Changeset <a class="changeset" href="https://svn.boost.org/trac10/changeset/58740" title="Use buffer debugging workaround with MSVC 8 only. ">[58740]</a> on trunk changes the test to _MSC_VER == 1400. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>chris_kohlhoff</dc:creator> <pubDate>Mon, 11 Jan 2010 02:34:08 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3822#comment:3 https://svn.boost.org/trac10/ticket/3822#comment:3 <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/58883" title="Merge from trunk. Fixes #3743, #3670, #3822. ........ r58670 | ...">[58883]</a>) Merge from trunk. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3743" title="#3743: Patches: support for partially broken compilers/platforms (closed: fixed)">#3743</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3670" title="#3670: Bugs: endless loop in dev_poll_reactor on Solaris (closed: fixed)">#3670</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3822" title="#3822: Bugs: boost/asio/buffer.hpp MSVC workaround is inaccurately targeted (closed: fixed)">#3822</a>. </p> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/58670" title="Fix example to compile with MSVC 10 beta 2. ">r58670</a> | chris_kohlhoff | 2010-01-04 23:33:04 +1100 (Mon, 04 Jan 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Fix example to compile with MSVC 10 beta 2. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/58671" title="Fix Win64 warnings. ">r58671</a> | chris_kohlhoff | 2010-01-04 23:33:42 +1100 (Mon, 04 Jan 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Fix Win64 warnings. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/58703" title="Include boost/limits.hpp rather than &lt;limits&gt;, to support older ...">r58703</a> | chris_kohlhoff | 2010-01-05 22:51:41 +1100 (Tue, 05 Jan 2010) | 3 lines </p> </blockquote> <p> </p> <blockquote> <p> Include boost/limits.hpp rather than &lt;limits&gt;, to support older compilers. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3743" title="#3743: Patches: support for partially broken compilers/platforms (closed: fixed)">#3743</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/58704" title="Drop back to second_clock if microsec_clock is unavailable. Refs #3743. ">r58704</a> | chris_kohlhoff | 2010-01-05 23:20:10 +1100 (Tue, 05 Jan 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Drop back to second_clock if microsec_clock is unavailable. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3743" title="#3743: Patches: support for partially broken compilers/platforms (closed: fixed)">#3743</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/58705" title="Use sockatmark if SIOCATMARK is not defined. Refs #3743. ">r58705</a> | chris_kohlhoff | 2010-01-05 23:50:39 +1100 (Tue, 05 Jan 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Use sockatmark if SIOCATMARK is not defined. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3743" title="#3743: Patches: support for partially broken compilers/platforms (closed: fixed)">#3743</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/58740" title="Use buffer debugging workaround with MSVC 8 only. ">r58740</a> | chris_kohlhoff | 2010-01-06 13:38:39 +1100 (Wed, 06 Jan 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Use buffer debugging workaround with MSVC 8 only. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/58761" title="Disable iostreams-related functionality if BOOST_NO_IOSTREAMS is ...">r58761</a> | chris_kohlhoff | 2010-01-06 23:27:05 +1100 (Wed, 06 Jan 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Disable iostreams-related functionality if BOOST_NO_IOSTREAMS is defined. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3743" title="#3743: Patches: support for partially broken compilers/platforms (closed: fixed)">#3743</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/58762" title="Apply fix for reported excessive CPU usage under Solaris. Refs #3670. ">r58762</a> | chris_kohlhoff | 2010-01-06 23:36:51 +1100 (Wed, 06 Jan 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Apply fix for reported excessive CPU usage under Solaris. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3670" title="#3670: Bugs: endless loop in dev_poll_reactor on Solaris (closed: fixed)">#3670</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/58782" title="Disable handler allocation and invocation hooks on g++ 2.x. Refs #3743. ">r58782</a> | chris_kohlhoff | 2010-01-07 09:44:48 +1100 (Thu, 07 Jan 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Disable handler allocation and invocation hooks on g++ 2.x. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3743" title="#3743: Patches: support for partially broken compilers/platforms (closed: fixed)">#3743</a>. </p> </blockquote> <p> ........ </p> <blockquote> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/58793" title="Support platforms that don't define INET6_ADDRSTRLEN. Refs #3743. ">r58793</a> | chris_kohlhoff | 2010-01-08 09:18:16 +1100 (Fri, 08 Jan 2010) | 2 lines </p> </blockquote> <p> </p> <blockquote> <p> Support platforms that don't define INET6_ADDRSTRLEN. Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3743" title="#3743: Patches: support for partially broken compilers/platforms (closed: fixed)">#3743</a>. </p> </blockquote> <p> ........ </p> Ticket