[SERVER-41368] mongocryptd terminates with backtrace when started from a different directory from an already running instance Created: 29/May/19  Updated: 29/Oct/23  Resolved: 12/Jun/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.1.14, 4.2.0-rc2

Type: Bug Priority: Minor - P4
Reporter: Jeffrey Yemin Assignee: Mark Benvenuto
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
is related to SERVER-80269 Mongo finished after a Backtrace Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Security 2019-06-17
Participants:

 Description   

If you start up a mongocryptd, and then another one in the same working directory, it sees the pid file and exits with a nice message:

2019-05-29T13:08:57.322-0400 I  CONTROL  [initandlisten] Using lock file: /Users/jeff/mongocryptd.pid
2019-05-29T13:08:57.322-0400 E  CONTROL  [initandlisten] Failed to open pid file, exiting

All good. But if you start up another one in a different working directory, it's able to create a new pid file, but then terminates with a backtrace:

2019-05-29T13:42:25.952-0400 I  CONTROL  [initandlisten] Using lock file: /Users/jeff/mongo-java-driver/mongocryptd.pid
2019-05-29T13:42:25.954-0400 F  -        [initandlisten] terminate() called. An exception is active; attempting to gather more information
2019-05-29T13:42:25.955-0400 F  -        [initandlisten] DBException::toString(): SocketException: Address already in use
Actual exception type: mongo::error_details::ExceptionForImpl<(mongo::ErrorCodes::Error)9001, mongo::ExceptionForCat<(mongo::ErrorCategory)0> >
 0x1085e1a09 0x1085e0d37 0x7fff7470019e 0x7fff746fff86 0x7fff746f2f99 0x10858e322 0x1085d680b 0x107c5bec0 0x107c5b029 0x7fff776963d5 0x1
----- BEGIN BACKTRACE -----
{"backtrace":[{"b":"107C5A000","o":"987A09","s":"_ZN5mongo15printStackTraceERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE"}, ...
...
 mongocryptd(_ZN5mongo15printStackTraceERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE+0x39) [0x1085e1a09]
 mongocryptd(_ZN5mongo12_GLOBAL__N_111myTerminateEv+0x87) [0x1085e0d37]
 libc++abi.dylib(_ZSt11__terminatePFvvE+0x8) [0x7fff7470019e]
 libc++abi.dylib(__cxa_get_exception_ptr+0x0) [0x7fff746fff86]
 libc++abi.dylib(__cxa_get_globals+0x0) [0x7fff746f2f99]
 mongocryptd(_ZN5mongo13error_details23throwExceptionForStatusERKNS_6StatusE+0x37A2) [0x10858e322]
 mongocryptd(_ZN5mongo21uassertedWithLocationERKNS_6StatusEPKcj+0x20B) [0x1085d680b]
 mongocryptd(_ZN5mongo12_GLOBAL__N_110CryptDMainEiPPcS2_+0xE90) [0x107c5bec0]
 mongocryptd(main+0x9) [0x107c5b029]
 libdyld.dylib(start+0x1) [0x7fff776963d5]
 ??? [0x1]
-----  END BACKTRACE  -----
Abort trap: 6



 Comments   
Comment by Githook User [ 24/Jun/19 ]

Author:

{'name': 'Mark Benvenuto', 'username': 'markbenvenuto', 'email': 'mark.benvenuto@mongodb.com'}

Message: SERVER-41368 mongocryptd terminates with backtrace when reusing unix domain socket across instances

(cherry picked from commit 2bbd9fba8ac07088d0686fa6ec6566ce54dbbc86)
Branch: v4.2
https://github.com/10gen/mongo-enterprise-modules/commit/b670cd8007f3471c3f2f4ffe676301a003c8083a

Comment by Githook User [ 12/Jun/19 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-41368 mongocryptd terminates with backtrace when reusing unix domain socket across instances
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/2bbd9fba8ac07088d0686fa6ec6566ce54dbbc86

Generated at Thu Feb 08 04:57:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.