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  <20152016  2017  2018  2019  2020  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  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy
From: "Wang Xiaoqiang (PSI)" <[email protected]>
To: Michael Davidsaver <[email protected]>
Cc: Epics <[email protected]>
Date: Fri, 15 May 2015 07:46:42 +0000
Hi Michael, Jamie,

Thanks for the hints. In pcaspy library, the PV instances are created on startup and live until application quits.
The casPV::destroy method is not implemented.
https://github.com/paulscherrerinstitute/pcaspy/blob/master/pcaspy/pv.cpp#L112

But it does implement casPV::createChannel for access security group.
Will that cause this double free problem?

Best
Xiaoqiang

> On 13 May 2015, at 23:25, Michael Davidsaver <[email protected]> wrote:
> 
> On 05/13/2015 05:03 PM, Jameson Graef Rollins wrote:
>> ...
>> I think this is just a symlink issue.
> 
> Ok
> 
>> ...  I do however see a
>> "_cas.so" that's included with the pcaspy package [1].
> 
> This is the one I meant.  This all looks normal.
> 
> So I'm 0 for 3 so far :)
> 
>>>> Thread 1 (Thread 0x7f8658d49700 (LWP 26265)):
> ...
>>>> #4  0x00007f86529e2d05 in cantProceed (msg=<optimized out>) at ../../../src/libCom/misc/cantProceed.c:69
>>>> #5  0x00007f8652568525 in casPVI::getExtServer() const () from /ligo/apps/ubuntu12/epics-3.14.12.2_long/base/lib/linux-x86_64/libcas.so.3.14
>>>> #6  0x00007f8652c2efa3 in PV::postEvent (this=0x30a0200, value=...) at pcaspy/pv.cpp:83
>>>> #7  0x00007f8652c1fdc9 in _wrap_PV_postEvent (args=<optimized out>) at pcaspy/casdef_wrap.cpp:9193
>>>> #8  0x0000000000571b58 in PyEval_EvalFrameEx ()
>> 
>> Ok!  So what's to be done here?  Is this a problem in the pcaspy SWIG
>> bindings, or in libcas?  I can't see anything obvious that is being
>> called incorrectly:
> 
> In my experience, when pthread_mutex_unlock fails w/ EINVAL it is either
> a sign of memory corruption, or that the lock has already been free'd
> (w/ pthread_mutex_destory).
> 
> Given that the process doesn't crash I'm guessing its the later.
> 
> Is your application creating, or more importantly destroying, casPVI
> instances when this error appears?  A race during destruction would
> probably explain things.
> 
> 
> Michael
> 



Replies:
Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Jameson Graef Rollins
References:
"epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Jameson Graef Rollins
Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Jameson Graef Rollins
Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Michael Davidsaver
Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Jameson Graef Rollins
Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Michael Davidsaver
Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Jameson Graef Rollins
Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Michael Davidsaver
Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Jameson Graef Rollins
Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Michael Davidsaver

Navigate by Date:
Prev: Question about device support Florian Feldbauer
Next: Re: Question about device support Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Jameson Graef Rollins
Next: Re: "epicsMutex pthread_mutex_unlock failed" with pyepics/pcaspy Jameson Graef Rollins
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·