Double Delete On Deserialization

Open discussion on QxOrm library

Double Delete On Deserialization

Postby Kasuax » Wed Jan 10, 2018 4:48 am

I have an object / project structure that is serialized to a binary file. Sub objects reference the parent object.
After performing the call below, the private data of item and the child related objects all point the same physical address but somehow share 2 separate instance of QSharedPointer. The outer QSharedPointer item has it's own instance and all the children are referencing the other instance.

Outer instance strong ref count = 1;
Children instances strong ref count = 75;

As a result when I go to clean up this object I'm stuck with a double delete segfault...
Help?

Code: Select all

  QSharedPointer<T> item;

        if (qx::serialization::binary::from_file(item, fileInfo.absoluteFilePath()))

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

Re: Double Delete On Deserialization

Postby Kasuax » Wed Jan 10, 2018 4:55 am

According to Patch 1.4.3 this is fixed?
- Fix an issue with QSharedPointer and boost::serialization when a same raw pointer is shared by several QSharedPointer during deserialization process
Kasuax
 
Posts: 62
Joined: Mon Jun 20, 2016 6:42 pm

Re: Double Delete On Deserialization

Postby Kasuax » Wed Jan 10, 2018 2:55 pm

I confirmed, I am using QxOrm 1.4.3 and this issue is still present...
Kasuax
 
Posts: 62
Joined: Mon Jun 20, 2016 6:42 pm

Re: Double Delete On Deserialization

Postby qxorm » Wed Jan 10, 2018 4:28 pm

Hello,
Could you please provide a minimal project to reproduce the issue ?
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Double Delete On Deserialization

Postby Kasuax » Wed Jan 17, 2018 1:43 am

Might be a while, that's more effort than I'm prepared to put into this issue at the moment.
I'll see what I can do soon.
Kasuax
 
Posts: 62
Joined: Mon Jun 20, 2016 6:42 pm


Return to QxOrm - Open discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron