Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-607

Segmentation Fault - Using durability with python3 SDK alpha3

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Test Blocker
    • Resolution: Fixed
    • 3.0.0-alpha.3
    • 3.0.0-alpha.4
    • library
    • None
    • 1

    Description

      from couchbase.cluster import Cluster
      from couchbase_core.cluster import PasswordAuthenticator
      from couchbase.durability import Durability
      try:
          cluster = Cluster('couchbase://10.112.190.101?enable_tracing=off')
          authenticator = PasswordAuthenticator('Administrator', 'password')
          cluster.authenticate(authenticator)
          cb = cluster.bucket('default')
          cb_coll=cb.default_collection()
          cb_coll.upsert('king_arthur', {'name': 'Arthur', 'email': 'kingarthur@couchbase.com', 'interests': ['Holy Grail', 'African Swallows']},durability_level=Durability.MAJORITY)
      except Exception as e:
          print (e)

      Expected Result - Upsert should happen
      Actual Result - Segmentation Fault

      Stack Trace here -

      Starting program: /root/pythonsdk/bin/python temp.py
      [Thread debugging using libthread_db enabled]
      Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
       
      Program received signal SIGSEGV, Segmentation fault.
      0x00000000005c20aa in PyObject_Call ()
      (gdb) bt
      #0  0x00000000005c20aa in PyObject_Call ()
      #1  0x0000000000534870 in PyEval_CallObjectWithKeywords ()
      #2  0x00007ffff3b897f8 in encode_common (src=src@entry=0x7ffff7e401c8, dst=dst@entry=0x7fffffffcf40, flags=<optimized out>) at src/convert.c:141
      #3  0x00007ffff3b8a715 in pycbc_tc_encode_value (conn=conn@entry=0x7ffff24ea748, srcbuf=0x7ffff7e401c8, srcflags=0x7ffff1e95870, dstbuf=dstbuf@entry=0x7fffffffcf40, dstflags=dstflags@entry=0x7fffffffcf04) at src/convert.c:479
      #4  0x00007ffff3b9cb01 in handle_single_kv (handler=handler@entry=0x0, collection=collection@entry=0x7fffffffd130, cv=cv@entry=0x7fffffffd0f0, optype=optype@entry=0, curkey=0x7ffff7e402f0, curvalue=0x7ffff7e401c8, options=0x0, 
          itm=0x0, arg=0x7fffffffd0c0, context=0xeb2920) at src/store.c:212
      #5  0x00007ffff3b9d656 in set_common (self=self@entry=0x7ffff24ea748, args=args@entry=0x7ffff0ee3a88, kwargs=kwargs@entry=0x7ffff09742c8, operation=operation@entry=3, argopts=argopts@entry=1, context=0xeb2920, 
          context@entry=0xeb1bd0) at src/store.c:416
      #6  0x00007ffff3b9db5f in pycbc_Bucket_upsert (self=0x7ffff24ea748, args=0x7ffff0ee3a88, kwargs=0x7ffff09742c8) at src/store.c:477
      #7  0x00000000004ea137 in PyCFunction_Call ()
      #8  0x00000000005c20e7 in PyObject_Call ()
      #9  0x00000000005348bd in PyEval_CallObjectWithKeywords ()
      #10 0x00000000004eeefc in ?? ()
      #11 0x00000000005c20e7 in PyObject_Call ()
      #12 0x0000000000538cab in PyEval_EvalFrameEx ()
      #13 0x0000000000540b0b in PyEval_EvalCodeEx ()
      #14 0x00000000004ec3f7 in ?? ()
      #15 0x00000000005c20e7 in PyObject_Call ()
      #16 0x0000000000538cab in PyEval_EvalFrameEx ()
      #17 0x000000000054124a in PyEval_EvalCodeEx ()
      #18 0x00000000004ec3f7 in ?? ()
      #19 0x00000000005c20e7 in PyObject_Call ()
      #20 0x0000000000538cab in PyEval_EvalFrameEx ()
      #21 0x0000000000540b0b in PyEval_EvalCodeEx ()
      #22 0x00000000004ec3f7 in ?? ()
      #23 0x00000000005c20e7 in PyObject_Call ()
      #24 0x0000000000538cab in PyEval_EvalFrameEx ()
      #25 0x000000000054124a in PyEval_EvalCodeEx ()
      #26 0x00000000004ec3f7 in ?? ()
      #27 0x00000000005c20e7 in PyObject_Call ()
      #28 0x0000000000538cab in PyEval_EvalFrameEx ()
      #29 0x000000000053fc97 in ?? ()
      #30 0x000000000053bc93 in PyEval_EvalFrameEx ()
      #31 0x000000000053fc97 in ?? ()
      #32 0x00000000005409bf in PyEval_EvalCode ()
      #33 0x000000000060cb42 in ?? ()
      #34 0x000000000060efea in PyRun_FileExFlags ()
      #35 0x000000000060f7dc in PyRun_SimpleFileExFlags ()
      #36 0x0000000000640256 in Py_Main ()
      #37 0x00000000004d0001 in main ()
      

      Attachments

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

        Activity

          ritam.sharma Ritam Sharma added a comment -

          (pythonsdk) root@node1-cb601-ubuntu16:~# valgrind --xml=yes --xml-file=arthur_valgrind.xml `which python` temp.py
          vex amd64->IR: unhandled instruction bytes: 0xF 0xC7 0xF0 0x89 0x6 0xF 0x42 0xC1
          vex amd64->IR: REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
          vex amd64->IR: VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F
          vex amd64->IR: PFX.66=0 PFX.F2=0 PFX.F3=0
          ==8306== valgrind: Unrecognised instruction at address 0xa043b15.
          ==8306== Your program just tried to execute an instruction that Valgrind
          ==8306== did not recognise. There are two possible reasons for this.
          ==8306== 1. Your program has a bug and erroneously jumped to a non-code
          ==8306== location. If you are running Memcheck and you just saw a
          ==8306== warning about a bad jump, it's probably your program's fault.
          ==8306== 2. The instruction is legitimate but Valgrind doesn't handle it,
          ==8306== i.e. it's Valgrind's fault. If you think this is the case or
          ==8306== you are not sure, please let us know and we'll try to fix it.
          ==8306== Either way, Valgrind will now raise a SIGILL signal which will
          ==8306== probably kill your program.
          Illegal instruction

          ritam.sharma Ritam Sharma added a comment - (pythonsdk) root@node1-cb601-ubuntu16:~# valgrind --xml=yes --xml-file=arthur_valgrind.xml `which python` temp.py vex amd64->IR: unhandled instruction bytes: 0xF 0xC7 0xF0 0x89 0x6 0xF 0x42 0xC1 vex amd64->IR: REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0 vex amd64->IR: VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F vex amd64->IR: PFX.66=0 PFX.F2=0 PFX.F3=0 ==8306== valgrind: Unrecognised instruction at address 0xa043b15. ==8306== Your program just tried to execute an instruction that Valgrind ==8306== did not recognise. There are two possible reasons for this. ==8306== 1. Your program has a bug and erroneously jumped to a non-code ==8306== location. If you are running Memcheck and you just saw a ==8306== warning about a bad jump, it's probably your program's fault. ==8306== 2. The instruction is legitimate but Valgrind doesn't handle it, ==8306== i.e. it's Valgrind's fault. If you think this is the case or ==8306== you are not sure, please let us know and we'll try to fix it. ==8306== Either way, Valgrind will now raise a SIGILL signal which will ==8306== probably kill your program. Illegal instruction
          Ellis.Breen Ellis Breen added a comment -

          I believe I've fixed this now - see http://review.couchbase.org/c/111805/

          Ellis.Breen Ellis Breen added a comment - I believe I've fixed this now - see  http://review.couchbase.org/c/111805/

          People

            Ellis.Breen Ellis Breen
            ritam.sharma Ritam Sharma
            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