Closed dougnazar closed 2 years ago
At the time of the crash, the relevant fields were:
data_size = 4056
decoder->stream_buffer_read_offset = 0
decoder->stream_buffer_write_offset = 16777216
decoder->stream_buffer_fill_level = 0
decoder->stream_buffer_size = 16777216
Can take between a couple days & a couple weeks to show up.
I also didn't see anything synchronizing access to those fields. Did I miss something?
Good catch, thanks. As for synchronization, do you mean thread sync? The API is not designed to be thread safe.
With the right timing, it's possible to have the read side all caught up and the write side at the end of the buffer. This will cause the
memmove()
to move0
bytes and the write offset to be reduced by0
, leading to aSIGSEGV
in thememcpy()
as we try to write after the buffer.Signed-off-by: Doug Nazar nazard@nazar.ca