Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

k4LCIOReader crashes when used in standalone application #26

Open
FinnJohannsen opened this issue Aug 3, 2022 · 6 comments
Open

k4LCIOReader crashes when used in standalone application #26

FinnJohannsen opened this issue Aug 3, 2022 · 6 comments

Comments

@FinnJohannsen
Copy link

Our goal is to implement the k4LCIOreader as a standalone application to read and convert LCIO files. We have run into a Segmentation Fault in edm4hep::ReconstructedParticleCollectionData::setReference, when trying this on miniDST files. Below is a list of commands to reproduce the error.

First you clone the github repository with the minimal reproducer and afterwards source the setup file from the nightlies.hsf to get the environment set up.

git clone --branch lcioedmconv https://gitlab.desy.de/ftx-sft-key4hep/edmconverter.git

source /cvmfs/sw-nightlies.hsf.org/spackages5/key4hep-stack/master-2022-08-03/x86_64-centos7-gcc11.2.0-opt/gmz2k/setup.sh

After that is done you build the reproducer.

cd edmconverter

mkdir build

cd build

cmake ..

make

download the miniDST file

cd ..

wget https://desycloud.desy.de/index.php/s/5LmrjGWqziQfMe7/download/rv01-16-p10_250.sv01-14-01-p00.mILD_o1_v05.E250-TDR_ws.I106479.Pe2e2h.eL.pR-00001-ILDminiDST.slcio

The programm is run with gdb to get the seg fault. Without gdb the programm just freezes in our case.

cd build

gdb -ex run --args ./minimalrep "../rv01-16-p10_250.sv01-14-01-p00.mILD_o1_v05.E250-TDR_ws.I106479.Pe2e2h.eL.pR-00001-ILDminiDST.slcio"

We are unsure whether this issue arises because the miniDST format has some Collections dropped. Or also because it has subset Collections. The Collection used in this case is not a subset Collection, but in a test case using a subset Collection the subset flag did not propagate through the program to the point where the references where set and the same seg fault came up.

@FinnJohannsen
Copy link
Author

The same issue also happened with a few other data tiers.

In another attempt I replaced the store.get function with k4reader.getCollection. This finished without any issue.
It seems things break as soon as podio tries to resolve relations. Does this mean that the k4LCIOReader does not handle relations?

@andresailer
Copy link
Contributor

What do you mean by relations? LCRelation collections, or something else?

@tmadlener
Copy link
Contributor

In this case relations are the OneToOneRelations/OneToManyRelations between edm4hep types, e.g. the crash above is when the ReconstructedParticles try to resolve their relations to the Vertex (in startVertex).

@andresailer
Copy link
Contributor

But the crash also happens when you use k4reader.getCollection (I think this you have to do in any case)?

@FinnJohannsen
Copy link
Author

I added the a changed version using k4reader.getCollection to the github called working_minimalrep.
By just doing every step the same as before and just replacing this line:
gdb -ex run --args ./minimalrep "../rv01-16-p10_250.sv01-14-01-p00.mILD_o1_v05.E250-TDR_ws.I106479.Pe2e2h.eL.pR-00001-ILDminiDST.slcio"
with this line:
gdb -ex run --args ./working_minimalrep "../rv01-16-p10_250.sv01-14-01-p00.mILD_o1_v05.E250-TDR_ws.I106479.Pe2e2h.eL.pR-00001-ILDminiDST.slcio"
The new Version gets run. It exits normally without any issues.

@FinnJohannsen
Copy link
Author

I also tried calling k4reader.getCollection and only afterwards call store.get. This also crashes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants