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

exception while multiple threads exist can cause shell crash

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Tools
    • None

    Description

      I've written the multi thread testing code in the shell to avoid producing this bug, so it's low priority. Here's what happens:

      Program received signal EXC_BAD_ACCESS, Could not access memory.
      Reason: KERN_PROTECTION_FAILURE at address: 0x00000010
      [Switching to process 67102 thread 0x2103]
      0x0021c789 in v8::internal::ThreadManager::EagerlyArchiveThread ()
      (gdb) r
      The program being debugged has been started already.
      Start it from the beginning? (y or n) n
      Program not restarted.
      (gdb) bt
      #0 0x0021c789 in v8::internal::ThreadManager::EagerlyArchiveThread ()
      #1 0xb0103000 in ?? ()
      Cannot access memory at address 0xc0000007

      (Here using optimized (non debug) v8, but this bug is easy to reproduce.)

      To reproduce:

      diff --git a/shell/utils.js b/shell/utils.js
      index 9671545..b53f0f5 100644
      — a/shell/utils.js
      +++ b/shell/utils.js
      @@ -387,6 +387,7 @@ if ( typeof _threadInject != "undefined" ){
      }

      EventGenerator.prototype.addInsert = function( obj )

      { + this._add( "assert( false )" ); this._add( "t.insert( " + tojson( obj ) + " )" ); }

      @@ -562,11 +563,12 @@ if ( typeof _threadInject != "undefined" ){

      runners.forEach( function( x )

      { x.start(); }

      );
      var nFailed = 0;

      • runners.forEach( function( x )
        Unknown macro: { if( !x.returnData() ) { ++nFailed; } } );
        -
        - // v8 doesn't like it if we assert before all threads are joined. For now
        - // just avoid that possibility by asserting after threads are joined.
        - assert.eq( 0, nFailed, msg );
        + runners.forEach( function( x ) { assert( x.returnData() ); } );
        +// runners.forEach( function( x ) { if( !x.returnData() ) { ++nFailed; } }

        +//
        +// // v8 doesn't like it if we assert before all threads are joined. For n
        +// // just avoid that possibility by asserting after threads are joined.
        +// assert.eq( 0, nFailed, msg );
        }
        }

      and run ./mongo jstests/parallel/insert.js

      Attachments

        Activity

          People

            aaron Aaron Staple
            aaron Aaron Staple
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: