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 2019 2020 <2021> 2022 2023 2024 2025 | 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 2019 2020 <2021> 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: Incompatibility of pyepics and pvaPy 4.0.0 on Windows |
From: | Mark Rivers via Tech-talk <tech-talk at aps.anl.gov> |
To: | EPICS tech-talk <tech-talk at aps.anl.gov> |
Date: | Sat, 11 Sep 2021 15:44:38 +0000 |
I tested tomoscan using different versions of ca.dll, as controlled by the PYEPICS_LIBCA environment variable. The tests were all done as follows: -
tomoscan was built without importing pvaccess at all -
Python 3.8.8 -
pyepics 3.5.0 -
pvapy 4.0.0.
I then copied the patched version of base-7.0.6/bin/windows-x64/Com.dll to Anaconda3\envs\tomoscan\Lib\site-packages\pvaccess\Com.dll and tested again. It worked fine with PYEPICS_LIBCA= Anaconda3\envs\tomoscan\Lib\site-packages\pvaccess\ca.dll, which had failed above. It also worked fine when I rebuilt tomoscan with pvaccess imports enabled and PYEPICS_LIBCA undefined, which was my original configuration that failed. So I conclude that Freddie’s patch has fixed the issue. Thanks Freddie! Mark From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Freddie Akeroyd - STFC UKRI via Tech-talk Hi,
Applying the change at
https://github.com/epics-base/epics-base/pull/200/files
fixes the issue on my machine, does it also work for you? Regards, Freddie From: Veseli, Sinisa <sveseli at anl.gov>
Hi, I have also reproduced the problem with Matt's script. Unlike Matt, however, I see the problem when "import pvaccess" is commented out, and PYEPICS_LIBCA is set to
point to ca.dll from pvaccess. Sinisa -- Siniša Veseli Scientific Software Engineering & Data Management Advanced Photon Source Argonne National Laboratory (630)252-9182 From: Freddie Akeroyd - STFC UKRI <freddie.akeroyd at stfc.ac.uk> Hi, I can reproduce the error on my windows machine with your script. I rebuilt 7.0.6 with debug symbols and I get: Exception thrown: read access violation. __imp_TlsGetValue(...) returned nullptr. > [Inline Frame] Com.dll!osdThreadGetTimer(...) Line 814 C Com.dll!epicsThreadSleep(double seconds) Line 847 C ca.dll!ca_client_context::pendEvent(const double & timeout) Line 586 C++ ca.dll!ca_pend_event(double timeout) Line 474 C++ [External Code]
_ctypes.pyd!_call_function_pointer(int flags, int(*)() pProc, void * * avalues, _ffi_type * * atypes, _ffi_type * restype, void *
resmem, int argcount) Line 874 C _ctypes.pyd!_ctypes_callproc(int(*)() pProc, _object * argtuple, IUnknown * pIunk, _GUID * iid, int flags, _object * argtypes, _object
* restype, _object * checker) Line 1214 C In 7.0.6 the wait functions were changed to use waitable timers for higher accuracy, the timer is allocated at thread creation and stored in thread
local storage. It looks like there has been an error retrieving this timer from TLS. I can look at it in more detail. Regards, Freddie
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Johnson, Andrew N. via Tech-talk Hi Matt, Thanks for working on this; can script be made to fail on Linux too, out of interest? Unfortunately neither Sinisa nor I have local access to a Windows system, although there is one that we can remote into, so debugging
this stuff isn’t that easy for us. Having your script to test should help though if it fails for us too. I had a chat with Sinisa earlier. He’s currently working on a possible way to resolve the problem by building EPICS Base without creating any shared libraries, then linking the loadable library for pvaPy using the non-shared
library versions, so the result would be that the pvaPy library would be completely self-contained. It would have copies of the libca and libcom routines embedded inside it, but Python would have no way to get to those symbols as they wouldn’t be exported.
It occurs to me now that there might be some issues with name decorations when doing the final linke, we’ll have to see. One thing you maybe could try would be to force (recompile?) pyepics to use the same copies of libca and libcom that pvaPy was built against. You want to be sure that both sets of bindings are calling the exact same
set of DLLs. Mark said yesterday that wasn’t able to get pyepics to work with the DLLs that came with pvaccess, was he using the prepackaged versions? Can you reproduce that? - Andrew
-- Complexity comes for free, simplicity you have to work for. This email and any attachments are intended solely for the use of the named recipients. If you are not the intended recipient you must not use, disclose, copy or distribute this email or any of its attachments and
should notify the sender immediately and delete this email from your system. UK Research and Innovation (UKRI) has taken every reasonable precaution to minimise risk of this email or any attachments containing viruses or malware but the recipient should carry
out its own virus and malware checks before opening the attachments. UKRI does not accept any liability for any losses or damages which the recipient may sustain due to presence of any viruses. |