Segfault when using schema evolution


We have an issue that we have not been able to solve, nor understand. We hope you can provide some help.

We have a class written into a TTree with one of its Base class having been modified. We have udpated the class version during the modification. In the ROOT file, we have version 1 of the class (TVHit) while in the current software, we have version 2 of the class. We wrote in the LinkDef file a #pragma instruction on how to transform v1 into v2. When this #pragma line is omitted, we obviously read the wrong information from the input file, because the definition in the code does not correspond to the definition on file (as expected). But when using the #pragma line, we simply get a segfault while trying to read the TTree.

I have prepared a self-contained minimal working example attached to this topic: mwe.tgz (224.3 KB)

The archive contains the following with more details on how to reproduce the issue, and on the exact content of the archive:

Steps to reproduce issue on Minimal Working Example (MWE)

  • Compile the minimal persistency library
  • Run test code on new persistency (opens pluto_newpers.root and reads the tree successfully)
    root read_updated.C\(1\)
    read_updated 1
  • Run test code on old persistency (opens pluto_oldpers.root and crashes when trying to read the tree)
    root read_updated.C(\(0\)
    read_updated 0

The crash is traced back to line 109 of PersistencyDICT.cxx
static Long_t offset_Onfile_TVHit_fMCTrackID = oldObj->GetClass()->GetDataMemberOffset("fMCTrackID");
where GetClass returns a nullptr.

Content of the archive

  • The header files in include contain the current definition of the minimal persistency necessary to
    read the input files (TVHit version 2).
  • The source files in src are there for the sake of compilation but should not
    have an influence on reading the input file (right?).
  • The header files in include_oldpers are included for documentation and correspond to the difference
    between the old persistency (TVHit version 1) and the new persistency (TVHit version 2).
  • PersistencyLinkDef.hh is the current linkdef file. The “#pragma” line at the end is our attempts
    to make the previous persistency compatible with the current one. Essentially the field
    fMCTrackID is replaced with the field fKinePartIndex and the field fMCTrackID still
    exists, but with a different purpose. So fMCTrackID in version 1 should be forwarded to
    fKinePartIndex in version 2.
  • pluto_oldpers.root is the input ROOT file containing a tree with 10 entries using TVHit version 1
  • pluto_newpers.root is the input ROOT file containing a tree with 10 entries using TVHit version 2

_ROOT Version: 6.22/00
_Platform: CentOS7 (lxplus)
_Compiler: gcc 8.3.0 (LCG_98python3)

1 Like

Hi @nlurkin,

I can confirm that I have reproduced the issue. I am inviting @pcanal to this thread, as he may be able to shed some light on this.


Is there any news on this? This is kind of a blocker for us, we are at the moment not able to use our previous data processing rounds due to this issue.


Sorry for the delay in the reply, @nlurkin. Unfortunately, this lies beyond my specialization area.

Maybe @pcanal can provide an answer to your issue?


I can reproduce the problem. Checking.

Thank you,
Let me know if you need additional information!

See Segfault when using schema evolution · Issue #7754 · root-project/root · GitHub. Fix following up.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.