RE: problem creating vector<TLorentzVector> particles in CINT

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Tue, 01 Apr 2008 11:05:14 -0500


Hi,

This is a (unfortunately :)) known deficiency of CINT which has trouble to deal with interpreted STL container of objects.

To work around the problem you need to either generated the dictionary for your vector (see below) or simply compile your whole example:

   .x example.C+

Cheers,
Philippe.

// stlloader.C
#include "TLorentzVector.h"
#include <vector>
#ifdef __MAKECINT__
#pragma link C++ class vector<TLorentzVector>;
#endif

// and use with:
// root [] .L stlloader.C+

-----Original Message-----
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of Konstantinos.Theofilatos_at_cern.ch Sent: Tuesday, April 01, 2008 11:00 AM
To: roottalk_at_root.cern.ch
Subject: [ROOT] problem creating vector<TLorentzVector> particles in CINT

Hi ROOT experts,

I am trying to run interactively a simple program with a vector<TLorentzVector> in CINT but I fail.

#include<vector>

void example()
{

    vector<TLorentzVector> particles;
    TLorentzVector aux(1,1,1,1);
    particles.push_back(aux);
}

there is no problem when I am producing a stand alone executable (i.e. g++ -I `$ROOTSYS/bin/root-config --incdir` -o executable.bin  example.C `$ROOTSYS/bin/root-config --libs`

the problem arises *only* when I am in interactive CINT session. I've also noticed that on my local desktop with old SLC3 the same piece of code runs without problems in CINT.

any suggestions?
thanks
kostas

[xxxxxx] ~/tmp > uname -a
Linux xxxxxx.cern.ch 2.6.9-55.EL.cernsmp #1 SMP Thu May 10 18:09:56 CEST 2007 x86_64 x86_64 x86_64 GNU/Linux
[xxxxxx] ~/tmp > gdb
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/bin/root.exe GNU gdb Red Hat Linux (6.3.0.0-1.143.el4rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...(no debugging symbols
found)
Using host libthread_db library "/lib64/tls/libthread_db.so.1".

(gdb) run
Starting program:
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/bin/root.exe

(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

[Thread debugging using libthread_db enabled] [New Thread 182913063168 (LWP 28158)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
  *******************************************
  *                                         *
  *        W E L C O M E  to  R O O T       *
  *                                         *
  *   Version   5.16/00      27 June 2007   *
  *                                         *
  *  You are welcome to visit our Web site  *
  *          http://root.cern.ch            *
  *                                         *
  *******************************************

Compiled on 29 June 2007 for linuxx8664gcc with thread support.

CINT/ROOT C/C++ Interpreter version 5.16.21, June 22, 2007 Type ? for help. Commands must be C++ statements. Enclose multiple statements between { }. root [0] .x example.C
(no debugging symbols found)
Detaching after fork from child process 28249.

(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)

*** glibc detected *** double free or corruption (!prev): 0x0000000000a3b180
***

Program received signal SIGABRT, Aborted. [Switching to Thread 182913063168 (LWP 28158)] 0x000000385c42e21d in raise () from /lib64/tls/libc.so.6 (gdb) bt
#0 0x000000385c42e21d in raise () from /lib64/tls/libc.so.6
#1 0x000000385c42fa1e in abort () from /lib64/tls/libc.so.6
#2 0x000000385c463451 in __libc_message () from /lib64/tls/libc.so.6
#3 0x000000385c46906e in _int_free () from /lib64/tls/libc.so.6
#4 0x000000385c4693b6 in free () from /lib64/tls/libc.so.6
#5 0x000000385e5ae29e in operator delete () from
/usr/lib64/libstdc++.so.6
#6 0x0000002a95ee1828 in G__delete_operator () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#7 0x0000002a95f0433b in G__exec_delete () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#8 0x0000002a95f09c3f in G__exec_statement () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#9 0x0000002a95f0d2e2 in G__exec_if () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#10 0x0000002a95f071ed in G__exec_statement () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#11 0x0000002a95ecad10 in G__interpret_func () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#12 0x0000002a95eb88e7 in G__getfunction () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#13 0x0000002a95e8f5c4 in G__getitem () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#14 0x0000002a95e937fa in G__getexpr () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#15 0x0000002a95f077f2 in G__exec_statement () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#16 0x0000002a95ecad10 in G__interpret_func () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#17 0x0000002a95eb88e7 in G__getfunction () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#18 0x0000002a95e8f5c4 in G__getitem () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#19 0x0000002a95e937fa in G__getexpr () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#20 0x0000002a95f077f2 in G__exec_statement () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#21 0x0000002a95ecad10 in G__interpret_func () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#22 0x0000002a95eb840f in G__getfunction () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#23 0x0000002a95f6ab32 in G__getstructmem () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#24 0x0000002a95f62830 in G__getvariable () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#25 0x0000002a95e8ef2b in G__getitem () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#26 0x0000002a95e937fa in G__getexpr () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#27 0x0000002a95f04731 in G__exec_function () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#28 0x0000002a95f09266 in G__exec_statement () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#29 0x0000002a95ecad10 in G__interpret_func () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#30 0x0000002a95eb840f in G__getfunction () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#31 0x0000002a95f3687b in G__destroy_upto () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#32 0x0000002a95ecb56b in G__interpret_func () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#33 0x0000002a95eb88e7 in G__getfunction () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#34 0x0000002a95e8f5c4 in G__getitem () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#35 0x0000002a95e937fa in G__getexpr () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#36 0x0000002a95e9fd69 in G__calc_internal () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#37 0x0000002a95f13f3e in G__process_cmd () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCint. so
#38 0x0000002a95756e55 in TCint::ProcessLine () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCore. so
#39 0x0000002a956d0e75 in TApplication::ProcessFile () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCore. so
#40 0x0000002a956cf352 in TApplication::ProcessLine () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCore. so
#41 0x0000002a9662c6e0 in TRint::HandleTermInput () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libRint. so
#42 0x0000002a9662af87 in TTermInputHandler::Notify () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libRint. so
#43 0x0000002a9662ce2d in TTermInputHandler::ReadNotify () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libRint. so
#44 0x0000002a9577fe13 in TUnixSystem::CheckDescriptors () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCore. so
#45 0x0000002a95783d39 in TUnixSystem::DispatchOneEvent () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCore. so
#46 0x0000002a95721a65 in TSystem::InnerLoop () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCore. so
#47 0x0000002a957219fd in TSystem::Run () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCore. so
#48 0x0000002a956cf4df in TApplication::Run () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libCore. so
#49 0x0000002a9662b6df in TRint::Run () from
/afs/cern.ch/sw/lcg/external/root/5.16.00/slc4_amd64_gcc34/root/lib/libRint. so
#50 0x000000000040106d in main ()
Received on Tue Apr 01 2008 - 18:05:52 CEST

This archive was generated by hypermail 2.2.0 : Tue Apr 01 2008 - 23:50:01 CEST