Closed ztdwu closed 8 years ago
The error seems to happen when the external process's output length is less than put_back_size
, which defaults to 8. If we change put_back_size
to 1, then the invalid read
error is gone in both cases. Of course, we would want to find some way to keep being able to memmove in chunks of 8 bytes or so without running into that error.
I'm not very familiar with the code and the streambuf API. Is there a easy way to check whether the input source contains less than put_back_size
bytes left?
Fixed by PR #5
There seems to be an illegal memory access in the "toy" example in the README. This happens under both clang++ and g++. The test file
test.cpp
Valgrind output:
ASAN output:
There also seems to be a lot of implicit integer conversions going on, which may or may not be related to this issue:
EDIT: Minimalist example:
ASAN: