There seems exist a bug with Ringbuffer in libCouchbase

14 views
Skip to first unread message

tianxing113

unread,
Apr 19, 2012, 2:44:15 AM4/19/12
to couchbase
Hi All:
I guess there exist a bug in the "ringbuffer_is_continous" function in the Ringbuffer.c
 
the source code lines are as follows:
 
if (buffer->read_head >= buffer->write_head) {
ptrdiff_t chunk = buffer->root + buffer->size - buffer->read_head;
 
if (buffer->nbytes > (libcouchbase_size_t)chunk) {    >>>> this line is confusing, I feel it should be the "nb" parameter instead of "buffer->nbytes"
ret = 0;
}
}
 
the same problem is for the "RINGBUFFER_WRITE" block as well.
 
 

Aslan Love

Sergey Avseyev

unread,
Apr 19, 2012, 9:47:01 AM4/19/12
to couc...@googlegroups.com
Hi. Thanks for report.

I've fixed the issue and submitted patch to review

http://review.couchbase.org/15023

2012/4/19 tianxing113 <tianx...@gmail.com>:

--
Sergey Avseyev

Reply all
Reply to author
Forward
0 new messages