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

it would be good to have ProgramRunner handle string values for port for non-decimal base

      If port value is given as string while running mongod using MongoRunner, the decimal base is expected. It would be good to support octal and hexadecimal base. Below is the exception that is thrown:

      MongoDB shell version: 2.7.8
      connecting to: test
      > 
      > 
      > 
      > 
      > 
      > 
      > var port = "0x4000";
      > var conn = MongoRunner.runMongod( { port: port});
      Resetting db path '/data/db/mongod-0x4000'
      2014-10-28T14:49:08.171-0400 I -        error: a port number is expected when running mongod from the shell
      2014-10-28T14:49:08.171-0400 I -        Assertion failure _port > 0 src/mongo/shell/shell_utils_launcher.cpp 250
      2014-10-28T14:49:08.173-0400 I -        
       0x1001a2b9f 0x10015de6e 0x10014d551 0x100148a32 0x1001458c4 0x100108011 0x100106d06 0x1002a7f10 0x3e4dc4c06362
      ----- BEGIN BACKTRACE -----
      {"backtrace":[{"b":"100000000","o":"1A2B9F"},{"b":"100000000","o":"15DE6E"},{"b":"100000000","o":"14D551"},{"b":"100000000","o":"148A32"},{"b":"100000000","o":"1458C4"},{"b":"100000000","o":"108011"},{"b":"100000000","o":"106D06"},{"b":"100000000","o":"2A7F10"},{"b":"0","o":"3E4DC4C06362"}],"processInfo":{ "mongodbVersion" : "2.7.8", "gitVersion" : "0e9cb3b20498b9f167afaff7a5c4a4d1da7e06a2", "uname" : { "sysname" : "Darwin", "release" : "13.4.0", "version" : "Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64", "machine" : "x86_64" }, "somap" : [ { "path" : "/usr/local/mongodb/bin/mongo", "machType" : 2, "b" : "100000000", "buildId" : "4F1AD0161DF43A15BB27E68082F973E0" }, { "path" : "/usr/lib/libSystem.B.dylib", "machType" : 6, "b" : "7FFF95C91000", "buildId" : "E303F2F8A8CF3DF384B3F2D0EE41CCF6" }, { "path" : "/usr/lib/libstdc++.6.dylib", "machType" : 6, "b" : "7FFF8E70B000", "buildId" : "0241E6A4136833BE950BD0A175C41F54" }, { "path" : "/usr/lib/system/libcache.dylib", "machType" : 6, "b" : "7FFF8914D000", "buildId" : "8C1EFC4F3F513DE9A973360B461F3D65" }, { "path" : "/usr/lib/system/libcommonCrypto.dylib", "machType" : 6, "b" : "7FFF92979000", "buildId" : "79B8E80FE59633028243EC479B9546CA" }, { "path" : "/usr/lib/system/libcompiler_rt.dylib", "machType" : 6, "b" : "7FFF8EB8E000", "buildId" : "2A8900040A783E339AC5A7D63BD4F879" }, { "path" : "/usr/lib/system/libcopyfile.dylib", "machType" : 6, "b" : "7FFF8871E000", "buildId" : "CF29DFF605893590834C82E2316612E8" }, { "path" : "/usr/lib/system/libcorecrypto.dylib", "machType" : 6, "b" : "7FFF8E6BC000", "buildId" : "F3973C2814B63006BB2B00DD7F09ABC7" }, { "path" : "/usr/lib/system/libdispatch.dylib", "machType" : 6, "b" : "7FFF887D9000", "buildId" : "C4E4A18D3C3B3C9C8709A4270D998DE7" }, { "path" : "/usr/lib/system/libdyld.dylib", "machType" : 6, "b" : "7FFF9235F000", "buildId" : "7C9EC3B7DDE333FF953F4067C743951D" }, { "path" : "/usr/lib/system/libkeymgr.dylib", "machType" : 6, "b" : "7FFF9298F000", "buildId" : "D7045F25BFA43840847DAF95DF8B6CCA" }, { "path" : "/usr/lib/system/liblaunch.dylib", "machType" : 6, "b" : "7FFF8BEF3000", "buildId" : "A40A0C7B321639B48AE0B5D3BAF1DA8A" }, { "path" : "/usr/lib/system/libmacho.dylib", "machType" : 6, "b" : "7FFF8E183000", "buildId" : "B2BE3C25CF1F309BAB991F0B54621445" }, { "path" : "/usr/lib/system/libquarantine.dylib", "machType" : 6, "b" : "7FFF91822000", "buildId" : "973BE51D6465392F9099D4AB21BF0D25" }, { "path" : "/usr/lib/system/libremovefile.dylib", "machType" : 6, "b" : "7FFF918A1000", "buildId" : "26266E3FFDDC3CFCB27F78B49BDC9BDC" }, { "path" : "/usr/lib/system/libsystem_asl.dylib", "machType" : 6, "b" : "7FFF95B5B000", "buildId" : "B983CA60F418317BB14248A6376564FC" }, { "path" : "/usr/lib/system/libsystem_blocks.dylib", "machType" : 6, "b" : "7FFF8DDC1000", "buildId" : "FB856CD12AEA39078E9B1E54B6827F82" }, { "path" : "/usr/lib/system/libsystem_c.dylib", "machType" : 6, "b" : "7FFF96308000", "buildId" : "6FD3A4004BB23B95B90CBE6E9D0D78FA" }, { "path" : "/usr/lib/system/libsystem_configuration.dylib", "machType" : 6, "b" : "7FFF8D56D000", "buildId" : "4998CB6A9D54390A9F575D1AC53C135C" }, { "path" : "/usr/lib/system/libsystem_dnssd.dylib", "machType" : 6, "b" : "7FFF96236000", "buildId" : "17B03FFD92C532829981EBB28B456207" }, { "path" : "/usr/lib/system/libsystem_info.dylib", "machType" : 6, "b" : "7FFF962A1000", "buildId" : "395D8CD6616A3BD3A195C6D68EB9AB22" }, { "path" : "/usr/lib/system/libsystem_kernel.dylib", "machType" : 6, "b" : "7FFF8E3FE000", "buildId" : "9EDE872E2A9E3A788E1DAB790794A098" }, { "path" : "/usr/lib/system/libsystem_m.dylib", "machType" : 6, "b" : "7FFF8EBEC000", "buildId" : "9D96AACD58703A5CB8497F9C0F6EBB09" }, { "path" : "/usr/lib/system/libsystem_malloc.dylib", "machType" : 6, "b" : "7FFF91B69000", "buildId" : "A695B4E438E9332EA77229D31E3F1385" }, { "path" : "/usr/lib/system/libsystem_network.dylib", "machType" : 6, "b" : "7FFF91825000", "buildId" : "A499D688916537768C8EC018897B5B13" }, { "path" : "/usr/lib/system/libsystem_notify.dylib", "machType" : 6, "b" : "7FFF8C399000", "buildId" : "9B34B4FEF5AD3F09A5F046AFF3571323" }, { "path" : "/usr/lib/system/libsystem_platform.dylib", "machType" : 6, "b" : "7FFF913DF000", "buildId" : "3C3D3DA832B9324398ECD89B9A1670B3" }, { "path" : "/usr/lib/system/libsystem_pthread.dylib", "machType" : 6, "b" : "7FFF89DB5000", "buildId" : "9DA50FD0D9AC3051AD4BBA0D745BC49C" }, { "path" : "/usr/lib/system/libsystem_sandbox.dylib", "machType" : 6, "b" : "7FFF89BBA000", "buildId" : "0D0B13EA6B7A3AC8BE60B548543BEB77" }, { "path" : "/usr/lib/system/libsystem_stats.dylib", "machType" : 6, "b" : "7FFF919BA000", "buildId" : "4E51D5B092A03D0DB90E495A1ED3E391" }, { "path" : "/usr/lib/system/libunc.dylib", "machType" : 6, "b" : "7FFF8FA69000", "buildId" : "C3737C9AC06F310CB78C7D8D882A35DE" }, { "path" : "/usr/lib/system/libunwind.dylib", "machType" : 6, "b" : "7FFF919AE000", "buildId" : "95D4D11833683474989D271DE18C8365" }, { "path" : "/usr/lib/system/libxpc.dylib", "machType" : 6, "b" : "7FFF8EB96000", "buildId" : "AB40CD57F4543FD4B41563B3C0D5C624" }, { "path" : "/usr/lib/libobjc.A.dylib", "machType" : 6, "b" : "7FFF9599E000", "buildId" : "F21C57427B9C31F1BBAE1717BC6C2F1B" }, { "path" : "/usr/lib/libauto.dylib", "machType" : 6, "b" : "7FFF9231C000", "buildId" : "F45C36E8B6063886B5B1B6745E757CA8" }, { "path" : "/usr/lib/libc++abi.dylib", "machType" : 6, "b" : "7FFF8E189000", "buildId" : "21A807D367323455B77F743E9F916DF0" }, { "path" : "/usr/lib/libc++.1.dylib", "machType" : 6, "b" : "7FFF9184D000", "buildId" : "2CB96D101E3E39B1B90DC56C3818321E" }, { "path" : "/usr/lib/libDiagnosticMessagesClient.dylib", "machType" : 6, "b" : "7FFF89D50000", "buildId" : "4CDB0F7BC0AF3424BC39495696F0DB1E" } ] }}
       mongo(_ZN5mongo15printStackTraceERSo+0x2F) [0x1001a2b9f]
       mongo(_ZN5mongo10logContextEPKc+0xAE) [0x10015de6e]
       mongo(_ZN5mongo12verifyFailedEPKcS1_j+0x131) [0x10014d551]
       mongo(_ZN5mongo11shell_utils13ProgramRunnerC2ERKNS_7BSONObjE+0x6D6) [0x100148a32]
       mongo(_ZN5mongo11shell_utils17StartMongoProgramERKNS_7BSONObjEPv+0x34) [0x1001458c4]
       mongo(_ZN5mongo7V8Scope14nativeCallbackEPS0_RKN2v89ArgumentsE+0x199) [0x100108011]
       mongo(_ZN5mongo7V8Scope10v8CallbackERKN2v89ArgumentsE+0x5A) [0x100106d06]
       mongo(_ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE+0x1D0) [0x1002a7f10]
       ??? [0x3e4dc4c06362]
      -----  END BACKTRACE  -----
      2014-10-28T14:49:08.176-0400 I QUERY    Error: assertion src/mongo/shell/shell_utils_launcher.cpp:250
          at Function.MongoRunner.startWithArgs (src/mongo/shell/servers.js:828:34)
          at Function.MongoRunner.runMongod (src/mongo/shell/servers.js:593:30)
          at (shell):1:24 at src/mongo/shell/servers.js:828
      

      line 241: _port = strtol( str.c_str(), 0, 10 ); at https://github.com/mongodb/mongo/blob/master/src/mongo/shell/shell_utils_launcher.cpp likely is the issue.

            Assignee:
            backlog-server-tig DO NOT USE - Backlog - Test Infrastructure Group (TIG)
            Reporter:
            jalpa.trivedi@mongodb.com Jalpa Trivedi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: