Subject: [Boost-bugs] [Boost C++ Libraries] #3822: boost/asio/buffer.hpp MSVC workaround is inaccurately targeted
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-01-06 00:57:14
#3822: boost/asio/buffer.hpp MSVC workaround is inaccurately targeted
----------------------------------------------------+-----------------------
Reporter: Stephan T. Lavavej <stl@â¦> | Owner: chris_kohlhoff
Type: Bugs | Status: new
Milestone: Boost 1.42.0 | Component: asio
Version: Boost 1.41.0 | Severity: Problem
Keywords: |
----------------------------------------------------+-----------------------
This was reported to Microsoft as a bug in VC10 Beta 2 (see
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=522096
), but is actually a bug in Boost.Asio, caused by an inaccurately targeted
workaround for a bug in VC8!
The offending code is in boost/asio/buffer.hpp :
~buffer_debug_check()
{
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
// MSVC's string iterator checking may crash in a
std::string::iterator
// object's destructor when the iterator points to an already-
destroyed
// std::string object, unless the iterator is cleared first.
iter_ = Iterator();
#endif // BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
}
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 >= 1400.
(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.)
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3822> 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:02 UTC