Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1622

mongosh crash due to an infinite loop

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      OS: Ubuntu 22.02 AARCH64
      node.js / npm versions: The default installed by MongoSH
      Additional info:

      Problem Statement/Rationale


      Last night I left a MongoSH open and connected to a local MongoDB instance running an infinite loop running a simple find:

      Enterprise replset [direct: primary] locust_read_write_load> while (true) { var a = db.load.find({shardKey: 349601785}); }
      


      This morning when I logged back into the workstation, I see that it has crashed with the following stack trace (I have the core dump uploaded to this Amfora Portal):

      <--- Last few GCs --->
      
      [476978:0x3d8f1cd0]  1389689 ms: Scavenge 3873.6 (4125.2) -> 3861.2 (4125.2) MB, 13.32 / 2.45 ms  (average mu = 0.329, current mu = 0.326) task;
      [476978:0x3d8f1cd0]  1389795 ms: Scavenge 3875.4 (4126.3) -> 3863.0 (4126.3) MB, 15.33 / 2.42 ms  (average mu = 0.329, current mu = 0.326) task;
      [476978:0x3d8f1cd0]  1389895 ms: Scavenge 3876.8 (4127.7) -> 3864.7 (4127.7) MB, 15.05 / 2.40 ms  (average mu = 0.329, current mu = 0.326) task;
      
      
      <--- JS stacktrace --->
      
      FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
       1: 0xd1e754 node::Abort() [mongosh]
       2: 0xc1a6a0  [mongosh]
       3: 0xf1cb88 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [mongosh]
       4: 0xf1cd60 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [mongosh]
       5: 0x11198a0 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [mongosh]
       6: 0x1119c98 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [mongosh]
       7: 0x112eaf8 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [mongosh]
       8: 0x112f06c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [mongosh]
       9: 0x1179580 v8::internal::MinorGCJob::Task::RunInternal() [mongosh]
      10: 0xd860fc  [mongosh]
      11: 0xd89530 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [mongosh]
      12: 0x18121cc  [mongosh]
      13: 0x182714c  [mongosh]
      14: 0x1812fcc uv_run [mongosh]
      15: 0xc4a444 main [mongosh]
      16: 0xffff9a6e73fc  [/lib/aarch64-linux-gnu/libc.so.6]
      17: 0xffff9a6e74cc __libc_start_main [/lib/aarch64-linux-gnu/libc.so.6]
      18: 0xc52390  [mongosh]
      Aborted (core dumped)
      

      Steps to Reproduce

      Leave MongoSH running for very long time (don't know how long) with the following operation:

      Enterprise replset [direct: primary] locust_read_write_load> while (true) { var a = db.load.find({shardKey: 349601785}); }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: