[ROOT] seg fault while trying to gMinuit->Write()

From: Dr. John Krane (jkrane@netzero.com)
Date: Mon Mar 29 2004 - 18:38:53 MEST


Some time ago, I asked how to save intermediate steps during weeks-long 
Minuit fits.  The suggested code was simply to do something like:

    TFile f("temp_minuit_intermediate_state.root","RECREATE");

I have a class called "func_fit" that has a minimization method.  
(Because TMinuit wants a bare function, I wrote a wrapper for the member 
function called "dummy_func", visible in the stack trace below.)  My 
class increments a counter every time the minimization method is called; 
when I get zero for fmod(counter,10000), I try to write the TMinuit 
object as above.  Unfortunately, I get the following stack trace.

I'm confused as to the source of the problem, which occurs deep in the 
Streamer methods.  I'm hoping somebody knows what I'm doing wrong.  If 
anyone has any advice or proposals for tests, I'll be very grateful.

    - John

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1091201184 (LWP 24100)]
0x4025d8a2 in ROOT::TObject_IsA(void const*) () from 
(gdb) where
#0  0x4025d8a2 in ROOT::TObject_IsA(void const*) () from 
#1  0x401619b4 in TClass::GetActualClass(void const*) const () from 
#2  0x400ec4ff in TBuffer::WriteObjectAny(void const*, TClass*) () from 
#3  0x4024f7cf in operator<<(TBuffer&, TObject const*) () from 
#4  0x40e9d933 in TMinuit::Streamer(TBuffer&) () from 
#5  0x40101246 in TKey::TKey(TObject*, char const*, int) () from 
#6  0x4010e293 in TObject::Write(char const*, int, int) () from 
#7  0x0805297c in func_fit::minimize(int&, double*, double&, double*, 
int) (this=0x8059a20, npar=@0xbfffd4f4, grad=0xd6f56d0, mychi2=@0xbfffd620,
    params=0xd6ec0b0, iflag=4) at func_fit.cpp:395
#8  0x080547d5 in dummy_func(int&, double*, double&, double*, int) 
(npar=@0xbfffd4f4, grad=0xd6f56d0, mychi2=@0xbfffd620, params=0xd6ec0b0, 
    at fit_idx.cpp:46
#9  0x40e8458d in TMinuit::Eval(int, double*, double&, double*, int) () 
from /bin/root/lib/libMinuit.so
#10 0x40e8d827 in TMinuit::mnhess() () from /bin/root/lib/libMinuit.so
#11 0x40e914b7 in TMinuit::mnmigr() () from /bin/root/lib/libMinuit.so
#12 0x40e8a21a in TMinuit::mnexcm(char const*, double*, int, int&) () 
from /bin/root/lib/libMinuit.so
#13 0x40e8020f in TFitter::ExecuteCommand(char const*, double*, int) () 
from /bin/root/lib/libMinuit.so
#14 0x08055296 in main (argc=2, argv=0xbfffe874) at fit_idx.cpp:140
#15 0x420156a4 in __libc_start_main () from /lib/tls/libc.so.6

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:07 MET