TGraph::Fit seg fault

We have recently upgraded out lab from RedHat 7 to RedHat 9, and I have been having some problems getting our programs using ROOT to run correctly. I have tracked the problem down to segmentation faults in TGraph::Fit and created a minimal test program (included below).

We have four machines running RedHat 9. Three are Pentium III ~500Mhz, and one is a dual Pentium IV 2GHz. ROOT is installed on /usr/local which is shared via AFS by all four machines. My test program runs correctly on the Pentium IV, but crashes with a segmentation violation in TGraph::Fit on all three Pentium III machines. Any suggestions are apreciated, I am stumped.

Thanks,
Josh

// gdb output of the test program run on one of the Pentium III machines
(gdb) run
Starting program: /afs/auger.mtu.edu/home/joaander/fit_test/test
[New Thread 16384 (LWP 1492)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 1492)]
0x4094a447 in TGraph::Fit(TF1*, char const*, char const*, double, double) ()
from /usr/local/lib/root/libGraf.so
(gdb) bt
#0 0x4094a447 in TGraph::Fit(TF1*, char const*, char const*, double, double)
() from /usr/local/lib/root/libGraf.so
#1 0x08048b19 in main () at fit_test.cc:19
#2 0x40f75917 in __libc_start_main () from /lib/libc.so.6
(gdb)

/////////////////////////////////////////
// compiled with: g++ -o test fit_test.cc -g root-config --libs root-config --cflags

// fit_test.cc
#include <TGraph.h>
#include <TF1.h>
#include

using namespace std;

int main()
{
TGraph *graph = new TGraph(3);
graph->SetPoint(0,1,1);
graph->SetPoint(0,2,2);
graph->SetPoint(0,3,4);

    TF1 *fit = new TF1("fit", "[0]*x + [1]");

    graph->Fit(fit, "QN");

    fit->Print();


    delete fit;
    delete graph;
    return 0;
    }

////////////////////////////////////////
[joaander@kosmos fit_test]$ g++ --version
g++ (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
Copyright © 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[joaander@kosmos fit_test]$

///////////////////////////////////
ROOT version: 3.05/07

I cannot reproduce this problem. See the same code executed interactively below. I suspect a mismatch in your PATH/LD_LIBRARY_PATH

root [0] TGraph *graph = new TGraph(3);
root [1] graph->SetPoint(0,1,1);
root [2] graph->SetPoint(0,2,2);
root [3] graph->SetPoint(0,3,4);
root [4]
root [4]
root [4] TF1 *fit = new TF1(“fit”, “[0]*x + [1]”);
root [5]
root [5] graph->Fit(fit, “QN”);
root [6]
root [6] fit->Print();
fit : [0]*x+[1] Ndim= 1, Npar= 2, Noper= 5
fExpr[0] = [0] fOper = 101
fExpr[1] = x fOper = 110000
fExpr[2] = * fOper = 3
fExpr[3] = [1] fOper = 102
fExpr[4] = + fOper = 1
Par 0 p0 = 1.33333
Par 1 p1 = -1.1191e-13
root [7]
root [7]
root [7] delete fit;
root [8] delete graph;
root [9] .q

Note that instead of creating a TF1 object, you can do directly
graph->Fit(“pol1”)

Rene

We found the problem. Apparently, there are some config files for ROOT that are installed into /etc/. Since only /usr/local was being shared, the other computers did not have access to this file, causing the seg fault. The config files have been duplicated and all is working fine now.