Opened 15 years ago
Closed 15 years ago
#1036 closed Bugs (fixed)
assert failure in oserializer.hpp:418
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | To Be Determined | Component: | Building Boost |
Version: | Boost 1.34.0 | Severity: | Showstopper |
Keywords: | Cc: |
Description
a.out: /usr/include/boost/archive/detail/oserializer.hpp:418: static void boost::archive::detail::save_pointer_type<Archive, TPtr>::polymorphic<T>::save(Archive&, const T&, const boost::archive::detail::basic_pointer_oserializer*) [with T = I, Archive = boost::archive::binary_oarchive, TPtr = I*]: Assertion `null != bpos_ptr' failed.
from oserializer.hpp:
sice true_type is valid, and this only gets made if the pointer oserializer object has been created, this should never fail bpos_ptr = archive_pointer_oserializer<Archive>::find(* true_type); assert(NULL != bpos_ptr);
using ubuntu 7.04 64 bits (gcc 4.1.1) and boost 1.33.1 attached file is source code to raise it.
Attachments (1)
Change History (4)
by , 15 years ago
Attachment: | bugasert418.cpp added |
---|
comment:1 by , 15 years ago
Owner: | set to |
---|
comment:2 by , 15 years ago
Status: | new → assigned |
---|
comment:3 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I have studied this interesting case and made changes such that the assertion is no longer invoked.
However, there is another problem with this example which prevents it from working. The saving of T resolves to:
T -> A -> E -> C, I -> *J (abstract base) -> B
But no instance of B as been yet serialized so it is not registered with the archive. This can be remedied by inverting a number of ways:
a) the sequence A, B in serializaiton can be inverted
b) using ar.register(...) to explicitly register B
c) exporting B
I've reproduced this with that latest version. I'm investigating this.
Robert Ramey