EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: libca bug?
From: Bruno Martins via Tech-talk <[email protected]>
To: Matt Newville <[email protected]>
Cc: tech-talk <[email protected]>
Date: Mon, 6 May 2019 11:15:00 -0400
After removing caClientCallbackThreadId=0 in base, the following seems to be enough to prevent segfaults when using pyepics inside pyDevSup:

ca.AUTO_CLEANUP = False
addHook('AtIocExit', ca.finalize_libca)

Bruno


On Sat, May 4, 2019 at 11:30 AM Matt Newville <[email protected]> wrote:

On Fri, May 3, 2019 at 8:27 PM Michael Davidsaver <[email protected]> wrote:
On 5/3/19 1:58 PM, Matt Newville via Tech-talk wrote:
> I do not know of a way to ask "what dynamic libs are already loaded" from python

You can check if the process already include symbols ca_context_create.

> hasattr(cdll.LoadLibrary(None), 'ca_context_create')
OK, thanks -- that might be useful. To be clear, this returns False for me in the "normal" case of actually loading `libca` for the first time from a Python session:

    >>> from ctypes import cdll
    >>> from epics.ca import find_libca
    >>> dllname = find_libca()
    >>> print(dllname)
   /Users/Newville/anaconda3/lib/python3.7/site-packages/epics/clibs/darwin64/libca.dylib

    >>> libca = cdll.LoadLibrary(dllname)
    >>> print(hasattr(libca, 'ca_context_create'),
                   hasattr(cdll.LoadLibrary(None), 'ca_context_create'))
  True False

So that might be a reliable way to answer the question "am I running as an embedded Python within an IOC-like process that has loaded libca?".  That would be good to know.  Registering epicsAtExit() might be useful in all cases, but it seems like we might really need to do that when embedded in an IOC.

--Matt 



Replies:
Re: libca bug? Johnson, Andrew N. via Tech-talk
References:
libca bug? Bruno Martins via Tech-talk
Re: libca bug? Matt Newville via Tech-talk
Re: libca bug? Michael Davidsaver via Tech-talk
Re: libca bug? Matt Newville via Tech-talk

Navigate by Date:
Prev: RE: Pmac Slits George Nicolas Kontogiorgos via Tech-talk
Next: Re: firewalld configuration for EPICS? Michael Davidsaver via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: libca bug? Matt Newville via Tech-talk
Next: Re: libca bug? Johnson, Andrew N. via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 06 May 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·