Re: [Boost-bugs] [Boost C++ Libraries] #3604: Access violation on diamond inheritance

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3604: Access violation on diamond inheritance
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-12-02 08:03:33

#3604: Access violation on diamond inheritance
  Reporter: kondo@… | Owner: ramey
      Type: Support Requests | Status: reopened
 Milestone: Boost 1.41.0 | Component: serialization
   Version: Boost 1.40.0 | Severity: Not Applicable
Resolution: | Keywords:
Changes (by kondo@…):

  * status: closed => reopened
  * resolution: invalid =>


 I hesitated to reopen this ticket.

 If the serialization library doesn't support the object serialization via
 virtual base class, this idea might be a expansion proposal.

 Should I create a new ticket as enhancement?

 I wrote the patch(ticket3604.patch) seems to resolve this problem.

 After applying this patch, Both EXPORT sequences in main.cpp work

 This patch is for trunk.

 Please try it.

 It is based on next idea.

 = Background (My opinion) =
 I think if the information in void_caster_registry is correct, we can
 serialize the target class via virtual base class.

 The void_caster_registry means a table that we can get it to call

 It might be out of standard C++, but most of compiler works correctly.

 = Strategy =
 Avoid overwriting the virtual inheritance information in recursive
 register process.

 = Modification =
 Add the new data member m_includes_virtual_base to class void_caster.

 In void_caster::recursive_register() member function,
 m_includes_virtual_base memorize virtual inheritance information from the
 argument includes_virtual_base.

 When the program creates the void_caster_shortcut object in
 void_caster::recursive_register(), pass the 4th argument
 '(*it)->m_includes_virtual_base || includes_virtual_base' instead of

 As a result, the virtual inheritance information in void_caster_registry
 is kept.

 = Result report =
 void_caster_registry information
 == OK Case ==
 EXPORT seruqnce:Target,Sub1

 Before patching and after patching made same result.

 MIVB means m_includes_virtual_base.


 == NG Case ==
 EXPORT seruqnce:Sub1,Target

 Before patching

 No.8 and 9 seem to incorrect.Their MIVB should be true.

 Afret patching

 All information seems to be correct!

Ticket URL: <>
Boost C++ Libraries <>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC