Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5876: Serialization - tracking of non-versioned classes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-01-23 17:45:16
#5876: Serialization - tracking of non-versioned classes
-------------------------------------+--------------------------------------
Reporter: ybungalobill@⦠| Owner: ramey
Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
Version: Boost 1.47.0 | Severity: Showstopper
Resolution: | Keywords:
-------------------------------------+--------------------------------------
Comment (by ybungalobill@â¦):
> But this is the intended behavior! If this wasn't true, pointers to
objects previously serialized as objects wouldn't be restored properly.
I find it counter-intuitive. I expect objects serialized as objects to
mean 'by value' and not be tracked, while objects serialized by pointer to
mean 'by reference' and be tracked. Anyway it's your choice and I won't
criticize it.
The problem is that you can't implement the intended behavior properly for
object_serializable. The above code is a minimal code that reproduces the
problem, but it's not hypothetical. The real world scenario went like
this:
3rd party interprocess communication library used serialization by pointer
in generic code. It happened that we passed vector<int> between two
processes, so it serialized it through vector<int>*. Another unrelated
part of our codebase serialized shared_ptr<vector<int>> which in turn is
serialized through vector<int>*. Note that nowhere the user (me) played
with the implementation level. Each part is valid in isolation. So far so
good.
We updated from boost 1.33.1 to boost 1.47.0. It got broken. Why? I don't
exactly know. My hypothesis is that because the way singletons are created
had changed (function statics in 1.33.1 versus class statics in 1.47.0)
the linker handles them differently.
Whatever the reason I think that code that breaks depending on the
existence of some unrelated other code is worse than the inability to
serialize object_serializable object as object and then track it through a
pointer.
Thank you,[[BR]]
Yakov Galka
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5876#comment:3> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:08 UTC