Serialization Pointer Already Has Reference Counting

Forum for posting problems using QxOrm library

Serialization Pointer Already Has Reference Counting

Postby Kasuax » Fri Jul 08, 2016 1:55 pm

I've run into a huge problem and I'm not sure how to go about fixing the issue because the framework is mishandling my data hierarchy somehow. I am using QtSharedPointers throughout my data set. I can no longer clone my top level object or import from xml because boost is not tracking pointer references correctly. Oddly enough I can still write to xml.

The following message appears consistently around the same type of nested object.
Code: Select all
QSharedPointer: pointer 0x42eab8 already has reference counting

1   qt_message_output                                                                                                                    qglobal.cpp                           
2   qt_message                                                                                                                           qglobal.cpp                           
3   qFatal                                                                                                                               qglobal.cpp                           
4   QtSharedPointer::ExternalRefCountData::setQObjectShared                                                                              qsharedpointer.cpp                   
5   QtSharedPointer::ExternalRefCount<QXC::ChannelSpec>::internalFinishConstruction                                                      qsharedpointer_impl.h                 
6   QtSharedPointer::ExternalRefCount<QXC::ChannelSpec>::internalConstruct                                                               qsharedpointer_impl.h                 
7   QtSharedPointer::ExternalRefCount<QXC::ChannelSpec>::ExternalRefCount<QXC::ChannelSpec>                                              qsharedpointer_impl.h                 
8   QSharedPointer<QXC::ChannelSpec>::QSharedPointer<QXC::ChannelSpec>                                                                   qsharedpointer_impl.h                 
9   boost::serialization::load<boost::archive::xml_iarchive,QXC::ChannelSpec>                                                            QxSerialize_QSharedPointer.h         
10  boost::serialization::free_loader<boost::archive::xml_iarchive,QSharedPointer<QXC::ChannelSpec>>::invoke                             split_free.hpp                       
11  boost::serialization::split_free<boost::archive::xml_iarchive,QSharedPointer<QXC::ChannelSpec>>                                      split_free.hpp                       
12  boost::serialization::serialize<boost::archive::xml_iarchive,QXC::ChannelSpec>                                                       QxSerialize_QSharedPointer.h         
13  boost::serialization::serialize_adl<boost::archive::xml_iarchive,QSharedPointer<QXC::ChannelSpec>>                                   serialization.hpp                     
14  boost::archive::detail::iserializer<boost::archive::xml_iarchive,QSharedPointer<QXC::ChannelSpec>>::load_object_data                 iserializer.hpp                       
15  boost::archive::detail::basic_iarchive::load_object                                                                                  boost_serialization_vc100_mt_gd_1_61 
16  boost::archive::detail::basic_iarchive::load_object                                                                                  boost_serialization_vc100_mt_gd_1_61 
17  boost::archive::detail::load_non_pointer_type<boost::archive::xml_iarchive>::load_standard::invoke<QSharedPointer<QXC::ChannelSpec>> iserializer.hpp                       
18  boost::archive::detail::load_non_pointer_type<boost::archive::xml_iarchive>::invoke<QSharedPointer<QXC::ChannelSpec>>                iserializer.hpp                       
19  boost::archive::load<boost::archive::xml_iarchive,QSharedPointer<QXC::ChannelSpec>>                                                  iserializer.hpp                       
20  boost::archive::detail::common_iarchive<boost::archive::xml_iarchive>::load_override<QSharedPointer<QXC::ChannelSpec>>               common_iarchive.hpp                   
... <More>                                                                                                                                                                                   



I've started researching more on boost serialization. This looked like a good place to start.
http://www.boost.org/doc/libs/1_58_0/li ... ecial.html

Any help would be greatly appreciated.

Thank you!
Kasuax
 
Posts: 62
Joined: Mon Jun 20, 2016 6:42 pm

Re: Serialization Pointer Already Has Reference Counting

Postby qxorm » Fri Jul 08, 2016 3:27 pm

Hello,

It seems that you mix QObject reference counting and QSharedPointer reference counting.
I don't know if it will help you, but here is a topic about your error message : http://blog.codef00.com/2011/12/15/not- ... edpointer/

Instead of XML, maybe you could try to export/import using JSON : JSON doesn't use boost serialization engine, so you could test it.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Serialization Pointer Already Has Reference Counting

Postby Kasuax » Fri Jul 08, 2016 5:08 pm

I had seen that article but already disregarded it because I wasn't using QObject child->parent functionality. I decided to remove all the QObjects from my project because I wasn't using them and ended up finding out that something there was causing the problem. Stay tuned, something nefarious is brewing.
Kasuax
 
Posts: 62
Joined: Mon Jun 20, 2016 6:42 pm


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 7 guests

cron