[SERVER-9959] Tools do not support SSL Created: 18/Jun/13  Updated: 19/Dec/13  Resolved: 22/Oct/13

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 2.5.0
Fix Version/s: 2.5.4

Type: Bug Priority: Major - P3
Reporter: Spencer Jackson Assignee: Shaun Verch
Resolution: Done Votes: 0
Labels: pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Tested on Linux


Issue Links:
Depends
Operating System: ALL
Steps To Reproduce:

1) Turn on mongod with SSL
2) Run any tool with the flag --ssl

Participants:

 Description   

The MongoDB tools execute themselves by first running ` mongo::runGlobalInitializersOrDie(argc, argv, envp);', then parsing their command line arguments. As the ssl arguments haven't been processed prior to initialization, the SSLManager cannot be brought up.

This manifests with an assertation failure, when it's discovered that the pointer to the manager is NULL:
spencer@linux:~/mongo> ./mongostat --ssl
Tue Jun 18 11:39:16.009 Fatal Assertion 16503
0x12356ab 0x120f1be 0x11fcf9c 0xdb1d61 0x12244d9 0xd38ce7 0xd33540 0xd33089 0xd2cb10 0x11f77c5 0xce8437 0xce849d 0x7f542bec4a15 0xce8309
./mongostat(_ZN5mongo15printStackTraceERSo+0x27) [0x12356ab]
./mongostat(_ZN5mongo10logContextEPKc+0x5e) [0x120f1be]
./mongostat(_ZN5mongo13fassertFailedEi+0x65) [0x11fcf9c]
./mongostat(_ZN5mongo7fassertEib+0x29) [0xdb1d61]
./mongostat(_ZN5mongo6Socket6secureEPNS_19SSLManagerInterfaceE+0x27) [0x12244d9]
./mongostat(_ZN5mongo13MessagingPort6secureEPNS_19SSLManagerInterfaceE+0x2f) [0xd38ce7]
./mongostat(_ZN5mongo18DBClientConnection8_connectERSs+0x494) [0xd33540]
./mongostat(_ZN5mongo18DBClientConnection7connectERKNS_11HostAndPortERSs+0x87) [0xd33089]
./mongostat(_ZNK5mongo16ConnectionString7connectERSsd+0x15c) [0xd2cb10]
./mongostat(_ZN5mongo4Tool4mainEiPPc+0xaa7) [0x11f77c5]
./mongostat(Z8toolMainiPPcS0+0x6b) [0xce8437]
./mongostat(main+0x28) [0xce849d]
/lib64/libc.so.6(__libc_start_main+0xf5) [0x7f542bec4a15]
./mongostat() [0xce8309]
Tue Jun 18 11:39:16.020

***aborting after fassert() failure

Aborted



 Comments   
Comment by Andreas Nilsson [ 25/Sep/13 ]

I still experience this behavior for the latest nightly build.

Comment by Matt Kangas [ 30/Jul/13 ]

Squashed & merged in 00945fb065a7003c6e7936992b9486988358dec9

Comment by auto [ 30/Jul/13 ]

Author:

{u'name': u'Spencer Jackson', u'email': u'spencer.jackson@10gen.com'}

Message: SERVER-9959: Fix SSL in Tools

Fix SSL by deferring initializers, after CLI parameter parsing.
Condense tools by merging all identical main functions into tool.cpp.
Track memory used by Tool in an auto_ptr

Signed-off-by: Matt Kangas <matt.kangas@10gen.com>
Branch: master
https://github.com/mongodb/mongo/commit/00945fb065a7003c6e7936992b9486988358dec9

Comment by Eric Milkie [ 26/Jul/13 ]

I'll review it

Generated at Thu Feb 08 03:21:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.