[serialization] uuid test_serialization ubsan error
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_implboost::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_implboost::archive::text_oarchive' EXIT STATUS: 1 ====== END OUTPUT ====== Thanks, Jim
On Fri, Jan 19, 2018 at 11:55 PM, James E. King, III
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_implboost::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_implboost::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_implboost::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_implboost::archive::xml_oarchive' EXIT STATUS: 1 ====== END OUTPUT ====== Here's the command line I used with uuid to isolate it to one test: jking@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
On 1/19/18 9:03 PM, James E. King, III via Boost wrote:
On Fri, Jan 19, 2018 at 11:55 PM, James E. King, III
wrote: I'm getting a ubsan test error in uuid/test/test_serialization - is the code in that test using archive the right way?
I saw new test failures in the test matrix under Darwin/Marshall-UBSAN but I don't see them now. It's totally believable to me that there is some undefined behavior in the serialization library implementation. In fact, it may well be that the serialization library cannot perform all it's functionality or pass all it's tests without using undefined behavior. Of course this would raise a number of interesting questions but first I want to spend some time looking at this. I don't have time right now but I will get to it. I have one other subtle pending issue to resolve. Neither of these are "quick fixes" that one can just implement with some serious thought. Robert Ramey
On 1/20/2018 10:32 AM, Robert Ramey via Boost wrote:
On 1/19/18 9:03 PM, James E. King, III via Boost wrote:
On Fri, Jan 19, 2018 at 11:55 PM, James E. King, III
wrote: I'm getting a ubsan test error in uuid/test/test_serialization - is the code in that test using archive the right way?
I saw new test failures in the test matrix under Darwin/Marshall-UBSAN but I don't see them now. It's totally believable to me that there is some undefined behavior in the serialization library implementation. In fact, it may well be that the serialization library cannot perform all it's functionality or pass all it's tests without using undefined behavior. Of course this would raise a number of interesting questions but first I want to spend some time looking at this. I don't have time right now but I will get to it. I have one other subtle pending issue to resolve. Neither of these are "quick fixes" that one can just implement with some serious thought.
Is the other pending issue this: https://svn.boost.org/trac10/ticket/13354? From what we have found with Visual Studio 2017, 15.5.4 and newer, the cppunit teardown() is doing something it likely should not. The solution we are using in the affected test cases is to add internal scoping braces around the serialization code. The cppunit teardown() call no longer interferes with the 1.66 serialization implementation, inside the basic_xml_grammar.ipp, approximately line 196. Sincerely, Robert
Robert Ramey
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (3)
-
James E. King, III
-
Robert
-
Robert Ramey