Closed pallas closed 5 years ago
Actually, I'm missing something here and this causes the tests to fail.
Forcing wandiocat to flush iow resolves the test issue. However I don't yet know enough about the wandio semantics to understand why.
Ah, I see, there can be partial buffers here. Will update patch.
The latest patch fixes the uninitialized read with no changes to wandiocat and all the tests pass.
Merged into the develop branch (2b15037e696f10554a1c7788fa63a3b5ae33f23a).
Thanks very much for your PR :)
In thread_consumer, when we exit the inner loop because the program is over, the current buffer must be EMPTY; otherwise, we would have exited the inner loop normally. This EMPTY buffer is then passed to wandio_wwrite, where an uninitialized memory read occurs.
Instead, jump right to the cleanup after the inner loop.
Found with Valgrind.