g+
g+ Communities
Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014 
<== Date ==> <== Thread ==>

Subject: Re: wxPython timer and KEK CaPython314 cause core dump
From: Noboru Yamamoto <noboru.yamamoto@kek.jp>
To: renz@uchicago.edu
Cc: tech-talk@aps.anl.gov
Date: Wed, 06 Dec 2006 10:47:29 +0900
Hi,

I'm not familiar with WxPytho (yet).

But, the following code works on MacBook running MacOSX 10.4.8 with
Python2.5, wxPython2.7-osx-unicode-2.7.2.0-universal10.4-py2.5.dmg
and KEK version of CaPython314 ( I should have used the different name
to avoid confusion with FNAL version. Sorry).

######################################
import wx,ca

class MyApp(wx.PySimpleApp):
    def OnInit(self):
        frame = wx.Frame(None, -1, "Hello from wxPython")
        frame.Show(True)
        self.frame=frame
        self.ch=ca.channel("fred")
        self.ch.wait_conn()
        self.ch.monitor(self.ca_callback)
        self.ch.flush()
        self.SetTopWindow(frame)
        return True

    def ca_callback(self,valstat):
        self.ch.update_val(valstat)
        self.frame.Title="%s:%f"%(self.ch.name,self.ch.val)

if __name__ == "__main__":
    app = MyApp(0)
    app.MainLoop()

#############################################

I hope this can give some idea.
Regards,

Noboru Yamamoto
EPICS group/J-PARC control group
KEK, JAPAN

Zhong Ren wrote:
> I managed to isolate a core dump in a minimized Python code
> (see below).  I found two components are essential to cause a
> core dump: wx.Timer and ca.Monitor (or ca.Get).  Can someone
> tell what the problem is?
> 
> ###############################################
> import wx
> import ca
> 
> def onTimer(event): pass
> 
> ca.Monitor('S:SRcurrentAI')
> 
> appli = wx.PySimpleApp()
> frame = wx.Frame(None)
> timer = wx.Timer()
> timer.Bind(wx.EVT_TIMER, onTimer)
> timer.Start(milliseconds = 10, oneShot = False)
> appli.MainLoop()
> ###############################################
> 
> Other info:
> Pyhton 2.5
> wxPython 2.6.3.3
> RedHat Linux x86_64
> GCC 4.1.1
> 
> To test, let the routine run for a while.  A core dump will
> occur in a few minutes.

begin:vcard
fn:Noboru Yamamoto
n:Yamamoto;Noboru
email;internet:noboru.yamamoto@kek.jp
tel;work:+81-29-864-1171, ext. 5309
tel;fax:+81-29-864-0321
x-mozilla-html:FALSE
version:2.1
end:vcard


References:
wxPython timer and KEK CaPython314 cause core dump Zhong Ren

Navigate by Date:
Prev: next EPICS meeting at DESY in April 2007 Matthias Clausen
Next: JCA, Gateways and EPICS_CA_ADDR_LIST Rees, NP (Nick)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014 
Navigate by Thread:
Prev: wxPython timer and KEK CaPython314 cause core dump Zhong Ren
Next: wxPython timer and KEK CaPython314 cause core dump Matt Newville
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·