Details
-
Bug
-
Resolution: Fixed
-
Critical
-
2.0.6, 2.1.3
-
Security Level: Public
-
None
-
CentOS 6.4 x86_64;
couchbase-server-2.1.1-764.x86_64
libcouchbase-devel-2.0.6-1.x86_64
libcouchbase2-core-2.0.6-1.x86_64
libcouchbase-debuginfo-2.0.6-1.x86_64
libcouchbase2-libevent-2.0.6-1.x86_64
libcouchbase2-2.0.6-1.x86_64
patch ofCCBC-274
Description
With the fix I provided for CCBC-274, stability of libcouchbase C client is much better in situations where a CB server is stopped. However, we still get incidental crashes on either stopping a server or timeout due to high load on the system.
Program terminated with signal 6, Aborted(gdb) where
#0 0x00007f7407bbf8e5 in raise () from /lib64/libc.so.6
#1 0x00007f7407bc10c5 in abort () from /lib64/libc.so.6
#2 0x00007f740997269a in ringbuffer_consumed (buffer=<value optimized out>, nb=41) at src/ringbuffer.c:263
#3 0x00007f7409973c5c in lcb_purge_single_server (server=0x7f73b0002208, error=LCB_ETIMEDOUT) at src/server.c:338
#4 0x00007f74099758d1 in lcb_server_timeout_handler (sock=<value optimized out>, which=<value optimized out>, arg=<value optimized out>) at src/timeout.c:38
#5 0x00007f7409b8cb44 in event_base_loop () from /usr/lib64/libevent-1.4.so.2
#6 0x000000000046e476 in con_thr (arg=0x1471218) at src/store_couchbase.c:2659
#7 0x00007f7407f27851 in start_thread () from /lib64/libpthread.so.0
#8 0x00007f7407c7594d in clone () from /lib64/libc.so.6
(gdb) up
#1 0x00007f7407bc10c5 in abort () from /lib64/libc.so.6
(gdb) up
#2 0x00007f740997269a in ringbuffer_consumed (buffer=<value optimized out>, nb=41) at src/ringbuffer.c:263
263 src/ringbuffer.c: No such file or directory.
in src/ringbuffer.c
(gdb) p n
$2 = 0
(gdb) up
#3 0x00007f7409973c5c in lcb_purge_single_server (server=0x7f73b0002208, error=LCB_ETIMEDOUT) at src/server.c:338
338 src/server.c: No such file or directory.
in src/server.c
(gdb) p req
$1 = {request =
,
bytes = "\200\224\000\r\004\000\001\314\000\000\000\021y\221\024\000\000\000\000\000\000\000\000"}
336 ringbuffer_consumed(stream, packetsize);
337 if (mirror)
So the crash is caused by the following abort in ringbuffer_consumed() :
lcb_size_t n = ringbuffer_read(buffer, NULL, nb);
if (n != nb)
(n = 0, nb = 41)
Apparently, ringbuffer_read() returning 0 instead of the number of expected bytes is possible in some situations and should not trigger an abort.
Attachments
For Gerrit Dashboard: CCBC-275 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
29671,4 | CCBC-275: Do a full purge when negotiation times out | master | libcouchbase | Status: MERGED | +2 | +1 |
29690,2 | Check subsequent functionality in CCBC-275 test | master | libcouchbase | Status: MERGED | +2 | +1 |
32880,10 | CCBC-275: Test shouldn't assume internal server state | master | libcouchbase | Status: ABANDONED | 0 | 0 |