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

asyncio await on_connect crash with ev->state != PYCBC_EVSTATE_ACTIVE when using SSL

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.3, 3.2.4
    • 3.2.5
    • library
    • None
    • Reproduced on macOS and Linux
    • 1
    • High

    Description

      A crash results with the following error when using Python asyncio and SSL ("couchbases" scheme) to connect to Couchbase. The error does not occur and everything works normally when using a non-SSL connection (using either the "http" or "couchbase" scheme).

      Error:

      python-couchbase: ev->state != PYCBC_EVSTATE_ACTIVE at src/iops.c:505. Abort

      The attached program can be used to reproduce the error.

      Environment (macOS):

      michaelminichino@Michaels-MacBook-Pro-2 cbperf-container % cbc version
      cbc:
        Runtime: Version=3.2.3, Changeset=b3294247961261db72fe6f0d413b8f972a59047d
        Headers: Version=3.2.3, Changeset=b3294247961261db72fe6f0d413b8f972a59047d
        Build Timestamp: 2021-10-20 11:58:16
        CMake Build Type: Release
        Default plugin directory: /usr/local/Cellar/libcouchbase/3.2.3/lib/libcouchbase
        IO: Default=libevent, Current=libevent, Accessible=libevent,libuv,libev,select
        SSL Runtime: OpenSSL 1.1.1l  24 Aug 2021
        SSL Headers: OpenSSL 1.1.1l  24 Aug 2021
        Snappy: 1.1.8
        Tracing: SUPPORTED
        System: Darwin-21.1.0; x86_64
        CC: AppleClang 13.0.0.13000029;  -fno-strict-aliasing -ggdb3 -pthread
        CXX: AppleClang 13.0.0.13000029;  -fno-strict-aliasing -ggdb3 -pthread
      michaelminichino@Michaels-MacBook-Pro-2 cbperf-container % pip3 |grep couchbase
      michaelminichino@Michaels-MacBook-Pro-2 cbperf-container % pip3 list |grep couchbase
      couchbase          3.2.4

      Environment (Linux):

      [admin@uxadm01 ~]$ cbc version
      cbc:
        Runtime: Version=3.2.3, Changeset=b3294247961261db72fe6f0d413b8f972a59047d
        Headers: Version=3.2.3, Changeset=b3294247961261db72fe6f0d413b8f972a59047d
        Build Timestamp: 2021-10-20 12:19:37
        Default plugin directory: /usr/lib64/libcouchbase
        IO: Default=libevent, Current=select, Accessible=select
        SSL Runtime: OpenSSL 1.1.1k  FIPS 25 Mar 2021
        SSL Headers: OpenSSL 1.1.1g FIPS  21 Apr 2020
        Snappy: 1.1.8
        Tracing: SUPPORTED
        System: Linux-4.15.0-91-generic; x86_64
        CC: GNU 8.4.1; -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-strict-aliasing -ggdb3 -pthread
        CXX: GNU 8.4.1; -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-strict-aliasing -ggdb3 -pthread
      [admin@uxadm01 ~]$ pip3 list | grep couchbase
      couchbase                3.2.3

      Attachments

        For Gerrit Dashboard: PYCBC-1214
        # Subject Branch Project Status CR V

        Activity

          jared.casey Jared Casey added a comment - - edited

          Hi Michael Minichino - This should be fixed now.  Can you try to install the current dev release via testpypi and verify as well?
           

          python3 -m pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple couchbase==3.2.5.dev1
          

          Please let me know if you have any questions. Thanks!

          jared.casey Jared Casey added a comment - - edited Hi Michael Minichino - This should be fixed now.  Can you try to install the current dev release via testpypi and verify as well?   python3 -m pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple couchbase==3.2.5.dev1 Please let me know if you have any questions. Thanks!
          jared.casey Jared Casey added a comment -

          Added defense to check event status and cancel prior to trying to destroy event.

          jared.casey Jared Casey added a comment - Added defense to check event status and cancel prior to trying to destroy event.

          People

            jared.casey Jared Casey
            michael.minichino Michael Minichino
            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