id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 456,1.33RC2: archive_pointer_[o/i]serializer assert problem,nobody,Robert Ramey,"{{{ Hello again, FYI .. i read the boost mailing list, so posting anwers there is ok for me ;-) I made some progress after reading ""rationale"" though some things still give headaches. I have polymorphic class hierarchy which gets serialized thru base ptrs (along with shared_ptr stuff). When using portable_binary_oarchive/iarchive (taken from boost example) an assert() triggers which raises some questions. oserializer.hpp: -------------- snip -------------- // 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::find(* true_type); assert(NULL != bpos_ptr); if(NULL == bpos_ptr) boost::throw_exception( archive_exception(archive_exception::unregistered_class) ); -------------- snip -------------- ""should never fail"" seems to fail and i dont know why ;-( (long callstack omitted) > test_protocollayers.exe!boost::archive::detail::save_pointer_type::polymorphic::save(portable_binary_oarchive & ar={...}, const xxx::ProtocolHeader & t={...}, const boost::archive::detail::basic_pointer_oserializer * bpos_ptr=0x00000000) Line 416 C++ test_protocollayers.exe!boost::archive::detail::save_pointer_type::save(portable_binary_oarchive & ar={...}, const xxx::ProtocolHeader & t={...}, const boost::archive::detail::basic_pointer_oserializer * bpos_ptr=0x00000000) Line 438 + 0x11 C++ test_protocollayers.exe!boost::archive::detail::save_pointer_type::invoke(portable_binary_oarchive & ar={...}, const xxx::ProtocolHeader * const t=0x00680698) Line 466 + 0x11 C++ test_protocollayers.exe!boost::archive::save(portable_binary_oarchive & ar={...}, const xxx::ProtocolHeader * const & t=0x00680698) Line 535 + 0xf C++ The classes usually contain: ""template void serialize( Archive & ar, const unsigned int /* version */)"" stuff, along with explicit: ""boost::serialization::void_cast_register(0,0);"" in ctors (or it doesnt work). ""this_type"" = abstract base ""true_type"" = derived both classes are successfully retrieved via type info (registered class). The ""vp = serialization::void_downcast(*true_type, *this_type, &t);"" works too (because the void_cast_register). But it doesnt find appropriate basic_pointer_oserializer .... I placed a breakpoint at ""basic_serializer_map::insert(const basic_serializer * bs)"" to see what types get registered at startup (initterm ctors). There are indeed registrations but some (derived) types are missing. What gives? BTW ... could you make ""portable_binary_oarchive"" (and iarchive) included in available boost archive types? I find it useful because serialization is used in cross platform protocol stacks (little vs. big endian archs). Is there any chance to reduce binary overhead due to registration data (shared_ptr/type info ... binary size almost doubled due to contained type info in small payloads). Can stringified type info be omitted/shortened (i use hierachial namespaces which blow the length)? Regards, A. Focht }}}",Bugs,closed,,serialization,None,,Fixed,,