Re: [Boost-bugs] [Boost C++ Libraries] #9612: Memory Access Violation when recursively serializing classes

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9612: Memory Access Violation when recursively serializing classes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-02-07 19:12:46


#9612: Memory Access Violation when recursively serializing classes
------------------------------------------+---------------------------
  Reporter: Chris Rusby <chris.rusby@…> | Owner: ramey
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: serialization
   Version: Boost 1.55.0 | Severity: Problem
Resolution: invalid | Keywords:
------------------------------------------+---------------------------

Comment (by Chris Rusby <chris.rusby@…>):

 I have finally figured out the cause of the 2nd crash. Here's what was
 going on.

 I was serializing in/out (correctly) shared_ptr<const Object>. In a
 completely different part of the codebase, somebody else was serializing
 out a shared_ptr<const Object> but serializing it back in as a
 shared_ptr<Object>.

 If I tested my code, it worked fine. However, if both the other code and
 mine were used in the same serialized file I got a null pointer exception
 (same place as above).

 I think the erroneous code was messing up the type registration in some
 way. It would be really nice if this could be caught at compile time -
 although I must admit, I can't think of any way to do this. Maybe the
 library could throw a nicer runtime error though? I guess the downside is
 performance?

 Thanks,

 Chris

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9612#comment:12>
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:15 UTC