Rootcint buffer overflow kubuntu 8.10 64 bit

Dear all,

I cannot use my ROOT-based analysis on my laptop due to a buffer overflow in rootcint (see below). However, it works in other environments (SLC5 64 bit and Debian 64 bit).

Where do I need to look for the error?

Thanks for you help!

Cheers,

Holger

Generating dictionary VBFStudyDict.cxx ... rootcint -f VBFStudyDict.cxx -c VBFStudyGUI.h VBFStudy.h NTupleChain.h EventCutset.h Plotset.h Utilities.h LinkDefFile.h *** buffer overflow detected ***: rootcint terminated ======= Backtrace: ========= /lib/libc.so.6(__fortify_fail+0x37)[0x2adbd1fb6887] /lib/libc.so.6[0x2adbd1fb4750] /products/root_522/lib/root/libCint.so.5.22(_ZN4Cint12G__ClassInfo9TmpltNameEv+0x34)[0x2adbd0957954] rootcint(_ZN4ROOT4RStl14DropDefaultArgERKSs+0x4d)[0x427f7d] rootcint(_Z20WriteBodyShowMembersRN4Cint12G__ClassInfoEb+0x1f50)[0x41ef50] rootcint(_Z16WriteShowMembersRN4Cint12G__ClassInfoEb+0x4e8)[0x41f658] rootcint(_Z14WriteClassCodeRN4Cint12G__ClassInfoEb+0x1aa)[0x41fe9a] rootcint(main+0x34bf)[0x42638f] /lib/libc.so.6(__libc_start_main+0xe6)[0x2adbd1ed5466] rootcint[0x409f49] ======= Memory map: ======== 00400000-0043f000 r-xp 00000000 08:05 6620839 /products/root_522/bin/rootcint 0063f000-00640000 r--p 0003f000 08:05 6620839 /products/root_522/bin/rootcint 00640000-00641000 rw-p 00040000 08:05 6620839 /products/root_522/bin/rootcint 00641000-00642000 rw-p 00641000 00:00 0 017c1000-02013000 rw-p 017c1000 00:00 0 [heap] 2adbd06af000-2adbd06ce000 r-xp 00000000 08:05 6242532 /lib/ld-2.8.90.so 2adbd06ce000-2adbd06d1000 rw-p 2adbd06ce000 00:00 0 2adbd08cd000-2adbd08ce000 r--p 0001e000 08:05 6242532 /lib/ld-2.8.90.so 2adbd08ce000-2adbd08cf000 rw-p 0001f000 08:05 6242532 /lib/ld-2.8.90.so 2adbd08cf000-2adbd0b1f000 r-xp 00000000 08:05 6628082 /products/root_522/lib/root/libCint.so.5.22 2adbd0b1f000-2adbd0d1e000 ---p 00250000 08:05 6628082 /products/root_522/lib/root/libCint.so.5.22 2adbd0d1e000-2adbd0d21000 r--p 0024f000 08:05 6628082 /products/root_522/lib/root/libCint.so.5.22 2adbd0d21000-2adbd0d26000 rw-p 00252000 08:05 6628082 /products/root_522/lib/root/libCint.so.5.22 2adbd0d26000-2adbd1508000 rw-p 2adbd0d26000 00:00 0 2adbd1508000-2adbd150a000 r-xp 00000000 08:05 6242553 /lib/libdl-2.8.90.so 2adbd150a000-2adbd170a000 ---p 00002000 08:05 6242553 /lib/libdl-2.8.90.so 2adbd170a000-2adbd170b000 r--p 00002000 08:05 6242553 /lib/libdl-2.8.90.so 2adbd170b000-2adbd170c000 rw-p 00003000 08:05 6242553 /lib/libdl-2.8.90.so 2adbd170c000-2adbd17fd000 r-xp 00000000 08:05 5740408 /usr/lib/libstdc++.so.6.0.10 2adbd17fd000-2adbd19fd000 ---p 000f1000 08:05 5740408 /usr/lib/libstdc++.so.6.0.10 2adbd19fd000-2adbd1a04000 r--p 000f1000 08:05 5740408 /usr/lib/libstdc++.so.6.0.10 2adbd1a04000-2adbd1a06000 rw-p 000f8000 08:05 5740408 /usr/lib/libstdc++.so.6.0.10 2adbd1a06000-2adbd1a1a000 rw-p 2adbd1a06000 00:00 0 2adbd1a1a000-2adbd1a9e000 r-xp 00000000 08:05 6242565 /lib/libm-2.8.90.so 2adbd1a9e000-2adbd1c9d000 ---p 00084000 08:05 6242565 /lib/libm-2.8.90.so 2adbd1c9d000-2adbd1c9e000 r--p 00083000 08:05 6242565 /lib/libm-2.8.90.so 2adbd1c9e000-2adbd1c9f000 rw-p 00084000 08:05 6242565 /lib/libm-2.8.90.so 2adbd1c9f000-2adbd1cb5000 r-xp 00000000 08:05 6242557 /lib/libgcc_s.so.1 2adbd1cb5000-2adbd1eb5000 ---p 00016000 08:05 6242557 /lib/libgcc_s.so.1 2adbd1eb5000-2adbd1eb6000 r--p 00016000 08:05 6242557 /lib/libgcc_s.so.1 2adbd1eb6000-2adbd1eb7000 rw-p 00017000 08:05 6242557 /lib/libgcc_s.so.1 2adbd1eb7000-2adbd2020000 r-xp 00000000 08:05 6242542 /lib/libc-2.8.90.so 2adbd2020000-2adbd221f000 ---p 00169000 08:05 6242542 /lib/libc-2.8.90.so 2adbd221f000-2adbd2223000 r--p 00168000 08:05 6242542 /lib/libc-2.8.90.so 2adbd2223000-2adbd2224000 rw-p 0016c000 08:05 6242542 /lib/libc-2.8.90.so 2adbd2224000-2adbd222b000 rw-p 2adbd2224000 00:00 0 2adbd222b000-2adbd223c000 r-xp 00000000 08:05 2941040 /products/root_522/lib/root/cint/cint/include/stdfunc.so.5.22 2adbdmake: *** [VBFStudyDict.cxx] Aborted make: *** Datei »VBFStudyDict.cxx« wird gelöscht

Hi,

You could try rootcint -f VBFStudyDict.cxx -c VBFStudyGUI.h VBFStudy.h NTupleChain.h EventCutset.h Plotset.h Utilities.h LinkDefFile.h You could also try to use the tool named ‘valgrind’ to pin-point the location of the error.

Cheers,
Philippe.

Hi Holger,

one of your class names is too long, probably because of a template with plenty of default parameters. You can track down which one it is by only passing one header after another. You can then send us output.txt from g++ -E HeaderThatCausesIt.h -I$ROOTSYS/include > output.txt so we can figure out which type is causing it.

Cheers, Axel.

Hi,

the command line throws numerous file not found errors and delivers the output below.

[code]g++ -E VBFStudy.cxx -I$ROOTSYS/include > output.txt

VBFStudy.cxx:6:23: error: Riostream.h: No such file or directory
VBFStudy.cxx:7:19: error: TROOT.h: No such file or directory
VBFStudy.cxx:8:19: error: TMath.h: No such file or directory
VBFStudy.cxx:9:25: error: TClassTable.h: No such file or directory
VBFStudy.cxx:10:18: error: TH1F.h: No such file or directory
VBFStudy.cxx:11:18: error: TH2F.h: No such file or directory
VBFStudy.cxx:12:31: error: TGraphAsymmErrors.h: No such file or directory
VBFStudy.cxx:13:20: error: TGaxis.h: No such file or directory
VBFStudy.cxx:14:17: error: TF1.h: No such file or directory
VBFStudy.cxx:15:21: error: TLegend.h: No such file or directory
VBFStudy.cxx:16:19: error: TFile.h: No such file or directory
VBFStudy.cxx:17:21: error: TCanvas.h: No such file or directory
VBFStudy.cxx:18:20: error: TStyle.h: No such file or directory
VBFStudy.cxx:19:21: error: TSystem.h: No such file or directory
VBFStudy.cxx:20:20: error: TChain.h: No such file or directory
VBFStudy.cxx:21:26: error: TApplication.h: No such file or directory
In file included from VBFStudy.h:24,
from VBFStudy.cxx:25:
NTupleChain.h:15:17: error: TH1.h: No such file or directory
NTupleChain.h:16:17: error: TH2.h: No such file or directory
NTupleChain.h:17:17: error: TH3.h: No such file or directory
In file included from VBFStudy.h:25,
from VBFStudy.cxx:25:
Plotset.h:14:18: error: TH1D.h: No such file or directory
Plotset.h:15:18: error: TH2D.h: No such file or directory
Plotset.h:16:18: error: TH3D.h: No such file or directory
Plotset.h:26:22: error: TGString.h: No such file or directory
In file included from Plotset.h:27,
from VBFStudy.h:25,
from VBFStudy.cxx:25:
EventCutset.h:17:22: error: TFormula.h: No such file or directory
In file included from VBFStudy.cxx:25:
VBFStudy.h:26:22: error: TGClient.h: No such file or directory
VBFStudy.h:27:22: error: TGButton.h: No such file or directory
VBFStudy.h:28:21: error: TGFrame.h: No such file or directory
VBFStudy.h:29:33: error: TRootEmbeddedCanvas.h: No such file or directory
VBFStudy.h:30:23: error: RQ_OBJECT.h: No such file or directory
In file included from VBFStudy.h:32,
from VBFStudy.cxx:25:
VBFStudyGUI.h:15:21: error: TRandom.h: No such file or directory
VBFStudyGUI.h:19:20: error: TGMenu.h: No such file or directory
VBFStudyGUI.h:20:22: error: TQObject.h: No such file or directory
VBFStudyGUI.h:25:24: error: TPaveStats.h: No such file or directory
VBFStudyGUI.h:27:25: error: TPostScript.h: No such file or directory
VBFStudy.cxx:26:21: error: TThread.h: No such file or directory
line[/code]

output.txt is attached.
Translations: “eingebaut” -> inserted
“Kommandozeile” -> command

Thanks,
Holger
output.txt (733 KB)

Hi,

any ideas how I can get rootcint to run again?

Thanks,
Holger

[code]g++ -E VBFStudy.cxx -I$ROOTSYS/include > output.txt

VBFStudy.cxx:6:23: error: Riostream.h: No such file or directory [/code] Humm … this seems to say that ROOTSYS was not set (properly).

Cheers,
Philippe.

Hi,

adding a /root after /include got rid of the error messages:
g++ -E VBFStudy.cxx -I$ROOTSYS/include/root

The resulting output is attached.

Thanks,
Holger
output.txt (1.55 MB)

Hi,

Can you also send the result of:

g++ -E -C "-DG__LINUX=1" "-DG__GNUC=4" "-DG__GNUC_MINOR=1" "-DG__GNUC_VER=4001" "-DG__GLIBC=2" "-DG__GLIBC_MINOR=6" "-DG__ROOT=1" "-DG__NATIVELONGLONG=1" "-DTRUE=1" "-DFALSE=0" "-Dexternalref=extern" "-DSYSV" "-D__MAKECINT__" -I$ROOTSYS/include/root -D__CINT__ -I$ROOTSYS/cint/include -I$ROOTSYS/cint/lib -I$ROOTSYS/cint/stl VBFStudy.cxx where I am not sure ROOTSYS/cint is the ‘right’ prefix :frowning:.

Thanks,
Philippe.

Hi,

I don’t see anything in stderr, which would hint at the path given to be incorrect.
I’m attaching the output.

Cheers,
Holger
rootcint_debug.txt.gz (498 KB)

Hi,

unfortunately it looks like my guess where wrong :frowning:
Try again with-I$ROOTSYS/lib/root/cint/include -I$ROOTSYS/lib/root/cint/lib -I$ROOTSYS/lib/root/cint/stl

Thanks,
Philippe.

With
g++ -E -C “-DG__LINUX=1” “-DG__GNUC=4” “-DG__GNUC_MINOR=1” “-DG__GNUC_VER=4001” “-DG__GLIBC=2” “-DG__GLIBC_MINOR=6” “-DG__ROOT=1” “-DG__NATIVELONGLONG=1” “-DTRUE=1” “-DFALSE=0” “-Dexternalref=extern” “-DSYSV” “-D__MAKECINT__” -I$ROOTSYS/include/root -D__CINT__ -I$ROOTSYS/lib/root/cint/include -I$ROOTSYS/lib/root/cint/lib -I$ROOTSYS/lib/root/cint/stlVBFStudy.cxx > ~/tmp/rootcint_debug2.txt
I get the same output.

Thanks for helping,
Holger

humm … what’s in: $ROOTSYS/lib/root/cint/include

Umm - nothing, they don’t exist. Oops. Now I’ve tried this instead:
g++ -E -C “-DG__LINUX=1” “-DG__GNUC=4” “-DG__GNUC_MINOR=1” “-DG__GNUC_VER=4001” “-DG__GLIBC=2” “-DG__GLIBC_MINOR=6” “-DG__ROOT=1” “-DG__NATIVELONGLONG=1” “-DTRUE=1” “-DFALSE=0” “-Dexternalref=extern” “-DSYSV” “-D__MAKECINT__” -I$ROOTSYS/include/root -D__CINT__ -I$ROOTSYS/lib/root/cint/cint/include -I$ROOTSYS/lib/root/cint/cint/lib -I$ROOTSYS/lib/root/cint/cint/stl VBFStudy.cxx > ~/tmp/rootcint_debug3.txt

Please find attached the output.

Cheers,
Holger
rootcint_debug3.txt.gz (265 KB)

Hi,

Can you also send you linkdef file?

Thanks,
Philippe

Sure!

#ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ class Utilities+; #pragma link C++ class VBFStudy+; #pragma link C++ class VBFStudyGUI+; #pragma link C++ class NTupleChain+; #pragma link C++ class EventCutset+; #pragma link C++ class Plotset+; #pragma link C++ class Optionset+; #endif

Thanks,
Holger

Hi,

(I am not yet managing to reproduce the error … i.e. the dictionary is created just fine from me :frowning:). So can you try:valgrind rootcint -f VBFStudyDict.cxx -c VBFStudyGUI.h VBFStudy.h NTupleChain.h EventCutset.h Plotset.h Utilities.h LinkDefFile.h

Thanks,
Philippe

Well, it also works okay for me on an SLC5 system. But life would be easier if it also worked on my laptop. Please find below the valgrind output.

valgrind rootcint -f VBFStudyDict.cxx -c VBFStudyGUI.h VBFStudy.h NTupleChain.h EventCutset.h Plotset.h Utilities.h LinkDefFile.h ==20030== Memcheck, a memory error detector. ==20030== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. ==20030== Using LibVEX rev 1854, a library for dynamic binary translation. ==20030== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. ==20030== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation framework. ==20030== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. ==20030== For more details, rerun with: -v ==20030== **20030** *** strcpy_chk: buffer overflow detected ***: program terminated ==20030== at 0x4C281B3: VALGRIND_PRINTF_BACKTRACE (valgrind.h:3695) ==20030== by 0x4C28361: __strcpy_chk (mc_replace_strmem.c:614) ==20030== by 0x4EB3953: Cint::G__ClassInfo::TmpltName() (in /products/root_522/lib/root/libCint.so.5.22) ==20030== by 0x427F7C: ROOT::RStl::DropDefaultArg(std::string const&) (in /products/root_522/bin/rootcint) ==20030== by 0x41EF4F: WriteBodyShowMembers(Cint::G__ClassInfo&, bool) (in /products/root_522/bin/rootcint) ==20030== by 0x41F657: WriteShowMembers(Cint::G__ClassInfo&, bool) (in /products/root_522/bin/rootcint) ==20030== by 0x41FE99: WriteClassCode(Cint::G__ClassInfo&, bool) (in /products/root_522/bin/rootcint) ==20030== by 0x42638E: main (in /products/root_522/bin/rootcint) ==20030== ==20030== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 425 from 3) ==20030== malloc/free: in use at exit: 7,447,816 bytes in 102,144 blocks. ==20030== malloc/free: 224,306 allocs, 122,162 frees, 25,656,579 bytes allocated. ==20030== For counts of detected errors, rerun with: -v ==20030== searching for pointers to 102,144 not-freed blocks. ==20030== checked 15,515,592 bytes. ==20030== ==20030== LEAK SUMMARY: ==20030== definitely lost: 832 bytes in 52 blocks. ==20030== possibly lost: 39,404 bytes in 565 blocks. ==20030== still reachable: 7,407,580 bytes in 101,527 blocks. ==20030== suppressed: 0 bytes in 0 blocks. ==20030== Rerun with --leak-check=full to see details of leaked memory.

Thanks,
Holger

Hi,

The problem is most likely the triple!!! nested map:map<unsigned int,map<string,map<unsigned int,short> > *>When CINT explicits the 3rd and 4th argument of the maps, the total size name is more than 512 characters!

To solve the problem you need to #define G__LONGBUF
in G__ci.h (and recompile root).

Cheers,
Philippe.

Hi,

recompiling ROOT with the
#define G__LONGBUF
preprocessor definition fixed the buffer overflow for me!

Great! Thanks so much!

Have a nice day,
Holger