caput doesn't report array overruns
Bug #1747983 reported by
Andrew Johnson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
Low
|
Andrew Johnson |
Bug Description
tux% caput -a doubleArray03 10 0 1 2 3 4 5 6 7 8 9
Old : doubleArray03 5 2.50321e-308 0 0 0 0
New : doubleArray03 5 2.50321e-308 0 0 0 0
tux% caget doubleArray03.NELM
doubleArray03.NELM 5
tux% caput -a doubleArray03 5 1 2 3 4 5
Old : doubleArray03 5 2.50321e-308 0 0 0 0
New : doubleArray03 5 1 2 3 4 5
The put fails because the array is smaller than the number of values I'm trying to send, but I get no error message to that effect.
Changed in epics-base: | |
status: | In Progress → Fix Committed |
Changed in epics-base: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Suggested fix:
diff --git a/src/ca/ client/ tools/caput. c b/src/ca/ client/ tools/caput. c client/ tools/caput. c client/ tools/caput. c result) ); io(caTimeout) ;
fprintf( stderr, "Write operation timed out: Data was not written.\n");
index 9c50cd9..5e4d10e 100644
--- a/src/ca/
+++ b/src/ca/
@@ -530,6 +530,11 @@ int main (int argc, char *argv[])
/* Use standard put with defined timeout */
result = ca_array_put (dbrType, count, pvs[0].chid, pbuf);
}
+ if (result != ECA_NORMAL) {
+ fprintf(stderr, "Error from put operation: %s\n", ca_message(
+ return 1;
+ }
+
result = ca_pend_
if (result == ECA_TIMEOUT) {
Suggested additional enhancement:
@@ -545,7 +550,7 @@ int main (int argc, char *argv[])
}
if (result != ECA_NORMAL) {
- fprintf(stderr, "Error occured writing data.\n");
+ fprintf(stderr, "Error occured writing data: %s\n", ca_message(result))
return 1;
}