Boost logo

Boost :

Subject: Re: [boost] [serialization] uuid test_serialization ubsan error
From: James E. King, III (jking_at_[hidden])
Date: 2018-01-20 05:03:46


On Fri, Jan 19, 2018 at 11:55 PM, James E. King, III <jking_at_[hidden]>
wrote:

> I'm getting a ubsan test error in uuid/test/test_serialization - is the
> code in that test using archive the right way?
>
> testing.capture-output ../../../bin.v2/libs/uuid/
> test/test_serialization.test/gcc-7/debug/link-static/
> threadapi-pthread/test_serialization.run
> ====== BEGIN OUTPUT ======
> ../../../boost/archive/detail/interface_oarchive.hpp:47:16: runtime
> error: downcast of address 0x7ffca0c6fe30 which does not point to an object
> of type 'text_oarchive'
> 0x7ffca0c6fe30: note: object is of type 'boost::archive::text_
> oarchive_impl<boost::archive::text_oarchive>'
> 00 00 00 00 e0 2f 78 8f 48 56 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::text_
> oarchive_impl<boost::archive::text_oarchive>'
>
> EXIT STATUS: 1
> ====== END OUTPUT ======
>
>
I see the same thing in a ubsan build of DateTime, so I think this might be
in serialization, not in Uuid or DateTime.

testing.capture-output
../../bin.v2/libs/date_time/test/testgreg_serialize_xml.test/gcc-7/debug/cxxstd-03-iso/testgreg_serialize_xml.run
====== BEGIN OUTPUT ======
Running xml archive tests
../../boost/archive/detail/interface_oarchive.hpp:47:16: runtime
error: downcast of address 0x7ffc8d8a2a10 which does not point to an
object of type 'xml_oarchive'
0x7ffc8d8a2a10: note: object is of type
'boost::archive::xml_oarchive_impl<boost::archive::xml_oarchive>'
 48 7f 00 00 48 b8 60 46 48 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>'
EXIT STATUS: 1
====== END OUTPUT ======

Here's the command line I used with uuid to isolate it to one test:

jking_at_ubuntu:~/boost/libs/uuid/test$ ../../../b2 toolset=gcc-7
variant=debug cxxflags=-fno-omit-frame-pointer
cxxflags=-fsanitize=undefined cxxflags=-fno-sanitize-recover=undefined
linkflags=-fsanitize=undefined linkflags=-fno-sanitize-recover=undefined
define=BOOST_UUID_LIMITED_BENCH -q test_serialization

- Jim


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk