lcfiplus / LCFIPlus

Flavor tagging code for ILC detectors
https://confluence.slac.stanford.edu/display/ilc/LCFIPlus
GNU General Public License v3.0
6 stars 19 forks source link

BeamspotConstraint parameter crashes LCFIPlus #22

Closed nachogargar closed 7 years ago

nachogargar commented 7 years ago

When the parameter BeamspotConstraint defined in "VertexFinderSuehara" is set (true or false doesn't matter), LCFIPlus crashes after processing N events (being N a random number)

<parameter name="PrimaryVertexFinder.BeamspotConstraint" type="bool" value="false" />

with the following backtrace:

[ VERBOSE "VertexFinder"] processEvent: event # 52

 *** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x0000003b68aac82e in waitpid () from /lib64/libc.so.6
#1  0x0000003b68a3e479 in do_system () from /lib64/libc.so.6
#2  0x00007fa9b2a32948 in TUnixSystem::StackTrace() () at /root/root-6.08.00/core/unix/src/TUnixSystem.cxx:2116
#3  0x00007fa9b2a350ec in TUnixSystem::DispatchSignals(ESignals) () at /root/root-6.08.00/core/unix/src/TUnixSystem.cxx:3661
#4  <signal handler called>
#5  0x00007fa99f342616 in lcfiplus::Vertex::Vertex(lcfiplus::Vertex const&) () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/LCFIPlus/HEAD/lib/libLCFIPlus.so
#6  0x00007fa99f33a6f1 in lcfiplus::BuildUpVertex::process() () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/LCFIPlus/HEAD/lib/libLCFIPlus.so
#7  0x00007fa99f2c648a in LcfiplusProcessor::processEvent(EVENT::LCEvent*) () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/LCFIPlus/HEAD/lib/libLCFIPlus.so
#8  0x00007fa9b4beb845 in marlin::ProcessorMgr::processEvent(EVENT::LCEvent*) () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/Marlin/HEAD/lib/libMarlin.so.1.11
#9  0x00007fa9b4731905 in SIO::SIOReader::readStream(int) () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/lcio/HEAD/lib/liblcio.so.2.8
#10 0x00007fa9b472f2a2 in SIO::SIOReader::readStream() () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/lcio/HEAD/lib/liblcio.so.2.8
#11 0x000000000041230e in main ()
===========================================================

The lines below might hint at the cause of the crash.
You may get help by asking at the ROOT forum http://root.cern.ch/forum.
Only if you are really convinced it is a bug in ROOT then please submit a
report at http://root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.
===========================================================
#5  0x00007fa99f342616 in lcfiplus::Vertex::Vertex(lcfiplus::Vertex const&) () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/LCFIPlus/HEAD/lib/libLCFIPlus.so
#6  0x00007fa99f33a6f1 in lcfiplus::BuildUpVertex::process() () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/LCFIPlus/HEAD/lib/libLCFIPlus.so
#7  0x00007fa99f2c648a in LcfiplusProcessor::processEvent(EVENT::LCEvent*) () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/LCFIPlus/HEAD/lib/libLCFIPlus.so
#8  0x00007fa9b4beb845 in marlin::ProcessorMgr::processEvent(EVENT::LCEvent*) () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/Marlin/HEAD/lib/libMarlin.so.1.11
#9  0x00007fa9b4731905 in SIO::SIOReader::readStream(int) () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/lcio/HEAD/lib/liblcio.so.2.8
#10 0x00007fa9b472f2a2 in SIO::SIOReader::readStream() () from /cvmfs/clicdp.cern.ch/iLCSoft/builds/2017-05-30/x86_64-slc6-gcc62-opt/lcio/HEAD/lib/liblcio.so.2.8
#11 0x000000000041230e in main ()
===========================================================

This issue mostly happens when bb events are processed, partially for cc events and rarely for qq events.

Anyone else has experimented that?

Same problem with BeamspotSmearing parameter: <parameter name="PrimaryVertexFinder.BeamspotSmearing" type="bool" value=“true" />

Thanks in advance!

andresailer commented 7 years ago

Could you copy/paste/upload your steering file to https://gist.github.com/ And point us to the input lcio files please

1) The parsing of boolean values given as strings ("true"/"false") doesn't work. LCFIPlus will always set the value to false. That is why the crash happens if you have the parameter in the steering file, if the parameter doesn't exist it is using the default, which is true.

2) I think the "PrimaryVertex" collection is empty when your crash happens, so this tries to access some memory it shouldn't, https://github.com/lcfiplus/LCFIPlus/blob/master/src/process.cc#L161 Not sure if getPrimaryVertex returns a nullptr or getPrimaryVertex itself does something illegal.

If BeamspotContraint is on a Vertex will be created in any case (https://github.com/lcfiplus/LCFIPlus/blob/master/src/VertexFinderTearDown.cc#L48 here?) and the crash is avoided. This would also explain why things are worse for bb events as it is more likely to have no tracks from the primary vertex.

nachogargar commented 7 years ago

Thanks for the comments.

Please find below the link to my steering file https://gist.github.com/nachogargar/71c442d267ee22f6a86d993c39206e5c

I additionally uploaded some examples lcio files with bb events to /afs/cern.ch/user/i/iggarcia/public

andresailer commented 7 years ago

What is the ExpandJetProcessor?

nachogargar commented 7 years ago

It is a private processor that creates a collection of PFOs from the output jet collection of FastJetProcessor (which runs just before in the steering file).

The code can be found here https://gist.github.com/nachogargar/7b6c912b44dab0d250d226f7d94f8b58

andresailer commented 7 years ago

It would be better if you can provide a steering file that doesn't need additional processors to reproduce the problem.

nachogargar commented 7 years ago

I have just commented the private processor and I made the properly changes, please check a new version of the steering file on: https://gist.github.com/nachogargar/71c442d267ee22f6a86d993c39206e5c