[Boost-bugs] [Boost C++ Libraries] #12913: Undefined behaviour in serialization library

Subject: [Boost-bugs] [Boost C++ Libraries] #12913: Undefined behaviour in serialization library
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-03-19 18:28:47


#12913: Undefined behaviour in serialization library
-------------------------------------+---------------------------
 Reporter: johnmaddock | Owner: ramey
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+---------------------------
 Hi Robert,

 while testing multiprecision with clang's sanitizers I found some
 undefined behaviour in the serialization lib. The issue can be seen by
 running serialization's own tests with undefined-behaviour sanitizer
 turned on - in fact nearly all the tests fail, but most of the failures
 look like issues with the tests rather than the library. However building
 test_binary_xml_archive with clang++ -fsanitize=address
 -fsanitize=undefined -fno-sanitize-recover=undefined results in:

 {{{
 ../../../boost/archive/detail/interface_oarchive.hpp:47:16: runtime error:
 downcast of address 0x7ffd0a934990 which does not point to an object of
 type 'boost::archive::xml_oarchive'
 0x7ffd0a934990: note: object is of type
 'boost::archive::xml_oarchive_impl<boost::archive::xml_oarchive>'
  fd 7f 00 00 78 ae d3 9c d6 7f 00 00 00 00 00 00 00 00 00 00 00 00 00
 00 00 00 00 00 00 00 00 00
               ^~~~~~~~~~~~~~~~~~~~~~~
               vptr for
 'boost::archive::xml_oarchive_impl<boost::archive::xml_oarchive>'
 SUMMARY: AddressSanitizer: undefined-behavior
 ../../../boost/archive/detail/interface_oarchive.hpp:47:16 in

 }}}

 Which looks like a genuine issue to me.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12913>
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-03-19 18:32:11 UTC