Compatibility issues v2.2.11 - v2.2.12?

REST version : v2.2.12
REST commit : 9b51fb54

I am trying to run an analysis that previously worked on v2.2.11_dev version and I’m getting an error, probably something to do with root class versioning? The simulation file was generated using rest v2.2.11_dev and the analysis worked fine with that version.

As I understand the versioning system there should be compatibility between versions right? Will I need to rerun all simulations with this version or is there some fix?

Thanks.

lobis@sultan:~/gitlab/IAXOD0-REST$ restManager --v 1 --c /home/lobis/gitlab/IAXOD0-REST/analysis_files/manager/defaultAnalysisManager.rml --i /home/lobis/LARGE_FILES/IAXOD0_cosmic_neutrons/run_cosmic_neutrons_29-July-2019_N400/cosmic_neutrons_N10000000_0.root --o /tmp/hitsanatest.root
connect /tmp/.X11-unix/X0: No such file or directory
Error in <TGClient::TGClient>: can't open display "localhost:15.0", switching to batch mode...
 In case you run from a remote ssh session, reconnect with ssh -Y

                                                                                                           Launching TRestManager...

-- Info : Trying to download gasFile ar_98.0-iC4H10_2.0-E_vs_P_10.0_1000.0_nodes_20-nCol_10-maxE_...
-- Success : download OK!
                                                                      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                                                                      ||                                        TRestGas content                                        ||
                                                                      ||                                       Config file : null                                       ||
                                                                      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                                                                      ||                             Name : Argon-Isobutane 2Pct 10-10E3Vcm                             ||
                                                                      ||                        Title : Argon-Isobutane Mixture (2Pct Isobutane)                        ||
                                                                      ||                                     REST Version : 2.2.12                                      ||
                                                                      ||                                     REST Commit : 9b51fb54                                     ||
                                                                      ||                                    REST Library version : 0                                    ||
                                                                      ----------------------------------------------------------------------------------------------------
                                                                      ||                                 Status : Configuration loaded                                  ||
                                                                      ||                           Gas filename : restGas_lobis_Download.gas                            ||
                                                                      ||                                        Pressure : 3 atm                                        ||
                                                                      ||                                     Temperature : 293.15 K                                     ||
                                                                      ||                                      W-value : 26.238 eV                                       ||
                                                                      ||                                 Max. Electron energy : 400 eV                                  ||
                                                                      ||                                     Field grid nodes : 20                                      ||
                                                                      ||                               Efield range : ( 10 , 1000 ) V/cm                                ||
                                                                      ||                                      Number of Gases : 2                                       ||
                                                                      ||                             Gas id : 0, Name : ar, Fraction : 0.98                             ||
                                                                      ||                           Gas id : 1, Name : iC4H10, Fraction : 0.02                           ||
                                                                      ****************************************************************************************************


Info in <TGeoManager::CloseGeometry>: Geometry loaded from file...
Info in <TGeoManager::SetTopVolume>: Top volume is World. Master volume is World
Info in <TGeoNavigator::BuildCache>: --- Maximum geometry depth set to 100
Info in <TGeoManager::Voxelize>: Voxelizing...
Info in <TGeoManager::CountLevels>: max level = 1, max placements = 22
Info in <TGeoManager::CloseGeometry>: 23 nodes/ 23 volume UID's in Geometry imported from GDML
Info in <TGeoManager::CloseGeometry>: ----------------modeler ready----------------
Warning in <CreateReadMemberWiseActions>:    The StreamerInfo of class TRestG4Hits read from file /home/lobis/LARGE_FILES/IAXOD0_cosmic_neutrons/run_cosmic_neutrons_29-July-2019_N400/cosmic_neutrons_N10000000_0.root
   has the same version (=2) as the active class but a different checksum.
   You should update the version to ClassDef(TRestG4Hits,3).
   The objects on this file might not be readable because:
   The in-memory layout version 2 for class 'TRestG4Hits' has a base class (TRestHits) with version 4 but the on-file layout version 2 recorded the version number 3 for this base class (TRestHits).
Input file: "/home/lobis/LARGE_FILES/IAXOD0_cosmic_neutrons/run_cosmic_neutrons_29-July-2019_N400/cosmic_neutrons_N10000000_0.root"
Output file: "/tmp/hitsanatest.root"
Prism fiducial active
virtual void TRestHitsReductionProcess::InitProcess()
virtual void TRestHitsToTrackProcess::InitProcess()

 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007f67243a9ffa in __GI___waitpid (pid=24902, stat_loc=stat_loc
entry=0x7ffff350c300, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1  0x00007f67243310ab in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
#2  0x00007f672b367477 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x55ca51828570) at /home/lobis/apps/ROOT/root-6.16.00/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x55ca51828570) at /home/lobis/apps/ROOT/root-6.16.00/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007f672b369bc4 in TUnixSystem::DispatchSignals (this=0x55ca51828570, sig=kSigSegmentationViolation) at /home/lobis/apps/ROOT/root-6.16.00/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  0x00007f67259714ef in TRestHitsEvent::Initialize() () from /home/lobis/apps/REST/REST_dev/install/lib/libRestEvents.so
#7  0x00007f67253f7216 in TRestEventProcess::BeginOfEventProcess(TRestEvent*) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#8  0x00007f67254453d4 in TRestThread::TestRun(TRestAnalysisTree*) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#9  0x00007f6725449194 in TRestThread::PrepareToProcess(bool) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#10 0x00007f672541e3cb in TRestProcessRunner::RunProcess() () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#11 0x00007f672540150c in TRestManager::ReadConfig(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, TiXmlElement*) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#12 0x00007f6725404ba3 in TRestManager::InitFromConfigFile() () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#13 0x00007f6725406571 in TRestMetadata::LoadConfigFromFile(TiXmlElement*, TiXmlElement*, std::vector<TiXmlElement*, std::allocator<TiXmlElement*> >) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#14 0x00007f672540ba37 in TRestMetadata::LoadConfigFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#15 0x000055ca5132a167 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.
===========================================================
#6  0x00007f67259714ef in TRestHitsEvent::Initialize() () from /home/lobis/apps/REST/REST_dev/install/lib/libRestEvents.so
#7  0x00007f67253f7216 in TRestEventProcess::BeginOfEventProcess(TRestEvent*) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#8  0x00007f67254453d4 in TRestThread::TestRun(TRestAnalysisTree*) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#9  0x00007f6725449194 in TRestThread::PrepareToProcess(bool) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#10 0x00007f672541e3cb in TRestProcessRunner::RunProcess() () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#11 0x00007f672540150c in TRestManager::ReadConfig(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, TiXmlElement*) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#12 0x00007f6725404ba3 in TRestManager::InitFromConfigFile() () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#13 0x00007f6725406571 in TRestMetadata::LoadConfigFromFile(TiXmlElement*, TiXmlElement*, std::vector<TiXmlElement*, std::allocator<TiXmlElement*> >) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#14 0x00007f672540ba37 in TRestMetadata::LoadConfigFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) () from /home/lobis/apps/REST/REST_dev/install/lib/libRestCore.so
#15 0x000055ca5132a167 in main ()
===========================================================

I have removed a couple of members from TRestHits structure.

I updated the value of ClassDef for the class TRestHits. Now it is ClassDef( TRestHits, 4). I was not aware that we need to do that on all the inherited classes. Thats would not be that good!

Could you try to increase ClassDef(TRestG4Hits,3) to check if you can read your previously generated file? I believe you should be able.

Automated testing would have prevented these errors, I hope we can get it up and running soon, it really saves a lot of time.

Doing this as the error suggests fixes this bug but there is still some problems. I found that the segmentation fault was caused by some delete statements. I commented those and now it seems to be working.

I did not look into why this statement was added or the effects of removing it but it seems to work fine.

Sure, I am agree that automated testing would be useful.

The fix you introduced solves the segmentation fault, however, it introduces a potential memory leak, if Initialize function is called more than once. Because the fXZHits is associated to a new memory section without clearing, deleting, the previously generated memory region, while losing the pointer to it doing the new new.