-
Notifications
You must be signed in to change notification settings - Fork 143
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
Added test to show weird behaviour with small output buffers. #29
Conversation
Backported from my CMake-based branch.
Thanks. Is there already a bug for this? Are you saying this fails for some parameter values? |
Hi, uuh I don't think there is a bug for this, Smallest test case fails, Biggest test case that fails is where the These numbers are just picked out of the air by me, This patch has a script you can use to compile and run, you can see the parameters in the shell script there. I also have a patch on top of my cmake system, but for the base rsync, the procedure is: git checkout -b issue-small-output paulharris/issue-small-output To run the small testcase, for example, its: output for small: Show success (just a bigger initial buffer): |
Thanks. Is there already a bug for this? Are you saying this fails for some parameter values? |
strange, I see the same comment of yours twice. btw I am not sure how I go about making a bug and attaching this pull request... |
So it looks like this has the test driver in the tree, but not run by cmake (probably because this was backported), and it feels like tests that aren't hooked in will just rot. I'm glad you wrote this but it might be better to leave it attached to the bug until the bug itself is fixed, rather than merging in either a failing or not-running state. |
rs_buffers_t buf; | ||
buf.next_out = outbuf; | ||
buf.avail_out = start; | ||
buf.next_in = (char*)(in); // TODO why is this not const void* ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving all the data pointers to void*
would be a worthwhile separate change, but probably counts as an API break.
I'm also going to close the PR and leave the bug open until we have a fix. Thanks again. |
Backported from my CMake-based branch.
I see issues when the output buffer is too small.
librsync.h indicates I should increase the buffer size and reexecute, but that seems to be buggy.
Here is a test, the parameters control the input size, the initial output buffer size, and the output buffer growth rate (additive).
Its quite easy to allocate too-small a buffer, and as the input size goes up, it seems that the minimum required output buffer sizes also change.