Break segmentation error

What is gdb?

This file is in Mbs while the other are in Kbs. This is the only difference :smiley:

Could you please try to resolve this issue.
wz0.cc (10.1 KB)
vMergedMiniEvents_0.root (42.5 KB)

Hi,

sorry we cannot debug your code :sweat_smile:
gdb is a widely used tool which can help you debugging your programs: https://www.gnu.org/software/gdb/
I am afraid that before answering my two questions above we’ll not be able to provide any further help.

D

Thanks D,
This is not a good sign for me :frowning: :smiley:

Hi Nab,

do not worry. You have in hands all the elements to help us help you. Even without gdb, what is special about this file? Does it exist? Is it corrupt? What are the errors ROOT prints? Is there a stacktrace? Can you run only on this file until you have more control on your setup?

Cheers,
D

Thank you D.

There is nothing special in this file. It is just a few Mbs. Yes it exists and absolutely correct. The errors ROOT prints are not in the script. Like nMu is not defined, infect it is defined and some numbers at the end like

Warning: Automatic variable j is allocated wz0.cc:107:
Error: Symbol nMu is not defined in current scope  wz0.cc:108:
Error: Binary operator oprand missing wz0.cc:108:
*** glibc detected *** /usr/bin/root.exe: free(): invalid pointer: 0x0000000004532d10 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x75dee)[0x7fb5f623cdee]
/lib64/libc.so.6(+0x78c3d)[0x7fb5f623fc3d]
/usr/lib64/root/libCint.so.5.34(G__destroy_upto+0x2ca)[0x7fb5f59b462a]
/usr/lib64/root/libCint.so.5.34(G__interpret_func+0x40c4)[0x7fb5f591ed04]
/usr/lib64/root/libCint.so.5.34(G__getfunction+0x1958)[0x7fb5f590b918]
/usr/lib64/root/libCint.so.5.34(G__getitem+0x86e)[0x7fb5f58ea12e]
/usr/lib64/root/libCint.so.5.34(G__getexpr+0x4048)[0x7fb5f58eecb8]
/usr/lib64/root/libCint.so.5.34(G__calc_internal+0x3f8)[0x7fb5f58f81c8]
/usr/lib64/root/libCint.so.5.34(G__process_cmd+0x3145)[0x7fb5f5977275]
/usr/lib64/root/libCore.so.5.34(_ZN5TCint11ProcessLineEPKcPN12TInterpreter10EErrorCodeE+0x536)[0x7fb5f6ed6c46]
/usr/lib64/root/libCore.so.5.34(_ZN5TCint16ProcessLineSynchEPKcPN12TInterpreter10EErrorCodeE+0x103)[0x7fb5f6ed43b3]
/usr/lib64/root/libCore.so.5.34(_ZN12TApplication11ExecuteFileEPKcPib+0x826)[0x7fb5f6e3b126]
/usr/lib64/root/libCore.so.5.34(_ZN12TApplication11ProcessLineEPKcbPi+0x933)[0x7fb5f6e3a5d3]
/usr/lib64/root/libRint.so.5.34(_ZN5TRint3RunEb+0x501)[0x7fb5f6a8a811]
/usr/bin/root.exe(main+0x4c)[0x40103c]
/lib64/libc.so.6(__libc_start_main+0xfd)[0x7fb5f61e5d1d]
/usr/bin/root.exe[0x400f09]
======= Memory map: ========
00400000-00402000 r-xp 00000000 fc:01 42007                              /usr/bin/root.exe
00601000-00602000 rw-p 00001000 fc:01 42007                              /usr/bin/root.exe
00fbc000-04553000 rw-p 00000000 00:00 0                                  [heap]
7fb5e8000000-7fb5e8021000 rw-p 00000000 00:00 0
7fb5e8021000-7fb5ec000000 ---p 00000000 00:00 0
7fb5ec145000-7fb5edf65000 rw-p 00000000 00:00 0
7fb5ee2e8000-7fb5ee66b000 rw-p 00000000 00:00 0
7fb5ee66b000-7fb5ee687000 r-xp 00000000 fc:01 258305                     /usr/lib64/root/libmultimap2Dict.so.5.34

And on some files it give me segmentation error

Processing wz11.cc...

 *** Break *** segmentation violation



===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0x00007ff073cb482e in waitpid () from /lib64/libc.so.6
#1  0x00007ff073c46479 in do_system () from /lib64/libc.so.6
#2  0x00007ff074957b04 in TUnixSystem::StackTrace() () from /usr/lib64/root/libCore.so.5.34
#3  0x00007ff074956f23 in TUnixSystem::DispatchSignals(ESignals) () from /usr/lib64/root/libCore.so.5.34
#4  <signal handler called>
#5  0x00007ff073424a9c in G__searchvariable () from /usr/lib64/root/libCint.so.5.34
#6  0x00007ff073426af7 in G__getvariable () from /usr/lib64/root/libCint.so.5.34
#7  0x00007ff07332a9ad in G__getitem () from /usr/lib64/root/libCint.so.5.34
#8  0x00007ff07332fcb8 in G__getexpr () from /usr/lib64/root/libCint.so.5.34
#9  0x00007ff07334c226 in G__getfunction () from /usr/lib64/root/libCint.so.5.34
#10 0x00007ff073431071 in G__getstructmem(int, G__FastAllocString&, char*, int, char*, int*, G__var_array*, int) () from /usr/lib64/root/libCint.so.5.34
#11 0x00007ff07342980a in G__getvariable () from /usr/lib64/root/libCint.so.5.34
#12 0x00007ff07332a9ad in G__getitem () from /usr/lib64/root/libCint.so.5.34
#13 0x00007ff07332fcb8 in G__getexpr () from /usr/lib64/root/libCint.so.5.34
#14 0x00007ff0733aabe7 in G__exec_statement () from /usr/lib64/root/libCint.so.5.34
#15 0x00007ff0733b168b in ?? () from /usr/lib64/root/libCint.so.5.34
#16 0x00007ff0733ad651 in G__exec_statement () from /usr/lib64/root/libCint.so.5.34
#17 0x00007ff07335edd9 in G__interpret_func () from /usr/lib64/root/libCint.so.5.34
#18 0x00007ff07334c918 in G__getfunction () from /usr/lib64/root/libCint.so.5.34
#19 0x00007ff07332b12e in G__getitem () from /usr/lib64/root/libCint.so.5.34
#20 0x00007ff07332fcb8 in G__getexpr () from /usr/lib64/root/libCint.so.5.34
#21 0x00007ff0733391c8 in G__calc_internal () from /usr/lib64/root/libCint.so.5.34
#22 0x00007ff0733b8275 in G__process_cmd () from /usr/lib64/root/libCint.so.5.34
#23 0x00007ff074917c46 in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) () from /usr/lib64/root/libCore.so.5.34
#24 0x00007ff0749153b3 in TCint::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) () from /usr/lib64/root/libCore.so.5.34
#25 0x00007ff07487c126 in TApplication::ExecuteFile(char const*, int*, bool) () from /usr/lib64/root/libCore.so.5.34
#26 0x00007ff07487b5d3 in TApplication::ProcessLine(char const*, bool, int*) () from /usr/lib64/root/libCore.so.5.34
#27 0x00007ff0744cb811 in TRint::Run(bool) () from /usr/lib64/root/libRint.so.5.34
#28 0x000000000040103c in main ()
===========================================================


The crash is most likely caused by a problem in your script.
Try to compile it (.L myscript.C+g) and fix any errors.
If that does not help 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.


Root > Function wz11() busy flag cleared

It is indeed something special.
Could you start fixing?

Warning: Automatic variable j is allocated wz0.cc:107:
Error: Symbol nMu is not defined in current scope wz0.cc:108:
Error: Binary operator oprand missing wz0.cc:108:

Cheers,
D

They all are defined. I have check these.

You have two problems in “wz0.cc”:

[...] $ `root-config --cxx --cflags` -O2 -Wall -Wextra -c wz0.cc
wz0.cc: In function ‘void wz0()’:
wz0.cc:137:30: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
 if(m_i != 999 && m_ii != 999); is2muon =true;
                              ^
wz0.cc:259:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
 if(nlj = 0) continue;
           ^

and some more in “wz11.cc”:

[...] $ `root-config --cxx --cflags` -O2 -Wall -Wextra -c wz11.cc                                                                                                                                          
wz11.cc: In function ‘void wz11()’:                                                                                                                                                                                                          
wz11.cc:138:6: error: redeclaration of ‘bool is2muon’                                                                                                                                                                                        
 bool is2muon =true;                                                                                                                                                                                                                         
      ^                                                                                                                                                                                                                                      
wz11.cc:134:12: error: ‘bool is2muon’ previously declared here                                                                                                                                                                               
       bool is2muon = false;                                                                                                                                                                                                                 
            ^                                                                                                                                                                                                                                
wz11.cc:139:30: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
 if(m_i != 999 && m_ii != 999);
                              ^
wz11.cc:261:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
 if(nlj = 0) continue;
           ^

Dear Wile_E_Coyote,

I donot understand what it means, braces around empty body in if statements.
Some time we have to use multiple if statements and we use brace at the end. Is it mean I have to apply braces after each if statement?

I guess you want:

if(m_i != 999 && m_ii != 999) is2muon = true;
// ...
if(nlj == 0) continue;

Yes this is what I need. But is it not a correct way to define it ?

Compare character by character what I wrote with what you have.

Hi Wile,

I have compared what you suggested, but still I am getting the same segmentation error.

Maybe it’s a CINT limitation … try to use ACLiC:
root [0] .x wz0.cc++g

I looked into the attached “vMergedMiniEvents_0.root” file.
Executing “AnaTree->Print();” shows that all arrays are 1000 elements long (e.g. “VetoMu_px[1000]”) but, in your “wz0.cc”, you say 50 (e.g. “VetoMu_px[50]”).

Thank you so much Wile. I have edited array no from 50 to 1000. The error is removed but still files are running and i am not getting its output. Is it take such a long time to run (about one hour and still running).
Is there is some other way to fasten the running process.

Thank you,
Nab

If you think it is the interpreter which slows down your analysis … try to use ACLiC with
compiler optimizations:
root [0] .x wz0.cc++O

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.