EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: RE: WINSOCK Error 10055
From: "Jeff Hill" <[email protected]>
To: <[email protected]>, <[email protected]>
Date: Wed, 28 Jan 2004 17:33:55 -0700
Howdy Steve,

Sorry about no text with that error 10055 message, but the time I checked
the windows sockets library was still incapable of converting error codes to
text. Error code 10055 is WSAENOBUFS. This indicates that the IP kernel is
low on buffer space (most IP stacks employ a specialized memory allocation
quantum).

My initial guess was that you were running the IP kernel low on buffers
because of sockets in TIME_WAIT state. I compiled and ran your code and
confirmed this diagnosis using the "netstat" command. The TCP specifications
require that a circuit remain in a zombie like state after an active close
for a delay of two times the maximum IP segment lifetime (2MSL). Among other
things, this guarantees that a port will not be reused until all activity
from its previous lifetime has passed out of existence on the interconnected
internet.

Since your program is building new circuits at a rate that exceeds 1/(2MSL),
then circuits are created at a rate faster than they pass out of existence,
and so you are bound to exhaust resources in your IP kernel eventually.

I am concurring with your desire to find the limits of the software during
testing, but note that any program that is building and tearing down TCP
circuits in a production system at too fast a rate can be very disruptive
for a number of reasons. 

>From your output it appears that the CA client library is appropriately
dealing with this situation, and is recovering once the systems temporary
resource starvation is eliminated.

Jeff


> -----Original Message-----
> From: [email protected] [mailto:[email protected]]
> Sent: Wednesday, January 28, 2004 4:27 PM
> To: [email protected]
> Subject: WINSOCK Error 10055
> 
> G'day all,
> 
> I've been running some longevity tests on my Windows 2000 (SP 3) EPICS
> environment in order to test some changes that I'm making to the MATLAB
> Channel Access (MCA) tool.  Basically, I've been opening a channel,
> doing
> some puts, closing the channel and repeating it over and over again.
> The
> IOC is running on a RedHat Linux 9.0 box.  I'm repeatedly finding that
> after opening and closing the same channel about 70000 times my
> application
> terminates with the following error:
> 
> "User specified timeout on IO operation expired"
> 
> In order to verify that this was not a problem introduced by me into MCA,
> I
> wrote the following little program and ran it again:
> 
> ************************************************************************
> ***************************
> #include "stdafx.h"
> #include "cadef.h"
> #include <iostream.h>
> 
> int main(int argc, char* argv[])
> {
> 
>       int status;
>       chid Chid;
>       double val;
> 
>       status = ca_context_create(ca_enable_preemptive_callback);
>       if (status != ECA_NORMAL) {
>             cout << ca_message(status);
>             cout.flush();
>             exit(1);
>       }
> 
>       for (int j = 1; j <= 100000; j++) {
> 
>             cout << j << "\n";
>             cout.flush();
> 
>             status = ca_create_channel("epicsadminHost:xxxExample", 0, 0,
> 0, &Chid);
>             if (status != ECA_NORMAL) {
>                   cout << ca_message(status);
>                   cout.flush();
>                   exit(1);
>             }
> 
>             status = ca_pend_io(1.0);
>             if (status != ECA_NORMAL) {
>                   cout << ca_message(status);
>                   cout.flush();
>                   exit(1);
>             }
> 
>             for (int i = 0; i <= 10; i++) {
> 
>                   val = (double) i;
> 
>                   status = ca_array_put(DBR_DOUBLE, 1, Chid, &val);
>                   if (status != ECA_NORMAL) {
>                         cout << ca_message(status);
>                         cout.flush();
>                         exit(1);
>                   }
> 
>                   status = ca_pend_io(1.0);
>                   if (status != ECA_NORMAL) {
>                         cout << ca_message(status);
>                         cout.flush();
>                         exit(1);
>                   }
>             }
> 
>             ca_clear_channel(Chid);
>             if (status != ECA_NORMAL) {
>                   cout << ca_message(status);
>                   cout.flush();
>                   exit(1);
>             }
>       }
> 
>       status = ca_task_exit();
>       if (status != ECA_NORMAL) {
>             cout << ca_message(status);
>             cout.flush();
>             exit(1);
>       }
> 
>       return 0;
> }
> ************************************************************************
> ***************************
> 
> This still terminated at around 70000 channels, but this time the error
> was
> a bit more informative:
> 
> Unable to connect because "WINSOCK Error 10055"
> CA.Client.Exception...............................................
>     Warning: "Virtual circuit disconnect"
>     Context: "asiocfs:5064"
>     Source File: ..\cac.cpp line 1515
>     Current Time: Wed Jan 28 2004 17:30:49.641727958
> ....................................................................
> User specified timeout on IO operation expired
> 
> After having looked around on the web for an explanation of the Winsock
> Error 10055, it seems that this may be caused by an application that
> "doesn't return system resources (such as memory) correctly."
> 
> I guess I have three questions.  Firstly, am I opening and closing the
> channel correctly in the above application, or is there some sort of
> additional call I need to make in order to close the channel completely?
> Secondly, is there something else I'm doing wrong or some incorrect
> assumption I'm making about the operation of EPICS on the Windows
> environment?  Thirdly, is this a bug in EPICS or Windows?
> 
> Cheers,
> 
> Steve Banks
> Australian Synchrotron Project
> Department of Infrastructure
> Level 18, 80 Collins Street
> Melbourne   VIC   3000
> tel:  +613 9655 6303
> fax:  +613 9655 8666
> web: www.synchrotron.vic.gov.au




References:
WINSOCK Error 10055 Steven . Banks

Navigate by Date:
Prev: WINSOCK Error 10055 Steven . Banks
Next: RE: WINSOCK Error 10055 Steven . Banks
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: WINSOCK Error 10055 Steven . Banks
Next: RE: WINSOCK Error 10055 Steven . Banks
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·