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.


// gdb output of the test program run on one of the Pentium III machines
(gdb) run
Starting program: /afs/
[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/
(gdb) bt
#0 0x4094a447 in TGraph::Fit(TF1*, char const*, char const*, double, double)
() from /usr/local/lib/root/
#1 0x08048b19 in main () at
#2 0x40f75917 in __libc_start_main () from /lib/

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

#include <TGraph.h>
#include <TF1.h>

using namespace std;

int main()
TGraph *graph = new TGraph(3);

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

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


    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

[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


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.