Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-2280

Prefer OpenSSL on MacOS to avoid segmentation faults in php-fpm

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 1.17.0
    • Affects Version/s: 1.16.2
    • Component/s: None
    • None

      First reported in https://github.com/mongodb/mongo-php-library/issues/1145.

      The following minimal reproducer causes a SIGSEGV:

      $uri = '<any atlas cluster>';
      $manager = new MongoDB\Driver\Manager($uri);
      $manager->selectServer();
      

      The following trace is generated (in my example with PHP 8.2 and a 1.17-dev version of PHPC):

      Thread 0 Crashed::  Dispatch queue: com.apple.root.utility-qos
      0   libdispatch.dylib             	       0x1a5a2883c _dispatch_apply_with_attr_f + 1164
      1   libdispatch.dylib             	       0x1a5a28a38 dispatch_apply + 96
      2   CoreFoundation                	       0x1a5dcb3cc __103-[CFPrefsSearchListSource synchronouslySendSystemMessage:andUserMessage:andDirectMessage:replyHandler:]_block_invoke.52 + 132
      3   CoreFoundation                	       0x1a5c58460 CFPREFERENCES_IS_WAITING_FOR_SYSTEM_AND_USER_CFPREFSDS + 100
      4   CoreFoundation                	       0x1a5dca5fc -[CFPrefsSearchListSource synchronouslySendSystemMessage:andUserMessage:andDirectMessage:replyHandler:] + 232
      5   CoreFoundation                	       0x1a5c56b80 -[CFPrefsSearchListSource alreadylocked_generationCountFromListOfSources:count:] + 232
      6   CoreFoundation                	       0x1a5c5688c -[CFPrefsSearchListSource alreadylocked_getDictionary:] + 468
      7   CoreFoundation                	       0x1a5c56410 -[CFPrefsSearchListSource alreadylocked_copyValueForKey:] + 172
      8   CoreFoundation                	       0x1a5c56344 -[CFPrefsSource copyValueForKey:] + 52
      9   CoreFoundation                	       0x1a5c562f8 __76-[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:]_block_invoke + 32
      10  CoreFoundation                	       0x1a5c4f260 __108-[_CFXPreferences(SearchListAdditions) withSearchListForIdentifier:container:cloudConfigurationURL:perform:]_block_invoke + 376
      11  CoreFoundation                	       0x1a5dcbc78 -[_CFXPreferences withSearchListForIdentifier:container:cloudConfigurationURL:perform:] + 384
      12  CoreFoundation                	       0x1a5c4eb30 -[_CFXPreferences copyAppValueForKey:identifier:container:configurationURL:] + 168
      13  CoreFoundation                	       0x1a5c4ea4c _CFPreferencesCopyAppValueWithContainerAndConfiguration + 112
      14  Security                      	       0x1a8625eac __SSLCreateContextWithRecordFuncs_block_invoke + 48
      15  libdispatch.dylib             	       0x1a5a14400 _dispatch_client_callout + 20
      16  libdispatch.dylib             	       0x1a5a15c40 _dispatch_once_callout + 32
      17  Security                      	       0x1a8625bf4 SSLCreateContextWithRecordFuncs + 416
      18  Security                      	       0x1a8625980 SSLCreateContext + 36
      19  mongodb.so                    	       0x10447dbb0 mongoc_stream_tls_secure_transport_new + 856 (mongoc-stream-tls-secure-transport.c:705)
      20  mongodb.so                    	       0x10447d240 mongoc_stream_tls_new_with_hostname + 304 (mongoc-stream-tls.c:230)
      21  mongodb.so                    	       0x10448cd5c _mongoc_topology_scanner_node_setup_stream_for_tls + 108 (mongoc-topology-scanner.c:862)
      22  mongodb.so                    	       0x10448cec4 _mongoc_topology_scanner_tcp_initiate + 280 (mongoc-topology-scanner.c:894)
      23  mongodb.so                    	       0x1043db5c0 _mongoc_async_cmd_phase_initiate + 32 (mongoc-async-cmd.c:273)
      24  mongodb.so                    	       0x1043dab60 mongoc_async_cmd_run + 248 (mongoc-async-cmd.c:115)
      25  mongodb.so                    	       0x1043da33c mongoc_async_run + 536 (mongoc-async.c:94)
      26  mongodb.so                    	       0x10448ddd0 mongoc_topology_scanner_work + 28 (mongoc-topology-scanner.c:1304)
      27  mongodb.so                    	       0x1044833fc mongoc_topology_scan_once + 232 (mongoc-topology.c:900)
      28  mongodb.so                    	       0x1044832f8 _mongoc_topology_do_blocking_scan + 164 (mongoc-topology.c:926)
      29  mongodb.so                    	       0x104483948 mongoc_topology_select_server_id + 792 (mongoc-topology.c:1217)
      30  mongodb.so                    	       0x1044835b0 mongoc_topology_select + 56 (mongoc-topology.c:1000)
      31  mongodb.so                    	       0x1043e9d34 mongoc_client_select_server + 276 (mongoc-client.c:2902)
      32  mongodb.so                    	       0x10456a5fc php_phongo_manager_select_server + 308 (Manager.c:228)
      33  mongodb.so                    	       0x104568610 zim_MongoDB_Driver_Manager_selectServer + 1036 (Manager.c:704)
      34  xdebug.so                     	       0x10392edb8 xdebug_execute_internal + 652
      35  php-fpm                       	       0x100b47084 ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER + 228
      36  php-fpm                       	       0x100b2275c execute_ex + 52
      37  xdebug.so                     	       0x10392e9d0 xdebug_execute_ex + 1548
      38  php-fpm                       	       0x100b22964 zend_execute + 300
      39  php-fpm                       	       0x100b01c4c zend_execute_scripts + 168
      40  php-fpm                       	       0x100aa0544 php_execute_script + 484
      41  php-fpm                       	       0x100bfb62c main + 5572
      42  dyld                          	       0x1a586bf28 start + 2236
      

            Assignee:
            andreas.braun@mongodb.com Andreas Braun
            Reporter:
            andreas.braun@mongodb.com Andreas Braun
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: