Boost logo

Boost Users :

Subject: [Boost-users] [filesystem] running afoul of _HAS_ITERATOR_DEBUGGING - VC 9.0
From: Raman (raman.arora_at_[hidden])
Date: 2009-01-16 15:15:56


Hello,

I'm a boost newbie, so please bear with me if this sounds trivial.

I'm rebuilding our code that uses boost heavily with VC 9.0 on
Windows 2008, 32-bit.

All of our code is compiled with _SECURE_SCL=0 & _HAS_ITERATOR_DEBUGGING=0.
And I rebuild boost with the same flags.

Our code links with boost as static libraries.

However, at runtime - I'm seeing access violations occuring
in the Microsoft secure STL code that should have been disabled with
_HAS_ITERATOR_DEBUGGING=0.

A specific example, when we call filesystem::basic_path::normalize(),
this calls:

// path.hpp
template<class String, class Traits>
   void basic_path<String, Traits>::m_append_separator_if_needed()
{
    if (
# ifdef BOOST_WINDOWS_PATH
        *(m_path.end()-1) != colon<path_type>::value &&
# endif
// >>>>>> following is the offending line
        *(m_path.end()-1) != slash<path_type>::value )
      {
        m_path += slash<path_type>::value;
      }
}

which leads me to:

//xtring
reference __CLR_OR_THIS_CALL operator*() const
{ // return designated object
#if _HAS_ITERATOR_DEBUGGING
    if (this->_Mycont == 0 || _Myptr == 0
// >>>>>> following is the offending line - _MyCont contains garbage
        || _Myptr < ((_Mystring *)this->_Mycont)->_Myptr()
        || ((_Mystring *)this->_Mycont)->_Myptr()
        + ((_Mystring *)this->_Mycont)->_Mysize <= _Myptr)
    {
    _DEBUG_ERROR("string iterator not dereferencable");
    SCL_SECURE_OUT_OF_RANGE;
    }
__analysis_assume(_Myptr != 0);
#else
    if (this->_Mycont != _IGNORE_MYCONT)
    {
        _SCL_SECURE_VALIDATE(this->_Has_container());
        _SCL_SECURE_VALIDATE_RANGE(_Myptr < (((_Mystring
*)this->_Mycont)->_Myptr() + ((_Mystring *)(this->_Mycont))->_Mysize));
    }
#endif /* _HAS_ITERATOR_DEBUGGING */
       return (*_Myptr);
}

I'm stumped as to why its even in that piece of code when I've disabled
HAS_ITERATOR_DEBUGGING.

Any help/guidance is appreciated.

Thanks
Raman


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net