[Boost-bugs] [Boost C++ Libraries] #11699: Forward declarations of std templates causes stack corruption under Visual Studio 2015

Subject: [Boost-bugs] [Boost C++ Libraries] #11699: Forward declarations of std templates causes stack corruption under Visual Studio 2015
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-09-30 16:13:16


#11699: Forward declarations of std templates causes stack corruption under Visual
Studio 2015
-------------------------------------------------+-------------------------
 Reporter: Attila Mitrócsák | Owner: igaztanaga
  <attila.mitrocsak@…> | Status: new
     Type: Bugs | Component:
Milestone: To Be Determined | interprocess
  Version: Boost 1.59.0 | Severity: Problem
 Keywords: |
-------------------------------------------------+-------------------------
 In Visual Studio 2015 it can lead to stack corruption if I instantiate
 std::basic_istream with the same types in two compilation units, and one
 of them forward declares the template and the other doesn't.

 I originally run into this problem when I called a funtion in a library
 that called boost::lexical_cast. The source file containing the function
 included a header from interprocess, which included
 interprocess/detail/std_fwd.hpp which contains a forward declaration of
 std::basic_istream.

 Unfortunately std::basic_istream was also instatiated with the same types
 in my main program (but there was no forward declaration).

 I presume this can happen with other templates as well, but so far this is
 the only one I found.

 The same code was working fine with Visual Studio 2013.

 I created two small solutions:
 - BoostStackCorruption_VS2015: using boost::lexical_cast and an
 interprocess header
 - StdStackCorruption_VS2015: using only std but with lines coming from the
 insides of lexical_cast and interprocess/detail/std_fwd.hpp

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11699>
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:19 UTC