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

HexData, UUID, and MD5 in v8 crash process when called with invalid hex string

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.7
    • Affects Version/s: 2.4.3
    • Component/s: JavaScript, Shell
    • None
    • Fully Compatible
    • ALL
    • Build 7 08/10/15, Build 8 08/31/15

      MongoDB shell version: 2.5.0-pre-
      connecting to: test
      Tue May 14 13:29:47.602 [initandlisten] connection accepted from 127.0.0.1:49842 #1 (1 connection now open)
      Server has startup warnings:
      Tue May 14 12:32:09.790 [initandlisten]
      Tue May 14 12:32:09.790 [initandlisten] ** NOTE: This is a development version (2.5.0-pre-) of MongoDB.
      Tue May 14 12:32:09.790 [initandlisten] **       Not recommended for production.
      Tue May 14 12:32:09.790 [initandlisten]
      > HexData(0,"invalidhex")
      Tue May 14 13:30:00.461   Assertion failure false src/mongo/util/hex.h 34
      0x1078d1725 0x1078a272b 0x107878d8b 0x107726560 0x107726592 0x10785d838 0x10785dfbf 0x107828cd6 0x107a6067d 0x107a60a2b 0x107a5d788 0x1583106362
       0   mongo                               0x00000001078d1725 _ZN5mongo15printStackTraceERSo + 37
       1   mongo                               0x00000001078a272b _ZN5mongo10logContextEPKc + 123
       2   mongo                               0x0000000107878d8b _ZN5mongo12verifyFailedEPKcS1_j + 427
       3   mongo                               0x0000000107726560 _ZN5mongo7fromHexEc + 128
       4   mongo                               0x0000000107726592 _ZN5mongo7fromHexEPKc + 34
       5   mongo                               0x000000010785d838 _ZN5mongoL12hexToBinDataEPNS_7V8ScopeEN2v85LocalINS2_6ObjectEEEiSs + 200
       6   mongo                               0x000000010785dfbf _ZN5mongo11hexDataInitEPNS_7V8ScopeERKN2v89ArgumentsE + 447
       7   mongo                               0x0000000107828cd6 _ZN5mongo7V8Scope10v8CallbackERKN2v89ArgumentsE + 560
       8   mongo                               0x0000000107a6067d _ZN2v88internalL19HandleApiCallHelperILb0EEEPNS0_11MaybeObjectENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE + 1789
       9   mongo                               0x0000000107a60a2b _ZN2v88internalL26Builtin_Impl_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE + 43
       10  mongo                               0x0000000107a5d788 _ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE + 136
       11  ???                                 0x0000001583106362 0x0 + 92393202530
      Tue May 14 13:30:00.465
      
      ***aborting after verify() failure as this is a debug/test build
      
      
      Tue May 14 13:30:00.465 mongo got signal 6 (Abort trap: 6), stack trace:
      
      Tue May 14 13:30:00.468 0x1078d1725 0x1076a4c94 0x7fff946cc8ea 0x10942e068 0x7fff94723dce 0x107878f67 0x107726560 0x107726592 0x10785d838 0x10785dfbf 0x107828cd6 0x107a6067d 0x107a60a2b 0x107a5d788 0x1583106362
       0   mongo                               0x00000001078d1725 _ZN5mongo15printStackTraceERSo + 37
       1   mongo                               0x00000001076a4c94 _Z12quitAbruptlyi + 388
       2   libsystem_c.dylib                   0x00007fff946cc8ea _sigtramp + 26
       3   ???                                 0x000000010942e068 0x0 + 4450345064
       4   libsystem_c.dylib                   0x00007fff94723dce abort + 143
       5   mongo                               0x0000000107878f67 _ZN5mongo12verifyFailedEPKcS1_j + 903
       6   mongo                               0x0000000107726560 _ZN5mongo7fromHexEc + 128
       7   mongo                               0x0000000107726592 _ZN5mongo7fromHexEPKc + 34
       8   mongo                               0x000000010785d838 _ZN5mongoL12hexToBinDataEPNS_7V8ScopeEN2v85LocalINS2_6ObjectEEEiSs + 200
       9   mongo                               0x000000010785dfbf _ZN5mongo11hexDataInitEPNS_7V8ScopeERKN2v89ArgumentsE + 447
       10  mongo                               0x0000000107828cd6 _ZN5mongo7V8Scope10v8CallbackERKN2v89ArgumentsE + 560
       11  mongo                               0x0000000107a6067d _ZN2v88internalL19HandleApiCallHelperILb0EEEPNS0_11MaybeObjectENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE + 1789
       12  mongo                               0x0000000107a60a2b _ZN2v88internalL26Builtin_Impl_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE + 43
       13  mongo                               0x0000000107a5d788 _ZN2v88internalL21Builtin_HandleApiCallENS0_12_GLOBAL__N_116BuiltinArgumentsILNS0_21BuiltinExtraArgumentsE1EEEPNS0_7IsolateE + 136
       14  ???                                 0x0000001583106362 0x0 + 92393202530
      
      Tue May 14 13:30:00.473 [conn1] end connection 127.0.0.1:49842 (0 connections now open)
      

      This also causes mongod to crash if run in db.eval.

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            sverch Shaun Verch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: