Skip to content

Serialization of a Derived Class from a Base Class Pointer is Incorrect in Boost 1.85 #329

@ckreatsoMW

Description

@ckreatsoMW

We have some code which is similar to repro.zip.

In Boost 1.81, the code successfully serializes and deserializes the Derived class from its Base pointer. However, in Boost 1.85, the deserialization fails when using a Text or Binary archive.

We tracked down this issue to the one identified in the comments of #287. If we manually revert this change and rerun the serialization/deserialization, the library behaves as expected.

Boost 1.81 Text Serialization:

22 serialization::archive 19 1 1 1
0 0 3 0 0 0 0 16 This is a string

Boost 1.85 Text Serialization:

22 serialization::archive 20 1 1 1
0 0 3
1 0 0 0 0 16 This is a string

As #287 did not make a corresponding deserialization change, this seems to be a bug

To reproduce this issue, do the following:

  1. Download repro.zip
  2. Build and run the "repro" executable and its dependencies with Boost 1.81. Everything passes as expected.
  3. Build and run the "repro" executable and its dependencies with Boost 1.85. The "derivedData" string fails to deserialize.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions