EPICS Home

Experimental Physics and Industrial Control System


 
2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: IOC error message on camonitor disconnect
From: Michael Davidsaver <[email protected]>
To: EPICS core-talk <[email protected]>
Date: Tue, 1 Aug 2017 10:26:05 +0200
On 07/31/2017 04:41 PM, Michael Davidsaver wrote:
> All,
> 
> On 07/31/2017 11:58 AM, Michael Davidsaver wrote:
>> This smells like a race where the send/recv buffer "stack" pointers are
>> being changed unexpectedly, probably zeroed.  However, I don't yet see
>> where.
> 
> With this in mind, I found two issues:
> 
> * calls to send_err() in camessage() were missing SEND_LOCK().
> * cas_send_bs_msg() could set "send.stk=0" outside of SEND_LOCK().
> 
> Freddie reports that these changes avoid the crash, but he still sees
> the "Missaligned protocol rejected" message.

Freddie and I have isolated another issue.

In camsgtask() the value returned by recv() is stored like:

> osiSockIoctl_t nchars = recv (...

It seems that for WIN32 alone osiSockIoctl_t is an unsigned type.  So
recv()==-1 becomes recv()=0xffffffff, which leads to re-processing a
buffer containing remnants of previously received messages (and beyond).


> $ git grep typedef.*osiSockIoctl_t
> src/libCom/osi/os/Darwin/osdSock.h:typedef int osiSockIoctl_t;
> src/libCom/osi/os/Linux/osdSock.h:typedef int osiSockIoctl_t;
> src/libCom/osi/os/RTEMS/osdSock.h:typedef int osiSockIoctl_t;
> src/libCom/osi/os/WIN32/osdSock.h:typedef u_long FAR osiSockIoctl_t;
> src/libCom/osi/os/cygwin32/osdSock.h:typedef int osiSockIoctl_t;
> src/libCom/osi/os/freebsd/osdSock.h:typedef int osiSockIoctl_t;
> src/libCom/osi/os/iOS/osdSock.h:typedef int osiSockIoctl_t;
> src/libCom/osi/os/solaris/osdSock.h:typedef int osiSockIoctl_t;
> src/libCom/osi/os/vxWorks/osdSock.h:typedef int osiSockIoctl_t;

References:
Re: IOC error message on camonitor disconnect Michael Davidsaver
Re: IOC error message on camonitor disconnect Michael Davidsaver

Navigate by Date:
Prev: Re: IOC error message on camonitor disconnect Michael Davidsaver
Next: Build failed in Jenkins: epics-base-3.15-mac-test #140 APS Jenkins
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: IOC error message on camonitor disconnect Michael Davidsaver
Next: areaDetector developers meeting @ ITER Mark Rivers
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024