Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-101042

TLS with --fork will crash on MacOS

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • Hide

      Machine:MacBook M3 Pro

      OS:Sequoia

      Mongo Version:

      db version v7.0.12
      Build Info: {
          "version": "7.0.12",
          "gitVersion": "b6513ce0781db6818e24619e8a461eae90bc94fc",
          "modules": [],
          "allocator": "system",
          "environment":

      {         "distarch": "aarch64",         "target_arch": "aarch64"     }

      }

       

      congfig.yaml

       
      net:
      tls:
      mode: requireTLS
      certificateKeyFile: mkcert/mongo-tls.pem
      CAFile: mkcert/CA.pem
      allowConnectionsWithoutCertificates: true
      bindIp: 127.0.0.1,localhost
      port: 57017
      storage:
      dbPath: data
      systemLog:
      verbosity: 0
      destination: file
      path: logs/mongod_tls.log
       
      shell script to reproduce:
       
      export CAROOT=./mkcert

      rm -rf data
      mkdir data

      if ! [ -x "$(command -v mkcert)" ]; then
      echo"can't find mkcert in $PATH, try install"
      goinstallfilippo.io/mkcert@master
      fi

      mkcert -install
      cat $CAROOT/rootCA.pem $CAROOT/rootCA-key.pem > $CAROOT/CA.pem
      mkcert -cert-file $CAROOT/mongo-tls.crt -key-file $CAROOT/mongo-tls.key localhost 127.0.0.1 ::1
      cat $CAROOT/mongo-tls.crt $CAROOT/mongo-tls.key > $CAROOT/mongo-tls.pem

      mongod --config config.yaml --fork

      Show
      Machine:MacBook M3 Pro OS:Sequoia Mongo Version: db version v7.0.12 Build Info: {     "version": "7.0.12",     "gitVersion": "b6513ce0781db6818e24619e8a461eae90bc94fc",     "modules": [],     "allocator": "system",     "environment": {         "distarch": "aarch64",         "target_arch": "aarch64"     } }   congfig.yaml   net: tls: mode: requireTLS certificateKeyFile: mkcert/mongo-tls.pem CAFile: mkcert/CA.pem allowConnectionsWithoutCertificates: true bindIp: 127.0.0.1,localhost port: 57017 storage: dbPath: data systemLog: verbosity: 0 destination: file path: logs/mongod_tls.log   shell script to reproduce:   export CAROOT=./mkcert rm -rf data mkdir data if ! [ -x "$(command -v mkcert)" ]; then echo"can't find mkcert in $PATH, try install" goinstallfilippo.io/mkcert@master fi mkcert -install cat $CAROOT/rootCA.pem $CAROOT/rootCA-key.pem > $CAROOT/CA.pem mkcert -cert-file $CAROOT/mongo-tls.crt -key-file $CAROOT/mongo-tls.key localhost 127.0.0.1 ::1 cat $CAROOT/mongo-tls.crt $CAROOT/mongo-tls.key > $CAROOT/mongo-tls.pem mongod --config config.yaml --fork
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      System Integrity Protection: enabled

      Crashed Thread:        0  Dispatch queue: com.apple.main-thread

      Exception Type:        EXC_CRASH (SIGABRT)
      Exception Codes:       0x0000000000000000, 0x0000000000000000

      Termination Reason:    Namespace SIGNAL, Code 6 Abort trap: 6
      Terminating Process:   mongod [51840]

      Application Specific Information:

          • single-threaded process forked ***
            crashed on child side of fork pre-exec

      Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
      0   libsystem_kernel.dylib                   0x19d07f720 __pthread_kill + 8
      1   libsystem_pthread.dylib                  0x19d0b7f70 pthread_kill + 288
      2   libsystem_c.dylib                        0x19cf8cc18 raise + 32
      3   mongod                                   0x108eba430 mongo::(anonymous namespace)::endProcessWithSignal(int) + 108
      4   mongod                                   0x108eba080 abruptQuit + 228
      5   libsystem_platform.dylib                 0x19d0eede4 _sigtramp + 56
      6   libsystem_kernel.dylib                   0x19d0a9eb8 abort_with_payload_wrapper_internal + 104
      7   libsystem_kernel.dylib                   0x19d0a9e50 abort_with_reason + 32
      8   libobjc.A.dylib                          0x19cd20040 _objc_fatalv(unsigned long long, unsigned long long, char const*, char*) + 128
      9   libobjc.A.dylib                          0x19cd1ffc0 _objc_fatal(char const*, ...) + 44
      10  libobjc.A.dylib                          0x19cd05674 performForkChildInitialize(objc_class*, objc_class*) + 400
      11  libobjc.A.dylib                          0x19ccea7f0 initializeNonMetaClass + 592
      12  libobjc.A.dylib                          0x19cd08a3c initializeAndMaybeRelock(objc_class*, objc_object*, locker_mixin<lockdebug::lock_mixin<objc_lock_base_t>>&, bool) + 164
      13  libobjc.A.dylib                          0x19cce9f98 lookUpImpOrForward + 304
      14  libobjc.A.dylib                          0x19cce9b84 _objc_msgSend_uncached + 68
      15  libCoreEntitlements.dylib                0x27cc6eec4 manufacturingCallback + 540
      16  libCoreEntitlements.dylib                0x27cc6c4c0 __der_vm_iterate_block_invoke + 68
      17  libCoreEntitlements.dylib                0x27cc6c238 der_vm_iterate_b + 288
      18  libCoreEntitlements.dylib                0x27cc6f15c CEQueryContextToCFDictionary + 180
      19  Security                                 0x1a037bd00 SecTaskLoadEntitlements + 936
      20  Security                                 0x1a037b918 SecTaskCopyValueForEntitlement + 76
      21  Security                                 0x1a03a6fb0 __setup_block_invoke + 60
      22  libdispatch.dylib                        0x19cf055b4 _dispatch_client_callout + 20
      23  libdispatch.dylib                        0x19cf06e00 _dispatch_once_callout + 32
      24  Security                                 0x1a03a6d00 countLegacyAPI + 164
      25  Security                                 0x1a0152d74 CSSM_Init + 96
      26  Security                                 0x1a0331c34 cuCssmStartup + 76
      27  Security                                 0x1a0331c84 cuCspStartup + 28
      28  Security                                 0x1a03efda8 SecKeychainItemImport + 2168
      29  Security                                 0x1a03f17dc SecItemImport + 128
      30  mongod                                   0x108a610f8 mongo::(anonymous namespace)::loadPEM(std::_1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char>> const&, std::1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char>> const&, mongo::(anonymous namespace)::LoadPEMMode) + 732
      31  mongod                                   0x108a65ea0 mongo::(anonymous namespace)::SSLManagerApple::initSSLContext(asio::ssl::apple::Context*, mongo::SSLParams const&, mongo::SSLManagerInterface::ConnectionDirection)::$1::operator()(mongo::SSLParams::CertificateSelector const&, std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char>> const&, std::1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char>> const&) const + 808
      32  mongod                                   0x108a60d74 mongo::(anonymous namespace)::SSLManagerApple::initSSLContext(asio::ssl::apple::Context*, mongo::SSLParams const&, mongo::SSLManagerInterface::ConnectionDirection) + 560
      33  mongod                                   0x108a5fd34 std::_1::shared_ptr<mongo::(anonymous namespace)::SSLManagerApple> std::_1::make_shared<mongo::(anonymous namespace)::SSLManagerApple, mongo::SSLParams const&, bool&, void>(mongo::SSLParams const&, bool&) + 356
      34  mongod                                   0x108a60788 mongo::SSLManagerInterface::create(mongo::SSLParams const&, bool) + 52
      35  mongod                                   0x108a521b0 mongo::SSLManagerCoordinator::SSLManagerCoordinator() + 108
      36  mongod                                   0x108a60888 mongo::_mongoInitializerFunction_SSLManager(mongo::InitializerContext*) + 204
      37  mongod                                   0x108e306f4 mongo::Initializer::executeInitializers(std::_1::vector<std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char>>, std::1::allocator<std::1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char>>>> const&) + 372
      38  mongod                                   0x108e30c4c mongo::runGlobalInitializers(std::_1::vector<std::1::basic_string<char, std::1::char_traits<char>, std::1::allocator<char>>, std::1::allocator<std::1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char>>>> const&) + 32
      39  mongod                                   0x104d9e930 mongo::mongod_main(int, char**) + 96
      40  mongod                                   0x104d9ddc8 main + 12
      41  dyld                                     0x19cd38274 start + 2840

      Thread 0 crashed with ARM Thread State (64-bit):
          x0: 0x0000000000000000   x1: 0x0000000000000000   x2: 0x0000000000000000   x3: 0x0000000000000003
          x4: 0x0000000000000600   x5: 0x0000000000000002   x6: 0x0000000000000600   x7: 0x0000000131861200
          x8: 0xde10f75ccd5df3f3   x9: 0xde10f75ecbff7bb3  x10: 0x00000000434f4e44  x11: 0x0000000000000002
         x12: 0x0000000000000000  x13: 0x0000000000000000  x14: 0x0000000000000046  x15: 0x00000000ffff7dff
         x16: 0x0000000000000148  x17: 0x000000020f06a050  x18: 0x0000000000000000  x19: 0x0000000000000006
         x20: 0x0000000000000303  x21: 0x0000000206a28920  x22: 0x0000000000000000  x23: 0x0000000000000001
         x24: 0x0000000000000008  x25: 0x00000002045cc000  x26: 0x0000000206a2754c  x27: 0x0000000000000000
         x28: 0x0000000206a28920   fp: 0x000000016b060700   lr: 0x000000019d0b7f70
          sp: 0x000000016b0606e0   pc: 0x000000019d07f720 cpsr: 0x40001000
         far: 0x0000000000000000  esr: 0x56000080  Address size fault

            Assignee:
            Unassigned Unassigned
            Reporter:
            scau.myzhan@gmail.com 青朋 詹
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: