-
Notifications
You must be signed in to change notification settings - Fork 318
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
Different behaviour (local vs remote) when an iio attribute read causes buffer overflow #357
Comments
Which is the expectation/intended algorithm?(@pcercuei ?)
If I look at other things...
the iio_*_read functions are like:
There is no mention of zero indicates buffer is full, and more data is there... ?? |
While it should be easy to support returning a partial buffer, I believe the behaviour should be an error code, since the attribute is not a stream (two consecutive reads will return the same data from the beginning of the attribute file) and we have no way to tell that we're getting a partial buffer. Since this is not really ABI right now (as the behaviour is different across backends) maybe we can change it to -EFBIG, which would be a bit more descriptive and easier to discern versus the other communication errors. |
Is the error:
We already use As long as it means the same thing in all places - it should be fine... Thanks |
We have other issues with usb... causing this error, but setting
with ip context, we get the error (
with the usb context, after the error - the context is un-usable.
with local, we get a partial buffer read...
which we know is wrong, since So three different backends - three different results :( |
looks like the usb backend bug has always been there (so at least it is not a regression). |
Fix #357 If a target buffer is too small, right now, we try to put a partial fill in the buffer, and return sucess (which is wrong). Now we will return EFBIG, and leave the target buffer empty. This will make the local backends the same as the otherbackends. Signed-off-by: Robin Getz <[email protected]>
Fix #357 If a target buffer is too small, right now, we try to put a partial fill in the buffer, and return sucess (which is wrong). Now we will return EFBIG, and leave the target buffer empty. This will make the local backends the same as the otherbackends. Signed-off-by: Robin Getz <[email protected]>
Suppose one wants to read an iio attribute but doesn't provide enough space for the buffer where the content of the attribute will be read:
This inconsistency has been found while investigating bug: #268
The text was updated successfully, but these errors were encountered: