Segmentation fault running TRestAnalysisPlot

REST version : v2.2.14
REST commit : cfa2d241

I am trying to run a simple script for obtaining three different histograms given the same input file but setting different cuts for each plot. The program should display them, and save them automatically.
The command line I run is:
restManager --c restPlotIsotopeSAFEC_HistoEnergy.rml --f Co60_TrackAnalysis.root

When I run the script I can briefly see two of the three histograms, then I get a segmentation fault and the program crashes. It generates two of the three files, but after checking them I can see they are empty.

The complete output is:

RandomEngineRoot:
Generator type: TRandom3
Seed: 3959356795
Heed:
Database path: /programas/garfield/garfield6/Heed/heed++/database
                                                                                                        
                                                  [==                                  Launching TRestManager...                                   ==]                                                      
                                                                                                        
-- Debug : Loading Config for : TRestManager
-- Debug : TRestManager: Parameter : database not found!
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : TRestManager: Parameter : store not found!
-- Debug : Loading Config for : TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: globals
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: globals
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: globals
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: globals
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : TRestAnalysisPlot: Parameter : store not found!
-- Debug : TRestAnalysisPlot: Reading canvas settings
-- Debug : TRestAnalysisPlot: Reading global cuts
-- Debug : TRestAnalysisPlot: Reading plot sections
-- Debug : TRestAnalysisPlot: Parameter : logY not found!
-- Debug : TRestAnalysisPlot: Parameter : logX not found!
-- Debug : TRestAnalysisPlot: Parameter : logZ not found!
-- Debug : TRestAnalysisPlot: Parameter : norm not found!
-- Debug : TRestAnalysisPlot: Parameter : legend not found!
-- Debug : TRestAnalysisPlot: Parameter : stats not found!
-- Debug : TRestAnalysisPlot: Parameter : annotation not found!
-- Debug : TRestAnalysisPlot: Parameter : xOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : yOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : timeDisplay not found!
-- Debug : TRestAnalysisPlot: Parameter : option not found!
Variable g4Ana_gasVolumeEDep
------------------------------------------
Plot range : ( 0 , 10 ) 
bins : 100

-- Debug : TRestAnalysisPlot: Parameter : lineColor not found!
-- Debug : TRestAnalysisPlot: Parameter : lineWidth not found!
-- Debug : TRestAnalysisPlot: Parameter : lineStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillColor not found!
-- Debug : TRestAnalysisPlot: Parameter : logY not found!
-- Debug : TRestAnalysisPlot: Parameter : logX not found!
-- Debug : TRestAnalysisPlot: Parameter : logZ not found!
-- Debug : TRestAnalysisPlot: Parameter : norm not found!
-- Debug : TRestAnalysisPlot: Parameter : legend not found!
-- Debug : TRestAnalysisPlot: Parameter : stats not found!
-- Debug : TRestAnalysisPlot: Parameter : annotation not found!
-- Debug : TRestAnalysisPlot: Parameter : xOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : yOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : timeDisplay not found!
-- Debug : TRestAnalysisPlot: Parameter : option not found!
Variable g4Ana_gasVolumeEDep
------------------------------------------
Plot range : ( 0 , 10 ) 
bins : 100

-- Debug : TRestAnalysisPlot: Parameter : lineColor not found!
-- Debug : TRestAnalysisPlot: Parameter : lineWidth not found!
-- Debug : TRestAnalysisPlot: Parameter : lineStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillColor not found!
-- Debug : TRestAnalysisPlot: Parameter : logY not found!
-- Debug : TRestAnalysisPlot: Parameter : logX not found!
-- Debug : TRestAnalysisPlot: Parameter : logZ not found!
-- Debug : TRestAnalysisPlot: Parameter : norm not found!
-- Debug : TRestAnalysisPlot: Parameter : legend not found!
-- Debug : TRestAnalysisPlot: Parameter : stats not found!
-- Debug : TRestAnalysisPlot: Parameter : annotation not found!
-- Debug : TRestAnalysisPlot: Parameter : xOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : yOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : timeDisplay not found!
-- Debug : TRestAnalysisPlot: Parameter : option not found!
Variable g4Ana_gasVolumeEDep
------------------------------------------
Plot range : ( 0 , 10 ) 
bins : 100

-- Debug : TRestAnalysisPlot: Parameter : lineColor not found!
-- Debug : TRestAnalysisPlot: Parameter : lineWidth not found!
-- Debug : TRestAnalysisPlot: Parameter : lineStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillColor not found!
-- Debug : TRestAnalysisPlot: Reading panel sections
-- Debug : TRestAnalysisPlot has finished preparing config data
-- Debug : Loading Task... "restPlot->PlotCombinedCanvas()" 
                                                  Adding file : Co60_TrackAnalysis.root                                                      
-- Debug : TRestAnalysisPlot::AddFile. Adding file. 
-- Debug : File name: Co60_TrackAnalysis.root

--------------------------------------
Plot string : g4Ana_gasVolumeEDep
Plot name : Energyingas
Plot range : (100 , 0 , 10)
Cut : 
Plot option : colz
++++++++++++++++++++++++++++++++++++++
Info in <TCanvas::SaveAs>: ROOT file BG_Spectrum_Co60_CapBottomCentre_CutsOFF.root has been created

--------------------------------------
Plot string : g4Ana_gasVolumeEDep
Plot name : Energyingas
Plot range : (100 , 0 , 10)
Cut : 
Plot option : colz
++++++++++++++++++++++++++++++++++++++
Info in <TCanvas::SaveAs>: ROOT file BG_Spectrum_Co60_CapBottomCentre_TrackCutON.root has been created

--------------------------------------
Plot string : g4Ana_gasVolumeEDep
Plot name : Energyingas
Plot range : (100 , 0 , 10)
Cut : 
Plot option : colz
++++++++++++++++++++++++++++++++++++++

 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007f67995e2ffa in __GI___waitpid (pid=39232, stat_loc=stat_loc
entry=0x7ffef3038e80, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1  0x00007f679956a0ab in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
#2  0x00007f67d442c477 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x5616decd34c0) at /home/gloria/apps/root-6.16.00/source/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x5616decd34c0) at /home/gloria/apps/root-6.16.00/source/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007f67d442ebc4 in TUnixSystem::DispatchSignals (this=0x5616decd34c0, sig=kSigSegmentationViolation) at /home/gloria/apps/root-6.16.00/source/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  TCanvas::Constructor (this=this
entry=0x5616e25cd920, name=name
entry=0x0, title=title
entry=0x0, ww=<optimized out>, ww
entry=800, wh=<optimized out>, wh
entry=600) at /home/gloria/apps/root-6.16.00/source/graf2d/gpad/src/TCanvas.cxx:392
#7  0x00007f67d27cf9dc in TCanvas::TCanvas (this=0x5616e25cd920, name=0x0, title=0x0, ww=800, wh=600) at /home/gloria/apps/root-6.16.00/source/graf2d/gpad/src/TCanvas.cxx:358
#8  0x00007f679a6c2439 in TRestAnalysisPlot::SavePlotToPDF(TString, int) () from /programas/REST/v2.2.14/lib/libRestCore.so
#9  0x00007f679a6c16f9 in TRestAnalysisPlot::PlotCombinedCanvas() () from /programas/REST/v2.2.14/lib/libRestCore.so
#10 0x00007f67d547002a in ?? ()
#11 0x0000000000000000 in ?? ()
===========================================================


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  TCanvas::Constructor (this=this
entry=0x5616e25cd920, name=name
entry=0x0, title=title
entry=0x0, ww=<optimized out>, ww
entry=800, wh=<optimized out>, wh
entry=600) at /home/gloria/apps/root-6.16.00/source/graf2d/gpad/src/TCanvas.cxx:392
#7  0x00007f67d27cf9dc in TCanvas::TCanvas (this=0x5616e25cd920, name=0x0, title=0x0, ww=800, wh=600) at /home/gloria/apps/root-6.16.00/source/graf2d/gpad/src/TCanvas.cxx:358
#8  0x00007f679a6c2439 in TRestAnalysisPlot::SavePlotToPDF(TString, int) () from /programas/REST/v2.2.14/lib/libRestCore.so
#9  0x00007f679a6c16f9 in TRestAnalysisPlot::PlotCombinedCanvas() () from /programas/REST/v2.2.14/lib/libRestCore.so
#10 0x00007f67d547002a in ?? ()
#11 0x0000000000000000 in ?? ()
===========================================================


Segmentation fault

Do you have any ideas about where could the origin of the problem be?

I attach the following files:

Hi,

looking at your rml file I found the plot names you are using are the same for each plot. This is the reason why you get a seg.fault.

I have added few lines at TRestAnalysisPlot in the latest commit to check that those names are not the same, and output an error in case they are.

As you can see in the following image

Then, for the plot generation it seems there are still some issues, I guess that’s a kind of problem of compatibility with the new TRestAnalysisPlot version. I find repeated plots in smaller size inside the canvas.

Maybe @nkx might bring some light on that.

Check out this post to follow recent changes to TRestAnalysisPlot

On the other hand you must know that it is possible to generate the root or pdf files without popping up the canvas on screen, just adding --batch to the restManager command.

See for example

Hi Javier,
Changing the names I still get a segmentation fault. I even get this error with a similar script but only one plot. In general, if I have a script with N plots I can see how REST generates N-1 plots and then crashes, but the output files it generates are empty.

Generator type: TRandom3
Seed: 2728373318
Heed:
Database path: /programas/garfield/garfield6/Heed/heed++/database
                                                                                                    
                                              [==                                  Launching TRestManager...                                   ==]                                                      
                                                                                                    
-- Debug : Loading Config for : TRestManager
-- Debug : TRestManager: Parameter : database not found!
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : TRestManager: Parameter : store not found!
-- Debug : Loading Config for : TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: globals
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: globals
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: globals
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: globals
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: TRestAnalysisPlot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : into child elements of: plot
-- Debug : Entering ... void TRestMetadata::ReadElement(TiXmlElement*, bool)
-- Debug : TRestAnalysisPlot: Parameter : store not found!
-- Debug : TRestAnalysisPlot: Reading canvas settings
-- Debug : TRestAnalysisPlot: Reading global cuts
-- Debug : TRestAnalysisPlot: Reading plot sections
-- Debug : TRestAnalysisPlot: Parameter : logY not found!
-- Debug : TRestAnalysisPlot: Parameter : logX not found!
-- Debug : TRestAnalysisPlot: Parameter : logZ not found!
-- Debug : TRestAnalysisPlot: Parameter : norm not found!
-- Debug : TRestAnalysisPlot: Parameter : legend not found!
-- Debug : TRestAnalysisPlot: Parameter : stats not found!
-- Debug : TRestAnalysisPlot: Parameter : annotation not found!
-- Debug : TRestAnalysisPlot: Parameter : xOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : yOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : timeDisplay not found!
-- Debug : TRestAnalysisPlot: Parameter : option not found!
Variable g4Ana_gasVolumeEDep
------------------------------------------
Plot range : ( 0 , 10 ) 
bins : 100

-- Debug : TRestAnalysisPlot: Parameter : lineColor not found!
-- Debug : TRestAnalysisPlot: Parameter : lineWidth not found!
-- Debug : TRestAnalysisPlot: Parameter : lineStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillColor not found!
-- Debug : TRestAnalysisPlot: Parameter : logY not found!
-- Debug : TRestAnalysisPlot: Parameter : logX not found!
-- Debug : TRestAnalysisPlot: Parameter : logZ not found!
-- Debug : TRestAnalysisPlot: Parameter : norm not found!
-- Debug : TRestAnalysisPlot: Parameter : legend not found!
-- Debug : TRestAnalysisPlot: Parameter : stats not found!
-- Debug : TRestAnalysisPlot: Parameter : annotation not found!
-- Debug : TRestAnalysisPlot: Parameter : xOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : yOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : timeDisplay not found!
-- Debug : TRestAnalysisPlot: Parameter : option not found!
Variable g4Ana_gasVolumeEDep
------------------------------------------
Plot range : ( 0 , 10 ) 
bins : 100

-- Debug : TRestAnalysisPlot: Parameter : lineColor not found!
-- Debug : TRestAnalysisPlot: Parameter : lineWidth not found!
-- Debug : TRestAnalysisPlot: Parameter : lineStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillColor not found!
-- Debug : TRestAnalysisPlot: Parameter : logY not found!
-- Debug : TRestAnalysisPlot: Parameter : logX not found!
-- Debug : TRestAnalysisPlot: Parameter : logZ not found!
-- Debug : TRestAnalysisPlot: Parameter : norm not found!
-- Debug : TRestAnalysisPlot: Parameter : legend not found!
-- Debug : TRestAnalysisPlot: Parameter : stats not found!
-- Debug : TRestAnalysisPlot: Parameter : annotation not found!
-- Debug : TRestAnalysisPlot: Parameter : xOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : yOffset not found!
-- Debug : TRestAnalysisPlot: Parameter : timeDisplay not found!
-- Debug : TRestAnalysisPlot: Parameter : option not found!
Variable g4Ana_gasVolumeEDep
------------------------------------------
Plot range : ( 0 , 10 ) 
bins : 100

-- Debug : TRestAnalysisPlot: Parameter : lineColor not found!
-- Debug : TRestAnalysisPlot: Parameter : lineWidth not found!
-- Debug : TRestAnalysisPlot: Parameter : lineStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillStyle not found!
-- Debug : TRestAnalysisPlot: Parameter : fillColor not found!
-- Debug : TRestAnalysisPlot: Reading panel sections
-- Debug : TRestAnalysisPlot has finished preparing config data
-- Debug : Loading Task... "restPlot->PlotCombinedCanvas()" 
                                              Adding file : Co60_TrackAnalysis.root                                                      
-- Debug : TRestAnalysisPlot::AddFile. Adding file. 
-- Debug : File name: Co60_TrackAnalysis.root

--------------------------------------
Plot string : g4Ana_gasVolumeEDep
Plot name : Energyingas
Plot range : (100 , 0 , 10)
Cut : 
Plot option : colz
++++++++++++++++++++++++++++++++++++++
Info in <TCanvas::SaveAs>: ROOT file BG_Spectrum_Co60_CapBottomCentre_CutsOFF.root has been created

--------------------------------------
Plot string : g4Ana_gasVolumeEDep
Plot name : Energyingas2
Plot range : (100 , 0 , 10)
Cut : 
Plot option : colz
++++++++++++++++++++++++++++++++++++++
Info in <TCanvas::SaveAs>: ROOT file BG_Spectrum_Co60_CapBottomCentre_TrackCutON.root has been created

--------------------------------------
Plot string : g4Ana_gasVolumeEDep
Plot name : Energyingas3
Plot range : (100 , 0 , 10)
Cut : 
Plot option : colz
++++++++++++++++++++++++++++++++++++++

 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007feebb486ffa in __GI___waitpid (pid=48647, stat_loc=stat_loc
entry=0x7fff1c8e3d80, options=options
entry=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1  0x00007feebb40e0ab in do_system (line=<optimized out>) at ../sysdeps/posix/system.c:148
#2  0x00007feef62d0477 in TUnixSystem::Exec (shellcmd=<optimized out>, this=0x56071c9ad4c0) at /home/gloria/apps/root-6.16.00/source/core/unix/src/TUnixSystem.cxx:2119
#3  TUnixSystem::StackTrace (this=0x56071c9ad4c0) at /home/gloria/apps/root-6.16.00/source/core/unix/src/TUnixSystem.cxx:2413
#4  0x00007feef62d2bc4 in TUnixSystem::DispatchSignals (this=0x56071c9ad4c0, sig=kSigSegmentationViolation) at /home/gloria/apps/root-6.16.00/source/core/unix/src/TUnixSystem.cxx:3644
#5  <signal handler called>
#6  TCanvas::Constructor (this=this
entry=0x5607204fd110, name=name
entry=0x0, title=title
entry=0x0, ww=<optimized out>, ww
entry=800, wh=<optimized out>, wh
entry=600) at /home/gloria/apps/root-6.16.00/source/graf2d/gpad/src/TCanvas.cxx:392
#7  0x00007feef46739dc in TCanvas::TCanvas (this=0x5607204fd110, name=0x0, title=0x0, ww=800, wh=600) at /home/gloria/apps/root-6.16.00/source/graf2d/gpad/src/TCanvas.cxx:358
#8  0x00007feebc566439 in TRestAnalysisPlot::SavePlotToPDF(TString, int) () from /programas/REST/v2.2.14/lib/libRestCore.so
#9  0x00007feebc5656f9 in TRestAnalysisPlot::PlotCombinedCanvas() () from /programas/REST/v2.2.14/lib/libRestCore.so
#10 0x00007feef731402a in ?? ()
#11 0x0000000000000000 in ?? ()
===========================================================


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  TCanvas::Constructor (this=this
entry=0x5607204fd110, name=name
entry=0x0, title=title
entry=0x0, ww=<optimized out>, ww
entry=800, wh=<optimized out>, wh
entry=600) at /home/gloria/apps/root-6.16.00/source/graf2d/gpad/src/TCanvas.cxx:392
#7  0x00007feef46739dc in TCanvas::TCanvas (this=0x5607204fd110, name=0x0, title=0x0, ww=800, wh=600) at /home/gloria/apps/root-6.16.00/source/graf2d/gpad/src/TCanvas.cxx:358
#8  0x00007feebc566439 in TRestAnalysisPlot::SavePlotToPDF(TString, int) () from /programas/REST/v2.2.14/lib/libRestCore.so
#9  0x00007feebc5656f9 in TRestAnalysisPlot::PlotCombinedCanvas() () from /programas/REST/v2.2.14/lib/libRestCore.so
#10 0x00007feef731402a in ?? ()
#11 0x0000000000000000 in ?? ()
===========================================================

Could you switch to the ROOT-REST-Garfield versions I define in my .bashrc in sultan? Do you still have this problem?

I realised that if I remove save="filename.root"/> option from <plot it will not draw the smaller histograms.

Now it seems to be working properly. Even though I still get a seg.fault after the script ends

--------------------------------------
Plot string : g4Ana_gasVolumeEDep
Plot name : Energyingas
Plot range : (100 , 0 , 10)
Cut : 
Plot option : colz
++++++++++++++++++++++++++++++++++++++
Info in <TCanvas::SaveAs>: ROOT file BG_Spectrum_Co60_CapBottomCentre_CutsOFF.root has been created

--------------------------------------
Plot string : g4Ana_gasVolumeEDep
Plot name : Energyingas2
Plot range : (100 , 0 , 10)
Cut : 
Plot option : colz
++++++++++++++++++++++++++++++++++++++
Info in <TCanvas::SaveAs>: ROOT file BG_Spectrum_Co60_CapBottomCentre_TrackCutON.root has been created

--------------------------------------
Plot string : g4Ana_gasVolumeEDep
Plot name : Energyingas3
Plot range : (100 , 0 , 10)
Cut : 
Plot option : colz
++++++++++++++++++++++++++++++++++++++
Info in <TCanvas::SaveAs>: ROOT file BG_Spectrum_Co60_CapBottomCentre_CutsON.root has been created
-- Debug : TRestAnalysisPlot: Parameter : previewPlot not found!
Press a KEY to continue ...

Info in <TCanvas::SaveAs>: ROOT file BG_Spectrum_Co60_CapBottomCentre.root has been created
-- Debug : TRestManager has finished preparing config data
                                                  [==                                            Done!                                             ==]                                                      
Segmentation fault

Yes, I was checking that also, seems like I’m re-ploting everything.

I don’t know what the problem with the version can be, but for future reference, I was using root-6.10.06 and REST v2.2.14 as compiled on sultan at /programas.

That seg.fault line is coming from Garfield libraries and it is warmless. Still annoying. I have compiled /programas/REST/testing/ without Garfield and now it does not appear.

In order to use /programas/REST/v2.2.14/ you need to use ROOT6.16.00, many problems come from there.

export GARFIELD_HOME=/programas/garfield/garfield6/
export HEED_DATABASE=$GARFIELD_HOME/Heed/heed++/database
export LD_LIBRARY_PATH=$GARFIELD_HOME/lib:$LD_LIBRARY_PATH

## REST v2.2.14 was compiled linking to 6.16.00
source /programas/root/root-6.16.00/install/bin/thisroot.sh
source /programas/REST/v2.2.14/thisREST.sh

This problem has been fixed in the last commit.

Hi, sorry for the late response. Is the problem solved?

I believe both problems are solved, the segmentation fault related to same plot name, and the mini-plot appearing when calling SavePlotToPDF.

Still, there is a Segmentation Fault line appearing at the end of the execution (which seems to be harmless but annoying). This segmentation fault line output seems connected to Garfield. It only appears when we linked REST libraries to Garfield.

There was another segmentation fault that was solved using ROOT6.16 instead of ROOT6.10.

Ok, the reason behind it is because the REST you were using had been compiled/linked to ROOT 6.16.