RE:[Fwd: [ROOT] Segfault when passing a fun

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Sat Aug 12 2000 - 04:46:20 MEST


Hello,

>From the message, I am not 100% sure, but
I guess you tried to pass pointer to interpreted function to compiled
code. Unfortunately this does not work unless you prepare specially as
described in doc/ref.txt : G__isinterpretedp2f. 

One thing I can do is to detect error in such case. I made this change
to cint5.14.46 , hoping there is no side-effect.  

Rene,
when you get 5.14.46, please check if this call-back function thing
works fine in existing ROOT system.

Thank you
Masaharu Goto


>Date: Thu, 10 Aug 2000 08:00:42 +0000
>From: Rene Brun <Rene.Brun@cern.ch>
>To: MXJ02154@nifty.ne.jp
>Subject: [Fwd: [ROOT] Segfault when passing a function pointer into a compile
d class...]
>
>Hi Masa,
>Sorry for forwarding all these mails to you. I do not know if you are still
>on the roottalk mailing list.
>
>Rene
>-----------------------------------------------------------------------------
-
--
>Date: Thu, 3 Aug 2000 18:59:43 -0700 (PDT)
>From: Will Robinson <wsr23@stanford.edu>
>To: Root Talk <roottalk@pcroot.cern.ch>
>Subject: [ROOT] Segfault when passing a function pointer into a compiled 
class...
>
>I've been using ROOT for most of the summer, and am very pleased with
>it.  Up until now, I've been able to get along using only the interpreter,
>but recently I've had to start compiling some of my classes to gain speed
>and I/O functionality.  
>
>I've hit a very frustrating snag: one of my compiled classes takes a
>function pointer as one of the parameters in its constructor.  Nothing
>fancy, just something like Double_t (*weightFn)(Float_t).  The problem is
>that when I try to use this function within the class, I get a
>segmentation fault.  I spent a couple of hours staring at the screen,
>trying to find a syntax error or *something*.  Finally I created a tiny
>little dummy class, which took the same type of function pointer in its
>constructor and just output the value returned from that function.  I
>loaded it in the interpreter with a .L and was able to use it as I would
>like to.  Then I opened up that dummy class, added a ClassDef() to the .h
>file and a ClassImp() to the .cxx file, and made the class inherit from
>TObject.  I compiled the class in, and tried again.  When compiled, this
>class also segfaulted when trying to call the function specified by the
>function pointer.
>
>So somewhere in the process of compilation something got screwed up.  I'm
>running ROOT 2.24/05.  I'm running MINFAST on top of this, but in these
>particular classes there is no MINFAST-specific code.
>
>Please help me out of this jam!
>
>Thanks,
>Will Robinson
>wsr23@stanford.edu
>
>



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:31 MET