EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  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  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Asyn/VXI-11 problems
From: Eric Norum <[email protected]>
To: [email protected]
Cc: TECHTALK tech-talk <[email protected]>
Date: Fri, 21 Sep 2007 08:54:21 -0500
On Sep 21, 2007, at 8:36 AM, Benjamin Franksen wrote:

On Friday 21 September 2007 12:30, Benjamin Franksen wrote:
I have not produced a fix for this problem. I guess you (Eric) know
better how to approach this.

Well, my current, very crude, solution is to replace all (seven) clnt_destroy calls by

    if (pvxiPort->rpcClient) {
        clnt_destroy(pvxiPort->rpcClient);
        pvxiPort->rpcClient = 0;
    } else {
        if(pasynUser) asynPrint(pasynUser,ASYN_TRACE_ERROR,
            "%s internal error: RPC handle already
destroyed\n",pvxiPort->portName);
    }


Would an alternative fix be to change all the clnt_destroy calls in vxiConnectPort to:
@@ -933,7 +934,8 @@
"%s vxiConnectPort neither system controller nor "
"controller in charge -- initialization aborted \n",
pvxiPort->portName);
- clnt_destroy(pvxiPort->rpcClient);
+ if (pvxiPort->server.connected)
+ vxiDisconnectPort(pvxiPort);
return asynError;
}
}


In fact I can see the above 'internal error' messages appearing when I run
our test setup.


There is yet another problem: the error checking after calls to clnt_call si
wrong. The code is


    if(stat!=RPC_SUCCESS || errno!=0) {
    	/* error handling */
	}

which leads to pseudo errors; errno should be checked only if the return
value is abnormal. It should be just


    if(stat!=RPC_SUCCESS) {
    	/* error handling */
	}

Both the places where this code appears are preceded by assignments of 0 to errno. The fact that this was done makes me think that the code was placed there for a reason. There appear to be several substandard versions of RPC libraries out there.



Also, the error message should not output the numerical value of errno, but
the number converted to a string (via strerror) as is done in all other
parts of the file.

I agree and will change all the appropriate code to use strerror (errno) rather than just errno in the error messages.



Cheers Ben

-- Eric Norum <[email protected]> Advanced Photon Source Argonne National Laboratory (630) 252-4793



Replies:
Re: Asyn/VXI-11 problems Andrew Johnson
Re: Asyn/VXI-11 problems Benjamin Franksen
References:
Asyn/VXI-11 problems Benjamin Franksen
Re: Asyn/VXI-11 problems Eric Norum
Re: Asyn/VXI-11 problems Benjamin Franksen
Re: Asyn/VXI-11 problems Benjamin Franksen

Navigate by Date:
Prev: Re: Asyn/VXI-11 problems Benjamin Franksen
Next: Re: Asyn/VXI-11 problems Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Asyn/VXI-11 problems Benjamin Franksen
Next: Re: Asyn/VXI-11 problems Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·