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

python SDK crashes on MAC while inserting a document.

    XMLWordPrintable

Details

    • 1

    Description

      Python SDK crashes on Mac, while inserting a document. Consistently reproducible on my box.
      Python install via brew and pyenv

      Process:               Python [10462]
      Path:                  /usr/local/Cellar/python@3.7/3.7.10_3/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
      Identifier:            Python
      Version:               3.7.10 (3.7.10)
      Code Type:             X86-64 (Native)
      Parent Process:        Python [10461]
      Responsible:           Terminal [3651]
      User ID:               501
       
      Date/Time:             2021-05-21 15:13:27.865 +0530
      OS Version:            Mac OS X 10.15.7 (19H1030)
      Report Version:        12
      Bridge OS Version:     5.3 (18P4556)
      Anonymous UUID:        36633EF3-B588-43D2-B4E2-68CF41F0E690
       
      Sleep/Wake UUID:       7B06E3A7-6152-4C14-81FB-E3E4BEB72D5E
       
      Time Awake Since Boot: 16000 seconds
      Time Since Wake:       1000 seconds
       
      System Integrity Protection: enabled
       
      Crashed Thread:        1
       
      Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
      Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
      Exception Note:        EXC_CORPSE_NOTIFY
       
      Termination Signal:    Segmentation fault: 11
      Termination Reason:    Namespace SIGNAL, Code 0xb
      Terminating Process:   exc handler [10462]
       
      VM Regions Near 0:
      --> 
          __TEXT                 00000001057c4000-00000001057c8000 [   16K] r-x/r-x SM=COW  /usr/local/Cellar/python@3.7/3.7.10_3/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
       
      Application Specific Information:
      crashed on child side of fork pre-exec
       
      Thread 0:: Dispatch queue: com.apple.main-thread
      0   libsystem_kernel.dylib        	0x00007fff727a3882 __psynch_cvwait + 10
      1   libsystem_pthread.dylib       	0x00007fff72864425 _pthread_cond_wait + 698
      2   org.python.python             	0x00000001058b3cf9 PyThread_acquire_lock_timed + 368
      3   org.python.python             	0x00000001058ebca4 acquire_timed + 104
      4   org.python.python             	0x00000001058eba67 lock_PyThread_acquire_lock + 44
      5   org.python.python             	0x00000001057f0c0e _PyMethodDef_RawFastCallKeywords + 534
      6   org.python.python             	0x00000001057f5421 _PyMethodDescr_FastCallKeywords + 81
      7   org.python.python             	0x0000000105885ca3 call_function + 782
      8   org.python.python             	0x00000001058831c8 _PyEval_EvalFrameDefault + 25563
      9   org.python.python             	0x000000010588650f _PyEval_EvalCodeWithName + 1863
      10  org.python.python             	0x00000001057f0132 _PyFunction_FastCallKeywords + 222
      11  org.python.python             	0x0000000105885c76 call_function + 737
      12  org.python.python             	0x00000001058831c8 _PyEval_EvalFrameDefault + 25563
      13  org.python.python             	0x000000010588650f _PyEval_EvalCodeWithName + 1863
      14  org.python.python             	0x00000001057f0132 _PyFunction_FastCallKeywords + 222
      15  org.python.python             	0x0000000105885c76 call_function + 737
      16  org.python.python             	0x000000010588333f _PyEval_EvalFrameDefault + 25938
      17  org.python.python             	0x000000010588650f _PyEval_EvalCodeWithName + 1863
      18  org.python.python             	0x00000001057f0132 _PyFunction_FastCallKeywords + 222
      19  org.python.python             	0x0000000105885c76 call_function + 737
      20  org.python.python             	0x000000010588333f _PyEval_EvalFrameDefault + 25938
      21  org.python.python             	0x00000001057f053e function_code_fastcall + 106
      22  org.python.python             	0x0000000105885c76 call_function + 737
      23  org.python.python             	0x0000000105883288 _PyEval_EvalFrameDefault + 25755
      24  org.python.python             	0x00000001057f053e function_code_fastcall + 106
      25  org.python.python             	0x0000000105885c76 call_function + 737
      26  org.python.python             	0x0000000105883288 _PyEval_EvalFrameDefault + 25755
      27  org.python.python             	0x00000001057f053e function_code_fastcall + 106
      28  org.python.python             	0x0000000105885c76 call_function + 737
      29  org.python.python             	0x0000000105883288 _PyEval_EvalFrameDefault + 25755
      30  org.python.python             	0x000000010588650f _PyEval_EvalCodeWithName + 1863
      31  org.python.python             	0x000000010587cd4a PyEval_EvalCode + 51
      32  org.python.python             	0x00000001058ab4d5 run_mod + 54
      33  org.python.python             	0x00000001058aa4fa PyRun_FileExFlags + 160
      34  org.python.python             	0x00000001058a9bb8 PyRun_SimpleFileExFlags + 276
      35  org.python.python             	0x00000001058c2250 pymain_main + 4969
      36  org.python.python             	0x00000001058c29e8 _Py_UnixMain + 56
      37  libdyld.dylib                 	0x00007fff7265fcc9 start + 1
       
      Thread 1 Crashed:
      0   org.python.python             	0x000000010580fa29 insertdict + 23
      1   _libcouchbase.cpython-37m-darwin.so	0x0000000107c037af pycbc_dict_add_text_kv_strn2 + 79
      2   _libcouchbase.cpython-37m-darwin.so	0x0000000107bf4f4a pycbc_convert_kv_error_context + 266
      3   _libcouchbase.cpython-37m-darwin.so	0x0000000107bf51b6 get_operation_err_info + 310
      4   _libcouchbase.cpython-37m-darwin.so	0x0000000107bf5bde operation_completed_with_err_info + 30
      5   _libcouchbase.cpython-37m-darwin.so	0x0000000107bf6e49 dur_chain2 + 361
      6   _libcouchbase.cpython-37m-darwin.so	0x0000000107bf5f23 durability_chain_common + 147
      7   libcouchbase.2.dylib          	0x0000000107c8d059 void invoke_callback<lcb_RESPSTORE_>(mc_packet_st const*, lcb_st*, lcb_RESPSTORE_*, lcb_CALLBACK_TYPE) + 281
      8   libcouchbase.2.dylib          	0x0000000107c89f0e mcreq_dispatch_response + 3550
      9   libcouchbase.2.dylib          	0x0000000107cc0d1d lcb::Server::try_read(lcbio_CTX*, rdb_IOROPE*) + 589
      10  libcouchbase.2.dylib          	0x0000000107cc2b8e on_read(lcbio_CTX*, unsigned int) + 62
      11  libcouchbase.2.dylib          	0x0000000107c61cae E_handler(int, short, void*) + 510
      12  libcouchbase.2.dylib          	0x0000000107c4c7d5 run_loop + 1285
      13  libcouchbase.2.dylib          	0x0000000107ccff3d lcb_wait + 141
      14  _libcouchbase.cpython-37m-darwin.so	0x0000000107c0d12f pycbc_common_vars_wait + 191
      15  _libcouchbase.cpython-37m-darwin.so	0x0000000107c104da set_common + 1002
      16  _libcouchbase.cpython-37m-darwin.so	0x0000000107c10946 pycbc_Bucket_insert + 86
      17  org.python.python             	0x00000001057f07fc _PyMethodDef_RawFastCallDict + 520
      18  org.python.python             	0x00000001057f55c4 methoddescr_call + 87
      19  org.python.python             	0x00000001057f0277 PyObject_Call + 136
      20  org.python.python             	0x00000001058834d5 _PyEval_EvalFrameDefault + 26344
      21  org.python.python             	0x000000010588650f _PyEval_EvalCodeWithName + 1863
      22  org.python.python             	0x00000001057efda0 _PyFunction_FastCallDict + 444
      23  org.python.python             	0x00000001058834d5 _PyEval_EvalFrameDefault + 26344
      24  org.python.python             	0x000000010588650f _PyEval_EvalCodeWithName + 1863
      25  org.python.python             	0x00000001057efda0 _PyFunction_FastCallDict + 444
      26  org.python.python             	0x00000001058834d5 _PyEval_EvalFrameDefault + 26344
      27  org.python.python             	0x000000010588650f _PyEval_EvalCodeWithName + 1863
      28  org.python.python             	0x00000001057f0132 _PyFunction_FastCallKeywords + 222
      29  org.python.python             	0x0000000105885c76 call_function + 737
      30  org.python.python             	0x000000010588333f _PyEval_EvalFrameDefault + 25938
      31  org.python.python             	0x000000010588650f _PyEval_EvalCodeWithName + 1863
      32  org.python.python             	0x00000001057f0132 _PyFunction_FastCallKeywords + 222
      33  org.python.python             	0x0000000105885c76 call_function + 737
      34  org.python.python             	0x000000010588333f _PyEval_EvalFrameDefault + 25938
      35  org.python.python             	0x00000001057f053e function_code_fastcall + 106
      36  org.python.python             	0x0000000105885c76 call_function + 737
      37  org.python.python             	0x0000000105883288 _PyEval_EvalFrameDefault + 25755
      38  org.python.python             	0x000000010588650f _PyEval_EvalCodeWithName + 1863
      39  org.python.python             	0x00000001057efda0 _PyFunction_FastCallDict + 444
      40  org.python.python             	0x00000001057f0ea3 _PyObject_Call_Prepend + 131
      41  org.python.python             	0x00000001057f0277 PyObject_Call + 136
      42  org.python.python             	0x00000001058834d5 _PyEval_EvalFrameDefault + 26344
      43  org.python.python             	0x000000010588650f _PyEval_EvalCodeWithName + 1863
      44  org.python.python             	0x00000001057efda0 _PyFunction_FastCallDict + 444
      45  org.python.python             	0x00000001057f0ea3 _PyObject_Call_Prepend + 131
      46  org.python.python             	0x000000010582dac6 slot_tp_call + 71
      47  org.python.python             	0x00000001057effd6 _PyObject_FastCallKeywords + 358
      48  org.python.python             	0x0000000105885c6f call_function + 730
      49  org.python.python             	0x0000000105883288 _PyEval_EvalFrameDefault + 25755
      50  org.python.python             	0x00000001057f053e function_code_fastcall + 106
      51  org.python.python             	0x00000001057f0ea3 _PyObject_Call_Prepend + 131
      52  org.python.python             	0x00000001057f0277 PyObject_Call + 136
      53  org.python.python             	0x00000001058834d5 _PyEval_EvalFrameDefault + 26344
      54  org.python.python             	0x00000001057f053e function_code_fastcall + 106
      55  org.python.python             	0x0000000105885c76 call_function + 737
      56  org.python.python             	0x00000001058831c8 _PyEval_EvalFrameDefault + 25563
      57  org.python.python             	0x00000001057f053e function_code_fastcall + 106
      58  org.python.python             	0x0000000105885c76 call_function + 737
      59  org.python.python             	0x00000001058831c8 _PyEval_EvalFrameDefault + 25563
      60  org.python.python             	0x00000001057f053e function_code_fastcall + 106
      61  org.python.python             	0x00000001057f0ea3 _PyObject_Call_Prepend + 131
      62  org.python.python             	0x00000001057f0277 PyObject_Call + 136
      63  org.python.python             	0x00000001058ec3c1 t_bootstrap + 71
      64  org.python.python             	0x00000001058b39bd pythread_wrapper + 25
      65  libsystem_pthread.dylib       	0x00007fff72864109 _pthread_start + 148
      66  libsystem_pthread.dylib       	0x00007fff7285fb8b thread_start + 15
       
      Thread 2:
      0   libsystem_kernel.dylib        	0x00007fff727a90fe __select + 10
      1   org.python.python             	0x00000001058ea16b time_sleep + 116
      2   org.python.python             	0x00000001057f0c39 _PyMethodDef_RawFastCallKeywords + 577
      3   org.python.python             	0x00000001057f016a _PyCFunction_FastCallKeywords + 41
      4   org.python.python             	0x0000000105885c09 call_function + 628
      5   org.python.python             	0x00000001058831e1 _PyEval_EvalFrameDefault + 25588
      6   org.python.python             	0x00000001057f053e function_code_fastcall + 106
      7   org.python.python             	0x0000000105885c76 call_function + 737
      8   org.python.python             	0x00000001058831c8 _PyEval_EvalFrameDefault + 25563
      9   org.python.python             	0x00000001057f053e function_code_fastcall + 106
      10  org.python.python             	0x0000000105885c76 call_function + 737
      11  org.python.python             	0x00000001058831c8 _PyEval_EvalFrameDefault + 25563
      12  org.python.python             	0x00000001057f053e function_code_fastcall + 106
      13  org.python.python             	0x00000001057f0ea3 _PyObject_Call_Prepend + 131
      14  org.python.python             	0x00000001057f0277 PyObject_Call + 136
      15  org.python.python             	0x00000001058ec3c1 t_bootstrap + 71
      16  org.python.python             	0x00000001058b39bd pythread_wrapper + 25
      17  libsystem_pthread.dylib       	0x00007fff72864109 _pthread_start + 148
      18  libsystem_pthread.dylib       	0x00007fff7285fb8b thread_start + 15
      

      Attachments

        Issue Links

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

          Activity

            jared.casey Jared Casey added a comment -

            Hmmm, if you run it multiple times, do all runs work? It is easily repeatable, but only fails intermittently.

            jared.casey Jared Casey added a comment - Hmmm, if you run it multiple times, do all runs work? It is easily repeatable, but only fails intermittently.

            Ran the script ~15 times - seems to be working consistently

            arunkumar Arunkumar Senthilnathan (Inactive) added a comment - Ran the script ~15 times - seems to be working consistently
            jared.casey Jared Casey added a comment -

            Thanks Arunkumar Senthilnathan. That is quite interesting. I suppose the nature of what is going on w/ LCB and the Python bindings could mean that its possible you would not run into an issue. To know for sure some gdb output would be useful (see info I provided in CCBC-1412, specifically ctx->scope and ctx->collection). However, I think this has been repeated enough (not just myself and Ritam, see PYCBC-1131 also), so I don't think the gdb output is necessary.

            jared.casey Jared Casey added a comment - Thanks Arunkumar Senthilnathan . That is quite interesting. I suppose the nature of what is going on w/ LCB and the Python bindings could mean that its possible you would not run into an issue. To know for sure some gdb output would be useful (see info I provided in CCBC-1412 , specifically ctx->scope and ctx->collection). However, I think this has been repeated enough (not just myself and Ritam, see PYCBC-1131 also), so I don't think the gdb output is necessary.

            Jared Casey - I had done this for 1000 time in a loop. Matt Ingenthron - I am using the LCB_TAG. I also ran my original test where I was seeing fail and it works well now.

            ritam.sharma Ritam Sharma added a comment - Jared Casey - I had done this for 1000 time in a loop. Matt Ingenthron - I am using the LCB_TAG. I also ran my original test where I was seeing fail and it works well now.
            jared.casey Jared Casey added a comment -

            This should be fixed in the 3.1.3 release of the Python SDK (ideally release is later this week). In the interim, the more concise pip install command below can be used.

            LCB_TAG=3.1.4 python3 -m pip install couchbase
            

            jared.casey Jared Casey added a comment - This should be fixed in the 3.1.3 release of the Python SDK (ideally release is later this week). In the interim, the more concise pip install command below can be used. LCB_TAG=3.1.4 python3 -m pip install couchbase

            People

              jared.casey Jared Casey
              ritam.sharma Ritam Sharma
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty