TMultiGraph *** Break *** segmentation violation

Hi All!

I cannot post the code or produce a minimal working example, I’m writing a TUCS worker and probably not many are familiar. By the way I’m trying to write to a file some TMultiGraph objects, the writing and all works fine and I have the plots done but after my code has finished running I get the *** Break *** segmentation violation stack trace.
The last few lines of code that I use are

[code] mg = ROOT.TMultiGraph()

    rms_graph = self.multi_graph['LBA_24_12_HGHG'][0]
    calib_graph_ch1 = self.multi_graph['LBA_24_12_HGHG'][1]

    mg.SetName('LBA_24_12_HGHG')
    
    mg.Add(rms_graph, "pl")
    mg.Add(calib_graph_ch1, "pl")
        
    mg.Write()[/code]

and self.multi_graph is a dictionary of tuples of TGraphs (self.multi_graph[i] = (TGraph, TGraph) so I can superimpose exactly the graphs I want that are generated in a different funcition. The multigraphs are written to the file but I get this stack trace

[code] *** Break *** segmentation violation

===========================================================
There was a crash.
This is the entire stack trace of all threads:

#0 0x00007f98125047ed in waitpid () from /lib64/libc.so.6
#1 0x00007f98124968c9 in do_system () from /lib64/libc.so.6
#2 0x00007f9812496c00 in system () from /lib64/libc.so.6
#3 0x00007f9810cc993c in TUnixSystem::StackTrace() () from /afs/cern.ch/atlas/offline/external/LCGCMT/LCGCMT_65/InstallArea/x86_64-slc6-gcc47-opt/lib/libCore.so
#4 0x00007f9810ccc173 in TUnixSystem::DispatchSignals(ESignals) () from /afs/cern.ch/atlas/offline/external/LCGCMT/LCGCMT_65/InstallArea/x86_64-slc6-gcc47-opt/lib/libCore.so
#5
#6 0x00007f980bd412e8 in ROOT::delete_TGraph(void*) () from /afs/cern.ch/atlas/offline/external/LCGCMT/LCGCMT_65/InstallArea/x86_64-slc6-gcc47-opt/lib/libHist.so
#7 0x00007f9810c9f371 in TClass::Destructor(void*, bool) () from /afs/cern.ch/atlas/offline/external/LCGCMT/LCGCMT_65/InstallArea/x86_64-slc6-gcc47-opt/lib/libCore.so
#8 0x00007f9811dee59f in PyROOT::op_dealloc_nofree(PyROOT::ObjectProxy*) () from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.07a/x86_64-slc6-gcc47-opt/root/lib/libPyROOT.so
#9 0x00007f9811dee5d9 in PyROOT::(anonymous namespace)::op_dealloc(PyROOT::ObjectProxy*) () from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.07a/x86_64-slc6-gcc47-opt/root/lib/libPyROOT.so
#10 0x0000000000464876 in subtype_dealloc (self=0x15ae5b90) at /build/vdiez/Python-2.7.3/Objects/typeobject.c:1014
#11 0x000000000044819f in dict_dealloc (mp=0x16c50e00) at /build/vdiez/Python-2.7.3/Objects/dictobject.c:985
#12 0x000000000044819f in dict_dealloc (mp=0x6214290) at /build/vdiez/Python-2.7.3/Objects/dictobject.c:985
#13 0x00000000004648c4 in subtype_dealloc (self=0x7f980da97110) at /build/vdiez/Python-2.7.3/Objects/typeobject.c:999
#14 0x000000000043a43f in list_dealloc (op=0x6dbb2d8) at /build/vdiez/Python-2.7.3/Objects/listobject.c:309
#15 0x00000000004470e7 in insertdict (mp=mp
entry=0x19bbe60, key=0x7f9813362750, hash=-819708725461818216, value=value
entry=0x7712c0) at /build/vdiez/Python-2.7.3/Objects/dictobject.c:530
#16 0x0000000000449b32 in PyDict_SetItem (op=op
entry=0x19bbe60, key=, value=value
entry=0x7712c0) at /build/vdiez/Python-2.7.3/Objects/dictobject.c:775
#17 0x000000000044b7e0 in _PyModule_Clear (m=) at /build/vdiez/Python-2.7.3/Objects/moduleobject.c:138
#18 0x00000000004afd9f in PyImport_Cleanup () at /build/vdiez/Python-2.7.3/Python/import.c:445
#19 0x00000000004bd35b in Py_Finalize () at /build/vdiez/Python-2.7.3/Python/pythonrun.c:454
#20 Py_Finalize () at /build/vdiez/Python-2.7.3/Python/pythonrun.c:400
#21 0x00000000004162ff in Py_Main (argc=, argv=) at /build/vdiez/Python-2.7.3/Modules/main.c:664
#22 0x00007f9812476cdd in __libc_start_main () from /lib64/libc.so.6
#23 0x0000000000415941 in _start ()

The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug 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 0x00007f980bd412e8 in ROOT::delete_TGraph(void*) () from /afs/cern.ch/atlas/offline/external/LCGCMT/LCGCMT_65/InstallArea/x86_64-slc6-gcc47-opt/lib/libHist.so
#7 0x00007f9810c9f371 in TClass::Destructor(void*, bool) () from /afs/cern.ch/atlas/offline/external/LCGCMT/LCGCMT_65/InstallArea/x86_64-slc6-gcc47-opt/lib/libCore.so
#8 0x00007f9811dee59f in PyROOT::op_dealloc_nofree(PyROOT::ObjectProxy*) () from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.07a/x86_64-slc6-gcc47-opt/root/lib/libPyROOT.so
#9 0x00007f9811dee5d9 in PyROOT::(anonymous namespace)::op_dealloc(PyROOT::ObjectProxy*) () from /afs/cern.ch/sw/lcg/app/releases/ROOT/5.34.07a/x86_64-slc6-gcc47-opt/root/lib/libPyROOT.so
#10 0x0000000000464876 in subtype_dealloc (self=0x15ae5b90) at /build/vdiez/Python-2.7.3/Objects/typeobject.c:1014
#11 0x000000000044819f in dict_dealloc (mp=0x16c50e00) at /build/vdiez/Python-2.7.3/Objects/dictobject.c:985
#12 0x000000000044819f in dict_dealloc (mp=0x6214290) at /build/vdiez/Python-2.7.3/Objects/dictobject.c:985
#13 0x00000000004648c4 in subtype_dealloc (self=0x7f980da97110) at /build/vdiez/Python-2.7.3/Objects/typeobject.c:999
#14 0x000000000043a43f in list_dealloc (op=0x6dbb2d8) at /build/vdiez/Python-2.7.3/Objects/listobject.c:309
#15 0x00000000004470e7 in insertdict (mp=mp
entry=0x19bbe60, key=0x7f9813362750, hash=-819708725461818216, value=value
entry=0x7712c0) at /build/vdiez/Python-2.7.3/Objects/dictobject.c:530
#16 0x0000000000449b32 in PyDict_SetItem (op=op
entry=0x19bbe60, key=, value=value
entry=0x7712c0) at /build/vdiez/Python-2.7.3/Objects/dictobject.c:775
#17 0x000000000044b7e0 in _PyModule_Clear (m=) at /build/vdiez/Python-2.7.3/Objects/moduleobject.c:138
#18 0x00000000004afd9f in PyImport_Cleanup () at /build/vdiez/Python-2.7.3/Python/import.c:445
#19 0x00000000004bd35b in Py_Finalize () at /build/vdiez/Python-2.7.3/Python/pythonrun.c:454
#20 Py_Finalize () at /build/vdiez/Python-2.7.3/Python/pythonrun.c:400
#21 0x00000000004162ff in Py_Main (argc=, argv=) at /build/vdiez/Python-2.7.3/Modules/main.c:664
#22 0x00007f9812476cdd in __libc_start_main () from /lib64/libc.so.6
#23 0x0000000000415941 in _start ()
===========================================================[/code]

I’m not able to read it to get some clue on what’s going on, but if I remove the mg.Add() functions I have no problems at all (except I don’t get the plots written), any clue?

Looks like I have some more clue but still no solution, as in the image attached you can notice that somehow the axes are not drawn well.
Canvas_1.pdf (15.7 KB)

Hi,

for the TMultigraph problem, ROOT.SetOwnership(rms_graph, False) and ROOT.SetOwnership(calib_graph_ch1, False) may help (these should be automatic, assuming the heuristic memory model (which is the default) is used).

I don’t know about the axes; I’d really need to have example code for that.

Cheers,
Wim

Unfortunately adding ROOT.SetOwnership(rms_graph, False) and ROOT.SetOwnership(calib_graph_ch1, False) doesn’t help! But thanks for the answer!

Hi,

then I really need a working (i.e. crashing) example. What I make of your code quoted is this:[code]import ROOT

a = ROOT.TVectorF(2)
b = ROOT.TVectorF(2)

c = ROOT.TGraph(a,b)
d = ROOT.TGraph(a,b)

mg = ROOT.TMultiGraph()
mg.Add©
mg.Add(d)

f = ROOT.TFile(“test.root”, “RECREATE”)
mg.Write()
f.Close()[/code]which does not crash.

Cheers,
Wim

If you can use TUCS on lxplus I can provide the worker otherwise you won’t be able to run it unfortunately. TUCS is and environment for analysis in the tile cal, I’m working on the noise constants.

By the way I used a workaround and created canvases and added there the TGraphs() that I needed but still I wish I can understand why with the TMultiGraph it crashes!

[quote=“drkg4b”]If you can use TUCS on lxplus I can provide the worker[/quote]Yes, that should be fine as I should have access to any ATLAS resources needed. I’ve never used TUCS though, but the instructions seem straightforward enough …

Cheers,
Wim

Ok then! The worker TimeDependencePlots.py sould be in the Tucs/workers/noise directory and the macro PlotEtaPhy.py in the directory macro/noise/ then fron the Tucs directory you can launch the worker with

python macro/noise/PlotEtaPhi.py 179734 180406 180771 181520 182412 182628 182932 183167 183561 183721

and wait one minute and a half approximately!

The code is pretty bad due to the TUCS environment!

Thanks for your help!
PlotEtaPhi.py (1.54 KB)
TimeDependencePlots.py (17.8 KB)