Page 1 of 1

Double Delete On Deserialization

PostPosted: Wed Jan 10, 2018 4:48 am
by Kasuax
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()))


Re: Double Delete On Deserialization

PostPosted: Wed Jan 10, 2018 4:55 am
by Kasuax
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

Re: Double Delete On Deserialization

PostPosted: Wed Jan 10, 2018 2:55 pm
by Kasuax
I confirmed, I am using QxOrm 1.4.3 and this issue is still present...

Re: Double Delete On Deserialization

PostPosted: Wed Jan 10, 2018 4:28 pm
by qxorm
Hello,
Could you please provide a minimal project to reproduce the issue ?

Re: Double Delete On Deserialization

PostPosted: Wed Jan 17, 2018 1:43 am
by Kasuax
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.