Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  Index 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019 
<== Date ==> <== Thread ==>

Subject: Re: One CA server problem
From: Ralph Lange <lange@bii.bessy.de>
To: saa@slac.stanford.edu
Cc: tech-talk@aps.anl.gov (EPICS Tech-Talk)
Date: Thu, 2 Sep 1999 12:31:19 +0200 (METDST)
Hi Stephanie,

> Problem:   My server was freezing about once a week.  I tracked the problem
>            down to a rare bad status return from the select call in the process
>            function in the fdManager.cc file.  I have changed it so that 
>            all fd sets are zeroed and return is done if there is ANY bad status 
>            from select.  I have not seen the freeze since correcting this
>            problem though I'll continue monitoring.  Here is a snippet with 
>            the change for anyone interested:
>            [...]

Interesting.

We ran across a similar problem (freezing gateway) a few weeks ago. We
tracked it down to the CAS freezing if it was asked for a PV with
illegal characters (in this case: German umlauts) in the PV name.

I patched the CAS code to check every PV resolution request for illegal
characters replacing them by 'X's and we didn't see any freezing gateway 
anymore.

I attach a mail I sent to Jeff back then which contains my fix.

Ralph
>From lange Thu Jul 22 14:17:00 1999
Subject: CAS hangs on illegal PV names
To: johill@lanl.gov (Jeff Hill)
Date: Thu, 22 Jul 1999 14:17:00 +0200 (METDST)
Cc: jba@aps.anl.gov (Janet B. Anderson), mrk@aps.anl.gov (Marty Kraimer)
Bcc: rahn@bii.bessy.de (Joachim Rahn), birke@bii.bessy.de (Thomas Birke)
Organization: BESSY II, Berlin, Germany.
X-Mailer: ELM [version 2.4ME+ PL32 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length:  1608
Status: RO

Jeff,

I know you're about to leave for your vacation ... have fun!

Still I'd like you to know that we tracked down this thing and --- the
CAS really hangs if asked for a PV with some illegal control characters
in its name.

In our case the illegal names came from an ezca client. Additionally ezca
tries to reconnect to channels it doesn't find regularily for a long
time. So the client had to call for an illegal name only once to
repeatedly hang the gateway for days.

I have applied a fix to the CAS library I compile the gateway against
that provides a workaround (or a solution?) for the problem.

The file generic/casDGClient.cc (line 152 ff.) now looks like this:

//
// casDGClient::searchAction()
//
caStatus casDGClient::searchAction()
{
	const caHdr	*mp = this->ctx.getMsg();
	void		*dp = this->ctx.getData();
	char		*pChanName = (char *) dp;
	caStatus	status;

	static char* pv_allowed_chars = 
	   "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.:;<>[]_~";
	int ok;
	int len;

	if (this->ctx.getServer()->getDebugLevel()>2u) {
		char pName[64u];
		this->clientHostName (pName, sizeof (pName));
		printf("%s is searching for \"%s\"\n", pName, pChanName);
	}

	//
	// trap illegal characters here
	//
	len = strlen(pChanName);
	while ((ok = strspn(pChanName,pv_allowed_chars)) < len) {
		if (this->ctx.getServer()->getDebugLevel()>2u)
			printf("Illegal character at position %d replaced.\n", ok);
		pChanName[ok] = 'X';
	}


	//
	// verify that we have sufficent memory for a PV and a
	// monitor prior to calling PV exist test so that when
 ...


Enjoy your vacation!

Ralph


References:
One CA server question and one CA server problem saa

Navigate by Date:
Prev: Arrays and portable channel access server Tony Cox - (415)926-3105
Next: Re: One CA server question Ralph Lange
Index: 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019 
Navigate by Thread:
Prev: One CA server question and one CA server problem saa
Next: Re: One CA server question Ralph Lange
Index: 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019 
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 ·