Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-1056

Segfault in cbc create/H_collections_get_cid

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.0.0
    • 3.0.0-alpha2, 3.0.0-alpha4
    • library
    • None
    • 1

    Description

      Occurs on both 3.0.0-alpha3 and HEAD

      lldb) run create -U couchbase://10.143.193.101/default -u default -P password fredina --value wilma Process 44090 launched: '/usr/local/bin/cbc' (x86_64) Process 44090 stopped * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0) frame #0: 0x0000000100284a95 libcouchbase.2.dylib`H_collections_get_cid(pipeline=0x00000001011014b0, request=0x0000000103816200, response=0x00007ffeefbfd6e0, immerr=LCB_ETIMEDOUT) at handler.cc:916 913 resp.rflags |= LCB_RESP_F_FINAL; 914 915 const char *ptr = response->ext(); -> 916 memcpy(&resp.manifest_id, ptr, sizeof(uint64_t)); 917 resp.manifest_id = lcb_ntohll(resp.manifest_id); 918 ptr += sizeof(uint64_t); 919 memcpy(&resp.collection_id, ptr, sizeof(uint32_t)); Target 0: (cbc) stopped. (lldb) bt * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0) * frame #0: 0x0000000100284a95 libcouchbase.2.dylib`H_collections_get_cid(pipeline=0x00000001011014b0, request=0x0000000103816200, response=0x00007ffeefbfd6e0, immerr=LCB_ETIMEDOUT) at handler.cc:916 frame #1: 0x000000010027d91d libcouchbase.2.dylib`::mcreq_dispatch_response(pipeline=0x00000001011014b0, req=0x0000000103816200, res=0x00007ffeefbfd6e0, immerr=LCB_ETIMEDOUT) at handler.cc:1145 frame #2: 0x0000000100301c8a libcouchbase.2.dylib`lcb::Server::purge_single(this=0x00000001011014b0, pkt=0x0000000103816200, err=LCB_ETIMEDOUT) at mcserver.cc:697 frame #3: 0x00000001002fe35a libcouchbase.2.dylib`fail_callback(pipeline=0x00000001011014b0, pkt=0x0000000103816200, err=LCB_ETIMEDOUT, (null)=0x0000000000000000) at mcserver.cc:541 frame #4: 0x00000001001f5750 libcouchbase.2.dylib`mcreq_pipeline_timeout(pl=0x00000001011014b0, err=LCB_ETIMEDOUT, failcb=(libcouchbase.2.dylib`fail_callback(mc_pipeline_st*, mc_packet_st*, lcb_STATUS, void*) at mcserver.cc:540), cbarg=0x0000000000000000, oldest_valid=0, oldest_start=0x0000000000000000) at mcreq.c:916 frame #5: 0x00000001001f57f8 libcouchbase.2.dylib`mcreq_pipeline_fail(pl=0x00000001011014b0, err=LCB_ETIMEDOUT, failcb=(libcouchbase.2.dylib`fail_callback(mc_pipeline_st*, mc_packet_st*, lcb_STATUS, void*) at mcserver.cc:540), arg=0x0000000000000000) at mcreq.c:925 frame #6: 0x00000001002fe296 libcouchbase.2.dylib`lcb::Server::purge(this=0x00000001011014b0, error=LCB_ETIMEDOUT, thresh=0, next=0x0000000000000000, policy=REFRESH_ALWAYS) at mcserver.cc:709 frame #7: 0x00000001002ff534 libcouchbase.2.dylib`lcb::Server::socket_failed(this=0x00000001011014b0, err=LCB_ETIMEDOUT) at mcserver.cc:960 frame #8: 0x00000001002ff24a libcouchbase.2.dylib`lcb::Server::handle_connected(this=0x00000001011014b0, sock=0x0000000000000000, err=LCB_ETIMEDOUT, syserr=0) at mcserver.cc:822 frame #9: 0x00000001002ff591 libcouchbase.2.dylib`on_connected(sock=0x0000000000000000, data=0x00000001011014b0, err=LCB_ETIMEDOUT, syserr=0) at mcserver.cc:804 frame #10: 0x0000000100209580 libcouchbase.2.dylib`lcb::io::PoolRequest::invoke(this=0x0000000101102120) at manager.cc:312 frame #11: 0x00000001002098ce libcouchbase.2.dylib`lcb::io::PoolRequest::invoke(this=0x0000000101102120, err_=LCB_ETIMEDOUT) at manager.cc:150 frame #12: 0x0000000100207771 libcouchbase.2.dylib`lcb::io::PoolRequest::timer_handler(this=0x0000000101102120) at manager.cc:416 frame #13: 0x0000000100209a77 libcouchbase.2.dylib`lcb::io::Timer<lcb::io::PoolRequest, &(lcb::io::PoolRequest::timer_handler())>::cb(arg=0x0000000101102120) at timer-cxx.h:90 frame #14: 0x0000000100200e5d libcouchbase.2.dylib`timer_callback(sock=-1, which=1, arg=0x0000000101102170) at timer.c:43 frame #15: 0x0000000101210a49 libevent_core-2.1.6.dylib`event_process_active_single_queue + 1056 frame #16: 0x000000010120dc52 libevent_core-2.1.6.dylib`event_base_loop + 1068 frame #17: 0x00000001006da71e libcouchbase_libevent.dylib`lcb_io_run_event_loop(iops=0x0000000101002af0) at plugin-libevent.c:202 frame #18: 0x000000010031d45b libcouchbase.2.dylib`::lcb_wait(instance=0x0000000100702c70) at wait.cc:103 frame #19: 0x000000010000c1b7 cbc`cbc::SetHandler::run(this=0x0000000102000000) at cbc.cc:851 frame #20: 0x0000000100002d26 cbc`cbc::Handler::execute(this=0x0000000102000000, argc=10, argv=0x00007ffeefbff6d8) at cbc.cc:559 frame #21: 0x000000010002a090 cbc`main(argc=10, argv=0x00007ffeefbff6d8) at cbc.cc:2221 frame #22: 0x00007fff60df5015 libdyld.dylib`start + 1
          frame #20: 0x0000000100002d26 cbc`cbc::Handler::execute(this=0x0000000102000000, argc=10, argv=0x00007ffeefbff6d8) at cbc.cc:559                                                                            
          frame #21: 0x000000010002a090 cbc`main(argc=10, argv=0x00007ffeefbff6d8) at cbc.cc:2221             
          frame #22: 0x00007fff60df5015 libdyld.dylib`start + 1                                               
      (lldb) frame select 0                                                                                   
      frame #0: 0x0000000100284a95 libcouchbase.2.dylib`H_collections_get_cid(pipeline=0x00000001011014b0, request=0x0000000103816200, response=0x00007ffeefbfd6e0, immerr=LCB_ETIMEDOUT) at handler.cc:916           
         913      resp.rflags |= LCB_RESP_F_FINAL;                                                            
         914                                                                                                  
         915      const char *ptr = response->ext();                                                          
      -> 916      memcpy(&resp.manifest_id, ptr, sizeof(uint64_t));                                           
         917      resp.manifest_id = lcb_ntohll(resp.manifest_id);                                            
         918      ptr += sizeof(uint64_t);                                                                    
         919      memcpy(&resp.collection_id, ptr, sizeof(uint32_t));                                         
      (lldb) frame variable                                                                                   
      (mc_PIPELINE *) pipeline = 0x00000001011014b0                                                           
      (mc_PACKET *) request = 0x0000000103816200                                                              
      (lcb::MemcachedResponse *) response = 0x00007ffeefbfd6e0                                                
      (lcb_STATUS) immerr = LCB_ETIMEDOUT                                                                     
      (lcb_INSTANCE *) root = 0x0000000100702c70                                                              
      (ResponsePack<lcb_RESPGETCID_>) w = {                                                                   
        resp = {                                                                                              
          cookie = 0x0000000000000000                                                                         
          key = 0x0000000103816e30                                                                            
          nkey = 1                                                                                            
          cas = 0                                                                                             
          rc = LCB_ETIMEDOUT                                                                                  
          version = 0                                                                                         
          rflags = 3                                                                                          
          manifest_id = 0                                                                                     
          collection_id = 0                                                                                   
        }                                                                                                     
        mt = (uuid_ = 0, seqno_ = 0, vbid_ = 0)                                                               
        value = 0x0000000000000000                                                                            
        nvalue = 0                                                                                            
        err_ref = 0x0000000000000000                                                                          
        err_ctx = 0x0000000000000000                                                                          
      }                                                                                                       
      (lcb_RESPGETCID &) resp = 0x00007ffeefbfd240: {                                                         
        cookie = 0x0000000000000000                                                                           
        key = 0x0000000103816e30                                                                              
        nkey = 1                                                                                              
        cas = 0                                                                                               
        rc = LCB_ETIMEDOUT                                                                                    
        version = 0                                                                                           
        rflags = 3                                                                                            
        manifest_id = 0                                                                                       
        collection_id = 0                                                                                     
      }                                                                                                       
      (const char *) ptr = 0x0000000000000000                                       
      

      Will try with Valgrind in a second.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            avsej Sergey Avseyev
            Ellis.Breen Ellis Breen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty