Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with scalar array. #56

Open
mrkraimer opened this issue Jul 19, 2017 · 2 comments
Open

Problem with scalar array. #56

mrkraimer opened this issue Jul 19, 2017 · 2 comments

Comments

@mrkraimer
Copy link
Contributor

In using PvaClientPut with the new no block feature there was a problem accessing a DBRecord
double array value.
What happens is that the array length is changed but the array elements are not changed.

This happens when the no block version of PvaClientPut accesses the field via provider pva.
It does NOT happen if provider ca is used.
It also does not happen if the blocking version of PvaClientPut is used.
Also the blocking version does work when accessing a PVRecord.

I have prepared a test case that demonstrates the problem.
It is in
https://github.com/mrkraimer/pvaSrvProblem

It has a README.html file that provides more details.

@mrkraimer
Copy link
Contributor Author

Note that the failure occurred when building via base-3.15.5
When building via base-3.14.12.5 the problem DOES NOT happen.

@mrkraimer
Copy link
Contributor Author

mrkraimer commented Aug 29, 2017

Issue #66 from pvAccessCPP provides additional information about this problem.
In particular it shows that the problem is a client that issues a ChannelPut::put without first issuing a ChannelPut::get. The problem exists for scalar array values.

For base 3.15.5
a put results in the array length being change but not the array elements.

For base base-3.16.1
a put results in the IOC crashing with a segmentation fault.

The issue#66 also shows a possible fix

The following change to pvaSrv fixes both the base 3.15 and 3.16 problems described above

mrk> pwd
/home/epicsv4/masterCPP/pvaSrv
mrk> git diff src/dbPv/3.15/dbPvPut.cpp
diff --git a/src/dbPv/3.15/dbPvPut.cpp b/src/dbPv/3.15/dbPvPut.cpp
index 02842b4..728996a 100644
--- a/src/dbPv/3.15/dbPvPut.cpp
+++ b/src/dbPv/3.15/dbPvPut.cpp
@@ -97,8 +97,17 @@ bool DbPvPut::init(PVStructure::shared_pointer const &pvRequest)
     }
     int numFields = pvStructure->getNumberFields();
     bitSet.reset(new BitSet(numFields));
+    dbScanLock(dbChannelRecord(dbPv->getDbChannel()));
+    Status status = dbUtil->get(
+        req,
+        propertyMask,
+        dbPv->getDbChannel(),
+        pvStructure,
+         bitSet,
+         0);
+    dbScanUnlock(dbChannelRecord(dbPv->getDbChannel()));
     if(req) req->channelPutConnect(
-       Status::Ok,
+       status,
        getPtrSelf(),
        pvStructure->getStructure());
     return true;
mrk> 

This may not be the best fix.
I will leave it to the pvaSrv owners to decide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant