Tim Mooney has pointed out a problem with get_units.
The problem is as follows:
Many record types define EGU to have 16 characters.
The record support modules get_units routine executes the statement:
strncpy(units,prec->egu,sizeof(prec->egu));
Thus the record support module copies up to 16 characters.
However old and new database access only have 8 characters for units.
It turns out that getting units values via channel access NEVER overwrite
anything that is not updated AFTER the strings are copied. Thus the only
result is that channel access clients only get a max of 8 characters.
If 8 characters are obtained it probably is NOT null terminated.
I a database link asks for units info in a buffer that does not have
sufficient extra space after the DBRunits info bad things could happen.
No standard epics record/dev support asks for units info via database
options thus no problem can occur.
We can NOT change the sizes in old or new database access without recompiling
ALL Ca clients AND all ioc software. Thus we cant really do this until we
go to a new major release number of EPICS.
What we can do for now is to define a symbol MAX_UNITS_SIZE in dbDefs.h
and change all record support modules and ascii files to use this symbol.
Then when we go to next major EPICS release number we can just change
MAX_UNITS_SIZE and have everything automatically support units strings
of 16 characters.
Comments?
Marty Kraimer
- Navigate by Date:
- Prev:
Re: atomic updates of multiple fields possible? Tim Mooney
- Next:
Next Collaboration Meeting (etc...) Oct. 30th to Nov. 8th Bob Dalesio
- Index:
1994
<1995>
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: atomic updates of multiple fields possible? Tim Mooney
- Next:
Re: Engineering Units Tim Mooney
- Index:
1994
<1995>
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|