EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: RE: R3.14.8 Status/logClient patch
From: "Jeff Hill" <[email protected]>
To: <[email protected]>, <[email protected]>
Cc: "'Ralph Lange'" <[email protected]>
Date: Fri, 18 Nov 2005 09:37:12 -0700
Ben,

> Note: the text in this message corresponds to errno=EINPROGRESS, whereas
> the reported errno is 0.

I am starting to guess that maybe the HPUX build does not have its
multi-threaded execution compiler options turned on for the C compiler. In
particular, you need the one that makes errno a thread private variable. For
HPUX we have "#define SOCKERRNO errno". Usually the thread safe errno
compiler options causes something like "#define errno getErrno()" to be
defined in one of the operating system header files.

I had a look at this site (which appears to apply to both the C and c++
compliers):
http://docs.hp.com/en/1559/options.htm

I think you need to add -mt here

CONFORM_CFLAGS_ANSI = -Aa -mt
CONFORM_CFLAGS_STRICT = -Aa -mt
CONFORM_CFLAGS_TRAD = -Ac -mt


> A 'fix' that seems to work (on vxWorks-68040, linux-x86 and HP-UX) is to
> check if errno is 0 (zero) (even if the return code is negative) and
> assume a successful connect in this case. That is, treat errno==zero
> the same as errno==EISCONN.
> 
> Any thoughts, comments, suggestions?

I am suspecting that errno became zero here because another thread wrote
that value into errno. I suspect that you need the compiler options that
make errno a thread private variable.

Do you have two logClient threads running at once (both using errno and
potentially setting it to EINPROGRESS)?

Jeff

> -----Original Message-----
> From: Benjamin Franksen [mailto:[email protected]]
> Sent: Friday, November 18, 2005 7:26 AM
> To: Jeff Hill; [email protected]
> Subject: Re: R3.14.8 Status/logClient patch
> 
> Jeff,
> 
> I discovered a problem. I wrongly claimed that I successfully tested a
> soft ioc runnign on HP-UX. I must have missed something -- in fact it
> doesn't even work in (unchanged) R3.14.7. The symptom is:
> 
> iocLogInit
> log client: Unable to connect to "193.149.12.184:7004" because
> 0="Operation now in progress"
> 
> Note: the text in this message corresponds to errno=EINPROGRESS, whereas
> the reported errno is 0.
> 
> I am stupefied as to how this is possible.
> 
> The code that gives this message is in logClientConnect(). It connects
> and in case of a negatie return value, makes a copy of errno. Then it
> checks the errno copy for various values and on SOCK_EISCONN decides
> that we are connected.
> 
> A 'fix' that seems to work (on vxWorks-68040, linux-x86 and HP-UX) is to
> check if errno is 0 (zero) (even if the return code is negative) and
> assume a successful connect in this case. That is, treat errno==zero
> the same as errno==EISCONN.
> 
> Any thoughts, comments, suggestions?
> 
> Cheers,
> Ben
> 
> PS: I attached the latest version.



Replies:
Re: R3.14.8 Status/logClient patch Benjamin Franksen
References:
Re: R3.14.8 Status/logClient patch Benjamin Franksen

Navigate by Date:
Prev: Re: posix thread priorities Andrew Johnson
Next: Re: R3.14.8 Status/logClient patch Benjamin Franksen
Index: 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: R3.14.8 Status/logClient patch Benjamin Franksen
Next: Re: R3.14.8 Status/logClient patch Benjamin Franksen
Index: 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·