RE: [ROOT] no h2root exec after installation? ...and ... gdb error messages.

From: Philippe Canal (pcanal@fnal.gov)
Date: Thu Jul 31 2003 - 00:12:06 MEST


Hi,

I was not really able to reproduce your exact problem.  However I probably understood the issues.

Your code is missing a lot of error checking.  I.e. it goes on even though an essential operation as failed.

For example, the first I saw was that:

  FILE * fp = fopen("PedRootFileSummary.txt2","r");
  // code not using fp removed for conciseness
  while(fgets(filein_tmp,30,fp)) {

core dumps because I did not have the file PedRootFileSummary.txt2
Instead you should do:

  FILE * fp = fopen("PedRootFileSummary.txt2","r");
  if (fp==) {
     cerr << "Can not open the file PedRootFileSummary.txt2\n";
     return;
  }
  // code not using fp removed for conciseness
  while(fgets(filein_tmp,30,fp)) {

Then the next problem was 

  TFile * ppfile = new TFile(filein,"READ");
  ....
     AnyHisto = (TH1F *)ppfile->Get(hh);
  ...
     AnyHisto->GetXaxis()->SetRangeUser(*xpos-200.,* xpos+200.);

crashed because the root file was not in the location expected.
  Error in <TFile::TFile>: file 
  ../PedestalRootConvertedFile/ped000403.000001.root does not exist

Here you should do:

  TFile * ppfile = new TFile(filein,"READ");
  if (pp->IsZombie()) {
     cerr << "Root file: " << filein << " not opened properly\n";
     return;
  } 

Now in your case you got the error message

  Error in <TRegexp::Index>: Bad Regular Expression

I am not sure which part of your code sent that message but it 
is extremely likely that this failure set your code in an unstable state.

For your second point, your probably should skip the install part and use the ROOT you built in place.  
h2root is absent probably because configure could not find the location of your HBOOK library.

Cheers,
Philippe.

The stack trace would be even more informative if your code (and the ROOT version you are using) was compiled in debug mode (-g rather -0)

-----Original Message-----
From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]On Behalf Of zaldy
Sent: Monday, July 28, 2003 10:16 AM
To: roottalk@pcroot.cern.ch
Subject: [ROOT] no h2root exec after installation? ...and ... gdb error
messages.



Dear Root Experts,


I would like to report two items:

FIRST
^^^^^
I (step by step) shift to the new root version: ROOT 3.05.05 28 July 2003 
with compiler gcc 3.2.2 at Red Hat Linux 9.

I have one work stuff which I know was running ok in root 3.04/02, 18 Dec 
2002, gcc 2.91.66. I place the whole file in a tar file. Pls see URL:

http://neutrino.kek.jp/~zaldy/root_work/MyRootFaq/report7.28.03.tar

I generated an error report using gdb functionality. Pls see URL:
http://neutrino.kek.jp/~zaldy/root_work/	MyRootFaq/report7.28.03.txt

The indicated URL for the tar file is enough to produce an executable.
I included the main program and Makefile.(Hope I don't miss anything).

Compilation is OK, but when I execute it, i got a segmentation message.
Just dont understand this messages; too technical for me.

I am interested to know what is wrong with my (new) system.


SECOND
^^^^^^
The new root source(root3.05/5) I build using the command:

./configure linux --prefix=/home/zaldy/myroot
gmake
gmake install

Compilation, no errors except that, since I don't have system permission, 
it cannot copy "pdg_table.txt", "root.mines", "root.rootrc", "CVC" on 
"/etc/root" dir.

	Should I worry?
 
	Why is it there was no "h2root" executable in $ROOTSYS/bin? I need 
        this to convert my *.hbook to *.root files.


Thanks.


-- 

--------------------------------------------------------
                   Zaldy A. Nawang 
                   PS Users Room 2
                   Yon Gokan, 
                   E362, Neutrino Group, 
                   IPNS, KEK, 
                   Japan 
                    
                   e-mail: zaldy@neutrino.kek.jp
                   Tel. No. : (81) 029864 - 5387
--------------------------------------------------------



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET