Skip to content

ringbuffer_memcpy coredump #4

@kijamve

Description

@kijamve

(gdb) bt
#0 0x0043e416 in __kernel_vsyscall ()
#1 0x417ec0ef in raise () from /lib/libc.so.6
#2 0x417eda25 in abort () from /lib/libc.so.6
#3 0x417e4ce5 in __assert_fail_base () from /lib/libc.so.6
#4 0x417e4d97 in __assert_fail () from /lib/libc.so.6
#5 0x00be3e31 in libcouchbase_ringbuffer_memcpy (dst=0xbfa01a6c, src=0x89ae74c, nbytes=48) at src/ringbuffer.c:353
#6 0x00be40c7 in libcouchbase_purge_single_server (server=0x89ae728, stream=0x89ae760, cookies=0x89ae774, tmo=0,

now=1332454861175974001, error=LIBCOUCHBASE_NETWORK_ERROR) at src/server.c:77

#7 0x00be48bf in libcouchbase_failout_server (server=0x89ae728, error=LIBCOUCHBASE_NETWORK_ERROR) at src/server.c:259
#8 0x00bdd7a3 in do_fill_input_buffer (c=0x89ae728) at src/event.c:46
#9 0x00bddf3b in do_read_data (c=0x89ae728) at src/event.c:232
#10 0x00bde0e3 in libcouchbase_server_event_handler (sock=8, which=6, arg=0x89ae728) at src/event.c:292
#11 0x0066fc09 in event_process_active_single_queue (activeq=, base=) at event.c:1325
#12 event_process_active (base=) at event.c:1392
#13 event_base_loop (base=0x8985010, flags=0) at event.c:1589
#14 0x00c260f5 in libcouchbase_io_run_event_loop (iops=0x8984f88) at src/plugin-libevent.c:312
#15 0x00be812b in libcouchbase_wait (instance=0x8985328) at src/wait.c:91
#16 0x08049fc9 in main () at test-gen.c:500

(gdb) list 354
349 }
350
351 libcouchbase_ringbuffer_get_iov(dst, RINGBUFFER_WRITE, iov);
352 do {
353 assert(ii < 2);
354 towrite -= libcouchbase_ringbuffer_read(&copy, iov[ii].iov_base,
355 iov[ii].iov_len);
356 ++ii;
357 } while (towrite > 0);
358 libcouchbase_ringbuffer_produced(dst, nbytes);
(gdb) print towrite
$6 = 4294966320
(gdb) print ii
$7 = 2

libcouchbase_size_t towrite = nbytes; // nbytes = 48
..
libcouchbase_ringbuffer_read return 1024!!!
towrite= 48 - 1024? // PD: towrite is unsigned.

Does the result is about 4294966320? and while (towrite > 0); .... crash => assert(ii < 2)!...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions