RE: Seg fault from libTree.so

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Thu, 13 Jan 2005 09:18:44 -0600


Hi Phil,

Thanks for reporting this problem it will be fixed shortly in the CVS repository.
As a work around, do not call

   root NtpAlign.C
When NtpAlign contains a class named NtpAlign (as opposed to a function). Instead do

   > root
   root [] .L NtpAlign.C

Cheers,
Philippe.

PS. More details:

There is an issue (which will be fix shortly in the CVS repository) with handling object lifetime when doing:

    root NtpAlign.C

When the file NtpAlign contains a class named NtpAlign (as opposed to a function).
In this case a temporary object of type NtpAlign is created. See the output:

    (const class NtpAlign)150748920
However it is only deleted __after__ the execution of the first command. Hence __after__

   root [1] NtpAlign f
The problem is that in this case f then retrieve a pointer to the open file
(tmp.root) but this file is delete by the deletion of the temporary object.
So When executing

   root [2] f.Loop();
It tries to access the now delete file.

Cheers,
Philippe.

-----Original Message-----
From: owner-roottalk_at_pcroot.cern.ch [mailto:owner-roottalk_at_pcroot.cern.ch] On Behalf Of Philip Symes
Sent: Wednesday, January 12, 2005 4:10 PM To: roottalk_at_pcroot.cern.ch
Subject: [ROOT] Seg fault from libTree.so

Hi ROOTers,
I was trying to do a quick analysis on the file http://minoserv.maps.susx.ac.uk/~symes/calibconsts/tmp.root
(653 KB) so I ran MakeClass() on the file.

When I ran Loop() in a bare ROOT session, it worked fine. I then added a the line
cerr << nb << "\t";
to the loop (with the <iostream> header), but when I ran the Loop() function

again, I got the seg faults (below). When I ran it under GDB, it attributed the problem to libTree.so.

I get the same problem on ROOT 4.01/04 on Scientific Linux 3.0.3 and 4.02/00

on RedHat 9. Do you know what the problem could be?

Cheers,
Phil

I tried this in a bare ROOT session, and using ACLiC and GDB:

[symes_at_minos09 nearmaps]$ root NtpAlign.C


FreeType Engine v2.1.3 used to render TrueType fonts. Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.156, Oct 20 2004 Type ? for help. Commands must be C++ statements. Enclose multiple statements between { }. root [0]
Processing NtpAlign.C...
Warning in <TClass::TClass>: no dictionary for class VldContext is available Warning in <TClass::TClass>: no dictionary for class VldTimeStamp is available
Warning in <TClass::TClass>: no dictionary for class NtpAlignmentRecord is available

Warning in <TClass::TClass>: no dictionary for class 
RecRecordImp<RecCandHeader> is available
Warning in <TClass::TClass>: no dictionary for class RecRecord is available
Warning in <TClass::TClass>: no dictionary for class RecCandHeader is 
available
Warning in <TClass::TClass>: no dictionary for class RecPhysicsHeader is available
Warning in <TClass::TClass>: no dictionary for class RecDataHeader is available
Warning in <TClass::TClass>: no dictionary for class RecHeader is available Warning in <TClass::TClass>: no dictionary for class NtpAlignTrackStrip is available
Warning in <TClass::TClass>: no dictionary for class NtpAlignCandStrip is available
(const class NtpAlign)150748920

root [1] NtpAlign f
root [2] f.Loop()

root [3] .q
[symes_at_minos09 nearmaps]$
[symes_at_minos09 nearmaps]$ root NtpAlign.C+


FreeType Engine v2.1.3 used to render TrueType fonts. Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.156, Oct 20 2004 Type ? for help. Commands must be C++ statements. Enclose multiple statements between { }. root [0]
Processing NtpAlign.C+...
Info in <TUnixSystem::ACLiC>: creating shared library

/home/symes/mytest/nearmaps/./NtpAlign_C.so
In file included from /home/symes/mytest/nearmaps/NtpAlign.C:2,
                 from /home/symes/mytest/nearmaps/fileWHBGrB.h:32,
                 from /home/symes/mytest/nearmaps/fileWHBGrB.cxx:16:
/home/symes/mytest/nearmaps/NtpAlign.h: In member function `virtual Int_t

   NtpAlign::Cut(long long int)':
/home/symes/mytest/nearmaps/NtpAlign.h:440: warning: unused parameter `Long64_t

   entry'
Warning in <TClass::TClass>: no dictionary for class VldContext is available Warning in <TClass::TClass>: no dictionary for class VldTimeStamp is available
Warning in <TClass::TClass>: no dictionary for class NtpAlignmentRecord is available

Warning in <TClass::TClass>: no dictionary for class 
RecRecordImp<RecCandHeader> is available
Warning in <TClass::TClass>: no dictionary for class RecRecord is available
Warning in <TClass::TClass>: no dictionary for class RecCandHeader is 
available
Warning in <TClass::TClass>: no dictionary for class RecPhysicsHeader is available
Warning in <TClass::TClass>: no dictionary for class RecDataHeader is available
Warning in <TClass::TClass>: no dictionary for class RecHeader is available Warning in <TClass::TClass>: no dictionary for class NtpAlignTrackStrip is available
Warning in <TClass::TClass>: no dictionary for class NtpAlignCandStrip is available
(class NtpAlign)179878776

root [1] NtpAlign f
root [2] f.Loop()

(gdb) r NtpAlign.C

Starting program: /home/opt/opt/root/bin/root.exe NtpAlign.C
(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)...(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 -1218583008 (LWP 9086)]
(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)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...Detaching after fork from child process 9089.
(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)...


FreeType Engine v2.1.3 used to render TrueType fonts. Compiled for linux with thread support.

CINT/ROOT C/C++ Interpreter version 5.15.156, Oct 20 2004 Type ? for help. Commands must be C++ statements. Enclose multiple statements between { }.
(no debugging symbols found)...(no debugging symbols found)...(no debugging
symbols found)...root [0]
Processing NtpAlign.C...
Warning in <TClass::TClass>: no dictionary for class VldContext is available Warning in <TClass::TClass>: no dictionary for class VldTimeStamp is available
Warning in <TClass::TClass>: no dictionary for class NtpAlignmentRecord is available

Warning in <TClass::TClass>: no dictionary for class 
RecRecordImp<RecCandHeader> is available
Warning in <TClass::TClass>: no dictionary for class RecRecord is available
Warning in <TClass::TClass>: no dictionary for class RecCandHeader is 
available
Warning in <TClass::TClass>: no dictionary for class RecPhysicsHeader is available
Warning in <TClass::TClass>: no dictionary for class RecDataHeader is available
Warning in <TClass::TClass>: no dictionary for class RecHeader is available Warning in <TClass::TClass>: no dictionary for class NtpAlignTrackStrip is available
Warning in <TClass::TClass>: no dictionary for class NtpAlignCandStrip is available
(no debugging symbols found)...(const class NtpAlign)175820336
root [1] NtpAlign f
root [2] f.Loop()

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1218583008 (LWP 9086)] 0x00f808e2 in G__G__Tree_132_2_5 () from /opt/root/lib/libTree.so
(gdb) where full

#0 0x00f808e2 in G__G__Tree_132_2_5 () from /opt/root/lib/libTree.so No symbol table info available.
#1 0x00ac27bf in G__call_cppfunc () from /opt/root/lib/libCint.so No symbol table info available.
#2 0x00ab1e93 in G__interpret_func () from /opt/root/lib/libCint.so No symbol table info available.
#3 0x00a99a80 in G__getfunction () from /opt/root/lib/libCint.so No symbol table info available.
#4 0x00b1e4f7 in G__getstructmem () from /opt/root/lib/libCint.so No symbol table info available.
#5 0x00b185dd in G__getvariable () from /opt/root/lib/libCint.so No symbol table info available.
#6 0x00a9100e in G__getitem () from /opt/root/lib/libCint.so No symbol table info available.
#7 0x00a8fc26 in G__getexpr () from /opt/root/lib/libCint.so No symbol table info available.
#8 0x00a7eeee in G__define_var () from /opt/root/lib/libCint.so No symbol table info available.
#9 0x00b0cf93 in G__defined_type () from /opt/root/lib/libCint.so No symbol table info available.
#10 0x00addb5c in G__exec_statement () from /opt/root/lib/libCint.so No symbol table info available.
#11 0x00ab35e3 in G__interpret_func () from /opt/root/lib/libCint.so No symbol table info available.
#12 0x00a99a80 in G__getfunction () from /opt/root/lib/libCint.so No symbol table info available.
#13 0x00b1e4f7 in G__getstructmem () from /opt/root/lib/libCint.so No symbol table info available.
#14 0x00b185dd in G__getvariable () from /opt/root/lib/libCint.so No symbol table info available.
#15 0x00a9100e in G__getitem () from /opt/root/lib/libCint.so No symbol table info available.
#16 0x00a8fc26 in G__getexpr () from /opt/root/lib/libCint.so No symbol table info available.
#17 0x00ad7a0e in G__exec_function () from /opt/root/lib/libCint.so No symbol table info available.
#18 0x00ade65b in G__exec_statement () from /opt/root/lib/libCint.so No symbol table info available.
#19 0x00a78c7b in G__exec_tempfile_core () from /opt/root/lib/libCint.so No symbol table info available.
#20 0x00a78e58 in G__exec_tempfile_fp () from /opt/root/lib/libCint.so No symbol table info available.
#21 0x00ae68e4 in G__process_cmd () from /opt/root/lib/libCint.so No symbol table info available.
#22 0x00481f91 in TCint::ProcessLine () from /opt/root/lib/libCore.so No symbol table info available.
#23 0x003e1ed6 in TApplication::ProcessLine () from /opt/root/lib/libCore.so No symbol table info available.
#24 0x002cfe1d in TRint::HandleTermInput () from /opt/root/lib/libRint.so No symbol table info available.
#25 0x002cec8e in TTermInputHandler::Notify () from /opt/root/lib/libRint.so ---Type <return> to continue, or q <return> to quit---q Quit
(gdb) q

The program is running. Exit anyway? (y or n) y [symes_at_minos09 nearmaps]$

-- 
Philip Symes,
MINOS Group,
Fermilab & Sussex University.
http://minoserv.maps.susx.ac.uk/~symes/
Received on Thu Jan 13 2005 - 16:30:28 MET

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:04 MET