Ciao,
I have the very same same problem as described here:
https://root-forum.cern.ch/t/problems-while-exiting-root-q-with-canvas/36167/3
If I call a function that creates a TCanvas, and I close this canvas, I get a root crash when I “.q” ROOT:
root [0] .L Analysis/DAQ_light.C+
Info in <TMacOSXSystem::ACLiC>: creating shared library /Volumes/amssw/duranti/POXsimu_install/./Analysis/DAQ_light_C.so
root [1] DAQ()
root [2] .q
2019-12-09 10:50:31.535 root.exe[27017:4477869] Fatal error: requested non-existing drawable 99
2019-12-09 10:50:31.535 root.exe[27017:4477869] This window not found among allocated/deleted drawables
*** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
[/amssw/duranti/root-6.18.00_install/lib/libGpad.so] TCanvas::SetDoubleBuffer(int) /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/graf2d/gpad/src/TCanvas.cxx:1946
[/amssw/duranti/root-6.18.00_install/lib/libGpad.so] TCanvas::Close(char const*) /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/graf2d/gpad/src/TCanvas.cxx:1083
[/amssw/duranti/root-6.18.00_install/lib/libGpad.so] TCanvas::~TCanvas() /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/graf2d/gpad/src/TCanvas.cxx:685
[/amssw/duranti/root-6.18.00_install/lib/libGpad.so] TCanvas::~TCanvas() /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/graf2d/gpad/src/TCanvas.cxx:652
[/amssw/duranti/root-6.18.00_install/lib/libCore.so] TList::Delete(char const*) /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/cont/src/TList.cxx:505
[/amssw/duranti/root-6.18.00_install/lib/libCore.so] TROOT::EndOfProcessCleanups() /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/base/src/TROOT.cxx:1268
[/amssw/duranti/root-6.18.00_install/lib/libCore.so] TUnixSystem::Exit(int, bool) /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/unix/src/TUnixSystem.cxx:2149
[/amssw/duranti/root-6.18.00_install/lib/libCore.so] TApplication::Terminate(int) /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/base/src/TApplication.cxx:1254
[/amssw/duranti/root-6.18.00_install/lib/libCore.so] TApplication::ProcessLine(char const*, bool, int*) /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/base/src/TApplication.cxx:0
[/amssw/duranti/root-6.18.00_install/lib/libRint.so] TRint::ProcessLineNr(char const*, char const*, int*) /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/rint/src/TRint.cxx:761
[/amssw/duranti/root-6.18.00_install/lib/libRint.so] TRint::HandleTermInput() /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/rint/src/TRint.cxx:608
[/amssw/duranti/root-6.18.00_install/lib/libCore.so] TUnixSystem::CheckDescriptors() /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/unix/src/TUnixSystem.cxx:1311
[/amssw/duranti/root-6.18.00_install/lib/libCore.so] TMacOSXSystem::DispatchOneEvent(bool) /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/macosx/src/TMacOSXSystem.mm:378
[/amssw/duranti/root-6.18.00_install/lib/libCore.so] TSystem::InnerLoop() /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/base/src/TSystem.cxx:413
[/amssw/duranti/root-6.18.00_install/lib/libCore.so] TSystem::Run() /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/base/src/TSystem.cxx:363
[/amssw/duranti/root-6.18.00_install/lib/libCore.so] TApplication::Run(bool) /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/base/src/TApplication.cxx:1179
[/amssw/duranti/root-6.18.00_install/lib/libRint.so] TRint::Run(bool) /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/core/rint/src/TRint.cxx:463
[/amssw/duranti/root-6.18.00_install/bin/root.exe] main /Volumes/CaseSensitive2/amssw_cold/duranti/root-6.18.00/main/src/rmain.cxx:32
[/usr/lib/system/libdyld.dylib] start (no debug info)
[<unknown binary>] (no debug info)
Root > .q
and I have to issue a “.q” for each closed canvas. If I close ALL the canvases, instead, ROOT exits without any crash.
Here the very very minimal macro to reproduce the problem:
#include "TCanvas.h"
void PlotHits(){
TCanvas* c = new TCanvas();
return;
}
/////////////////////////////////////////////////////////////
void DAQ() {
PlotHits();
PlotHits();
return;
}
this happens both compiling or not the macro:
root [0] .L Analysis/DAQ_light.C+
Info in <TMacOSXSystem::ACLiC>: creating shared library /Volumes/amssw/duranti/POXsimu_install/./Analysis/DAQ_light_C.so
root [1] DAQ()
root [2] .q
2019-12-09 10:50:31.535 root.exe[27017:4477869] Fatal error: requested non-existing drawable 99
2019-12-09 10:50:31.535 root.exe[27017:4477869] This window not found among allocated/deleted drawables
*** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
...
root [0] .L Analysis/DAQ_light.C
root [1] DAQ()
root [2] .q
2019-12-09 10:57:18.547 root.exe[27423:4518687] Fatal error: requested non-existing drawable 99
2019-12-09 10:57:18.547 root.exe[27423:4518687] This window not found among allocated/deleted drawables
*** Break *** segmentation violation
[/usr/lib/system/libsystem_platform.dylib] _sigtramp (no debug info)
[<unknown binary>] (no debug info)
Matteo
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.18/00
Platform: MacOsX Mojave 10.14.6
Compiler: Apple clang version 11.0.0 (clang-1100.0.33.8)