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

From: Dr. John Krane (jkrane@netzero.com)
Date: Mon Mar 29 2004 - 23:44:04 MEST


Hi everyone,

I'm not sure I made my original desire clear.  My fit takes anywhere 
from 1 week to 4 weeks to complete.  That is a single "MINI" command.  I 
would like to write the intermediate states to a file so I don't lose 
data completely if I overwhelm Windows on day 6 with a huge database 
operation while ROOT is working in the background.

So my structure is basically

TVirutalFitter *myminuit;  //declared globally
int main( blah ) {
  myminuit = TVirtualFitter::Fitter(0, ARRAYSIZE);
  myminuit->ExecuteCommand("MINI",arglist,0);
}
void func_fit::minimize(Int_t &npar, Double_t *grad, Double_t &mychi2,
                            Double_t *params, Int_t iflag){
    // blah blah...compute "mychi2" based on "npar" values
    count++;
    if (fmod(count,10000)==0) myminuit->Write();
}

So, myminuit is *in the middle* of fitting when I try to write it to 
disk.  In fact, it is in the middle of a call to my user-function when I 
try to write it to disk.  I don't know if I can write successfully at 
this time, but it is what I must try to do.  In this sense, putting 
gMinuit->Write() into tutorials/Ifit.C is not relevant because I do not 
intend to wait politely for Minuit to finish the fit before I try to 
write it to disk.

Does anybody know if something about the guts of TVirtualFitter 
prohibits me from even trying to do this?  Maybe I can edit 
TVirtualFitter in ROOT to put in a method that does a this->Write() or 
something, so it at least won't be in the middle of a function call when 
I try to write it.

    - John

>>Program received signal SIGSEGV, Segmentation fault.
>>[Switching to Thread 1091201184 (LWP 24100)]
>>0x4025d8a2 in ROOT::TObject_IsA(void const*) () from
>>
>>/bin/root/lib/libCore.so
>>(gdb) where
>>#0  0x4025d8a2 in ROOT::TObject_IsA(void const*) ()
>>from 
>>/bin/root/lib/libCore.so
>>#1  0x401619b4 in TClass::GetActualClass(void
>>const*) const () from 
>>/bin/root/lib/libCore.so
>>#2  0x400ec4ff in TBuffer::WriteObjectAny(void
>>const*, TClass*) () from 
>>/bin/root/lib/libCore.so
>>#3  0x4024f7cf in operator<<(TBuffer&, TObject
>>const*) () from 
>>/bin/root/lib/libCore.so
>>#4  0x40e9d933 in TMinuit::Streamer(TBuffer&) ()
>>from 
>>/bin/root/lib/libMinuit.so
>>#5  0x40101246 in TKey::TKey(TObject*, char const*,
>>int) () from 
>>/bin/root/lib/libCore.so
>>#6  0x4010e293 in TObject::Write(char const*, int,
>>int) () from 
>>/bin/root/lib/libCore.so
>>#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, 
>>iflag=4)
>>    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
>>
>>
>>    
>>
>
>
>
>  
>

-- 

Dr. John Krane
jkrane@netzero.com



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