[SERVER-36401] Latest Mongo Shell Causes MongoDB Mobile to Crash Created: 01/Aug/18  Updated: 01/Aug/18  Resolved: 01/Aug/18

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Matt Lord (Inactive) Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

Sending any command to a monged process built from the master branch using a 4.0.1-rc1, 4.1.1, or 4.1.1-143-g9ca6c11082 mongo shell causes the server process to crash:

mongolord:mongo matt$ ./mongoed --dbpath /tmp/
2018-08-01T15:05:23.521-0400 I -        [main] MongoDB embedded standalone application, for testing purposes only
2018-08-01T15:05:23.551-0400 I CONTROL  [initandlisten] MongoDB starting : pid=25602 port=27017 dbpath=/tmp/ 64-bit
2018-08-01T15:05:23.551-0400 W STORAGE  [initandlisten] Detected unclean shutdown - /tmp/mongod.lock is not empty.
2018-08-01T15:05:23.564-0400 W ASIO     [initandlisten] No TransportLayer configured during NetworkInterface startup
2018-08-01T15:05:23.567-0400 I NETWORK  [initandlisten] waiting for connections on port 27017
2018-08-01T15:05:27.897-0400 I NETWORK  [listener] connection accepted from 127.0.0.1:61894 #1 (1 connection now open)
2018-08-01T15:05:27.897-0400 I NETWORK  [conn1] received client metadata from 127.0.0.1:61894 conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.1-rc1" }, os: { type: "Darwin", name: "Mac OS X", architecture: "x86_64", version: "17.7.0" } }
2018-08-01T15:05:27.898-0400 I NETWORK  [conn1] end connection 127.0.0.1:61894 (0 connections now open)
2018-08-01T15:05:28.987-0400 I NETWORK  [listener] connection accepted from 127.0.0.1:61895 #2 (1 connection now open)
2018-08-01T15:05:28.987-0400 I NETWORK  [conn2] received client metadata from 127.0.0.1:61895 conn2: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.0.1-rc1" }, os: { type: "Darwin", name: "Mac OS X", architecture: "x86_64", version: "17.7.0" } }
2018-08-01T15:05:31.879-0400 F -        [conn2] Invalid access at address: 0x0
2018-08-01T15:05:31.892-0400 F -        [conn2] Got signal: 11 (Segmentation fault: 11).
 0x110e323f9 0x110e31e7a 0x7fff5e098f5a 0x112d7a080 0x10faf5090 0x10faef258 0x10f9cbdeb 0x10f9aaee5 0x10f9b0e16 0x10f9b0404 0x10f9b378c 0x110c6029e 0x10f9afe83 0x10f9af8a8 0x10f9aedb5 0x10f9b034b 0x10f9b378c 0x110c60f8f 0x110db08b9 0x7fff5e0a2661 0x7fff5e0a250d 0x7fff5e0a1bf9
----- BEGIN BACKTRACE -----
...
mongoed(_ZN5mongo15printStackTraceERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEE+0x39) [0x110e323f9]
 mongoed(_ZN5mongo12_GLOBAL__N_124abruptQuitWithAddrSignalEiP9__siginfoPv+0x12A) [0x110e31e7a]
 libsystem_platform.dylib(_sigtramp+0x1A) [0x7fff5e098f5a]
 ??? [0x112d7a080]
 mongoed(_ZN5mongo12_GLOBAL__N_119execCommandDatabaseEPNS_16OperationContextEPNS_7CommandERKNS_12OpMsgRequestEPNS_3rpc21ReplyBuilderInterfaceERKNS_23ServiceEntryPointCommon5HooksE+0x190) [0x10faf5090]
 mongoed(_ZN5mongo23ServiceEntryPointCommon13handleRequestEPNS_16OperationContextERKNS_7MessageERKNS0_5HooksE+0x9F8) [0x10faef258]
 mongoed(_ZN5mongo25ServiceEntryPointEmbedded13handleRequestEPNS_16OperationContextERKNS_7MessageE+0x3B) [0x10f9cbdeb]
 mongoed(_ZN5mongo12_GLOBAL__N_123ServiceEntryPointMongoe13handleRequestEPNS_16OperationContextERKNS_7MessageE+0x15) [0x10f9aaee5]
 mongoed(_ZN5mongo19ServiceStateMachine15_processMessageENS0_11ThreadGuardE+0x1B6) [0x10f9b0e16]
 mongoed(_ZN5mongo19ServiceStateMachine15_runNextInGuardENS0_11ThreadGuardE+0x124) [0x10f9b0404]
 mongoed(_ZNSt3__110__function6__funcIZN5mongo19ServiceStateMachine22_scheduleNextWithGuardENS3_11ThreadGuardENS2_9transport15ServiceExecutor13ScheduleFlagsENS5_23ServiceExecutorTaskNameENS3_9OwnershipEE3$_0NS_9allocatorISA_EEFvvEEclEv+0x5C) [0x10f9b378c]
 mongoed(_ZN5mongo9transport26ServiceExecutorSynchronous8scheduleENSt3__18functionIFvvEEENS0_15ServiceExecutor13ScheduleFlagsENS0_23ServiceExecutorTaskNameE+0x28E) [0x110c6029e]
 mongoed(_ZN5mongo19ServiceStateMachine22_scheduleNextWithGuardENS0_11ThreadGuardENS_9transport15ServiceExecutor13ScheduleFlagsENS2_23ServiceExecutorTaskNameENS0_9OwnershipE+0xC3) [0x10f9afe83]
 mongoed(_ZN5mongo19ServiceStateMachine15_sourceCallbackENS_6StatusE+0x108) [0x10f9af8a8]
 mongoed(_ZN5mongo19ServiceStateMachine14_sourceMessageENS0_11ThreadGuardE+0x1B5) [0x10f9aedb5]
 mongoed(_ZN5mongo19ServiceStateMachine15_runNextInGuardENS0_11ThreadGuardE+0x6B) [0x10f9b034b]
 mongoed(_ZNSt3__110__function6__funcIZN5mongo19ServiceStateMachine22_scheduleNextWithGuardENS3_11ThreadGuardENS2_9transport15ServiceExecutor13ScheduleFlagsENS5_23ServiceExecutorTaskNameENS3_9OwnershipEE3$_0NS_9allocatorISA_EEFvvEEclEv+0x5C) [0x10f9b378c]
 mongoed(_ZNSt3__110__function6__funcIZN5mongo9transport26ServiceExecutorSynchronous8scheduleENS_8functionIFvvEEENS3_15ServiceExecutor13ScheduleFlagsENS3_23ServiceExecutorTaskNameEE3$_1NS_9allocatorISB_EES6_EclEv+0x34F) [0x110c60f8f]
 mongoed(_ZN5mongo12_GLOBAL__N_17runFuncEPv+0x19) [0x110db08b9]
 libsystem_pthread.dylib(_pthread_body+0x154) [0x7fff5e0a2661]
 libsystem_pthread.dylib(_pthread_body+0x0) [0x7fff5e0a250d]
 libsystem_pthread.dylib(thread_start+0xD) [0x7fff5e0a1bf9]
-----  END BACKTRACE  -----
Segmentation fault: 11

This seems likely to be caused by one of these two recent patches:



 Comments   
Comment by Matt Lord (Inactive) [ 01/Aug/18 ]

My git branch must have been messed up. I built mongoed and mongo from a fresh clone of master and it works fine.

test@mongolord> db.version()
4.1.1-189-g114b1e828e
test@mongolord> version()
4.1.1-189-g114b1e828e
test@mongolord> db.serverStatus().storageEngine
{
	"name" : "mobile",
	"supportsCommittedReads" : false,
	"supportsSnapshotReadConcern" : false,
	"readOnly" : false,
	"persistent" : true
}
test@mongolord> use test;
switched to db test
test@mongolord> db.ttltest.insertOne( {"name":"Matt Lord", "age":42} );
{
	"acknowledged" : true,
	"insertedId" : ObjectId("5b623354488841909fb00ac4")
}
test@mongolord> db.ttltest.createIndex( {"age":1}, {expireAfterSeconds:3} );
{
	"createdCollectionAutomatically" : false,
	"numIndexesBefore" : 1,
	"numIndexesAfter" : 2,
	"ok" : 1
}
test@mongolord> sleep(15000);
test@mongolord> db.ttltest.find();
{ "_id" : ObjectId("5b623354488841909fb00ac4"), "name" : "Matt Lord", "age" : 42 }

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