Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1207

Deprecated SASL functions and possible crash on OS X 10.11

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Minor - P4 Minor - P4
    • TBD
    • Affects Version/s: 1.3.5
    • Component/s: libmongoc
    • None
    • Environment:
      OS X 10.11

      At least one user in mongodb/mongo-php-driver#247 reported build warnings when compiling the PHPC driver (bundled with libmongoc 1.3.x) on OSX 10.11:

      /private/tmp/pear/temp/mongodb/src/libmongoc/src/mongoc/mongoc-init.c  -fno-common -DPIC -o src/libmongoc/src/mongoc/.libs/mongoc-init.o
      /private/tmp/pear/temp/mongodb/src/libmongoc/src/mongoc/mongoc-init.c:85:4: warning: 'sasl_set_mutex' is deprecated: first deprecated in OS X 10.11 [-Wdeprecated-declarations]
         sasl_set_mutex (mongoc_sasl_mutex_alloc,
         ^
      /usr/include/sasl/sasl.h:253:18: note: 'sasl_set_mutex' has been explicitly marked deprecated here
      LIBSASL_API void sasl_set_mutex(sasl_mutex_alloc_t *, sasl_mutex_lock_t *,
                       ^
      /private/tmp/pear/temp/mongodb/src/libmongoc/src/mongoc/mongoc-init.c:91:4: warning: 'sasl_client_init' is deprecated: first deprecated in OS X 10.11 [-Wdeprecated-declarations]
         sasl_client_init (NULL);
         ^
      /usr/include/sasl/sasl.h:924:17: note: 'sasl_client_init' has been explicitly marked deprecated here
      LIBSASL_API int sasl_client_init(const sasl_callback_t *callbacks) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_11,__IPHONE_NA,__IPHONE_NA);
                      ^
      /private/tmp/pear/temp/mongodb/src/libmongoc/src/mongoc/mongoc-init.c:130:4: warning: 'sasl_client_done' is deprecated: first deprecated in OS X 10.11 [-Wdeprecated-declarations]
         sasl_client_done ();
         ^
      /usr/include/sasl/sasl.h:741:17: note: 'sasl_client_done' has been explicitly marked deprecated here
      LIBSASL_API int sasl_client_done(void) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0,__MAC_10_11,__IPHONE_NA,__IPHONE_NA);
                      ^
      

      The same user reported a segfault when using PHPC (compiled with SASL support) in XAMPP. The following stack trace snippet hints at this being due to a SASL incompatibility:

      20  libdyld.dylib                   0x00007fff8753e79c dlopen + 59
      21  libsasl2.2.dylib                0x00007fff8604a8fc _sasl_get_plugin + 78
      22  libsasl2.2.dylib                0x00007fff8604ac4d _sasl_load_plugins + 762
      23  libsasl2.2.dylib                0x00007fff86042568 sasl_client_init + 240
      24  mongodb.so                      0x000000010327ea98 _mongoc_do_init + 56
      25  libsystem_pthread.dylib         0x00007fff8b494c0a __pthread_once_handler + 65
      26  libsystem_platform.dylib        0x00007fff893ccfc4 _os_once + 41
      27  libsystem_pthread.dylib         0x00007fff8b494ba9 pthread_once + 57
      ...
      34  dyld                            0x00007fff688ea118 dlopen + 555
      35  libdyld.dylib                   0x00007fff8753e79c dlopen + 59
      36  libphp5.so                      0x0000000101f6bc86 php_load_extension + 134
      

      I'm unsure if the segfault is directly related to the use of now-deprecated functions.

            Assignee:
            backlog-c-driver [DO NOT USE] Backlog - C Driver Team
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: