diff --git a/buildscripts/errorcodes.py b/buildscripts/errorcodes.py index 79f0f0fa154..f5da6d59841 100755 --- a/buildscripts/errorcodes.py +++ b/buildscripts/errorcodes.py @@ -35,7 +35,7 @@ def readErrorCodes( callback, replaceZero = False ): quick = [ "assert" , "Exception" , "verify" ] - ps = [ re.compile( "(([umsg]asser(t|ted))) *\(( *)(\d+)" ) , + ps = [ re.compile( "(([umsgf]asser(t|ted))) *\(( *)(\d+)" ) , re.compile( "((User|Msg|MsgAssertion)Exceptio(n))\(( *)(\d+)" ) , re.compile( "(((verify))) *\(( *)(\d+)" ) ] diff --git a/src/mongo/db/d_concurrency.cpp b/src/mongo/db/d_concurrency.cpp old mode 100755 new mode 100644 index bcfbf24b53f..e9d8f0cdf6b --- a/src/mongo/db/d_concurrency.cpp +++ b/src/mongo/db/d_concurrency.cpp @@ -203,7 +203,7 @@ namespace mongo { LockState& ls = lockState(); if( ls.threadState ) { log() << "can't lock_W, threadState=" << (int) ls.threadState << endl; - fassert(0,false); + fassert(16114,false); } getDur().commitIfNeeded(); // check before locking - will use an R lock for the commit if need to do one, which is better than W threadState() = 'W'; @@ -361,7 +361,7 @@ namespace mongo { LockState& ls = lockState(); ls.recursive++; if( ls.recursive == 1 ) { - fassert(0, ls.scopedLk == 0); + fassert(16115, ls.scopedLk == 0); ls.scopedLk = this; } } @@ -383,9 +383,9 @@ namespace mongo { if( cant ) return; LockState& ls = lockState(); - fassert( 0, ls.recursive == 1 ); - fassert( 0, ls.threadState ); - fassert( 0, ls.scopedLk ); + fassert( 16116, ls.recursive == 1 ); + fassert( 16117, ls.threadState ); + fassert( 16118, ls.scopedLk ); ls.recursive--; ls.scopedLk->tempRelease(); scopedLk = ls.scopedLk; @@ -397,37 +397,37 @@ namespace mongo { return; LockState& ls = lockState(); ls.recursive++; - fassert( 0, scopedLk ); - fassert( 0, ls.scopedLk==NULL ); + fassert( 16119, scopedLk ); + fassert( 16120, ls.scopedLk==NULL ); ls.scopedLk = scopedLk; ls.scopedLk->relock(); } void Lock::GlobalWrite::tempRelease() { - fassert(0, !noop); + fassert(16121, !noop); char ts = threadState(); - fassert(0, ts != 'R'); // indicates downgraded; not allowed with temprelease - fassert(0, ts == 'W'); - fassert(0, !stoppedGreed); // not allowed with temprelease + fassert(16122, ts != 'R'); // indicates downgraded; not allowed with temprelease + fassert(16123, ts == 'W'); + fassert(16124, !stoppedGreed); // not allowed with temprelease unlock_W(); } void Lock::GlobalWrite::relock() { - fassert(0, !noop); + fassert(16125, !noop); char ts = threadState(); - fassert(0, ts == 0); + fassert(16126, ts == 0); lock_W(); } void Lock::GlobalRead::tempRelease() { - fassert(0, !noop); + fassert(16127, !noop); char ts = threadState(); - fassert(0, ts == 'R'); + fassert(16128, ts == 'R'); unlock_R(); } void Lock::GlobalRead::relock() { - fassert(0, !noop); + fassert(16129, !noop); char ts = threadState(); - fassert(0, ts == 0); + fassert(16130, ts == 0); lock_R(); } @@ -549,7 +549,7 @@ namespace mongo { if( ls.nestableCount ) { if( db != ls.whichNestable ) { error() << "can't lock local and admin db at the same time " << (int) db << ' ' << (int) ls.whichNestable << endl; - fassert(0,false); + fassert(16131,false); } assert( ls.nestableCount > 0 ); } @@ -557,7 +557,7 @@ namespace mongo { ls.whichNestable = db; ourCounter = &ls.nestableCount; ls.nestableCount++; - fassert(0,weLocked==0); + fassert(16132,weLocked==0); weLocked = nestableLocks[db]; weLocked->lock(); } @@ -571,7 +571,7 @@ namespace mongo { ls.whichNestable = db; ourCounter = &ls.nestableCount; ls.nestableCount--; - fassert(0,weLocked==0); + fassert(16133,weLocked==0); weLocked = nestableLocks[db]; weLocked->lock_shared(); } @@ -603,7 +603,7 @@ namespace mongo { lock = new SimpleRWLock(); ls.otherLock = lock; } - fassert(0,weLocked==0); + fassert(16134,weLocked==0); ls.otherLock->lock(); weLocked = ls.otherLock; } @@ -780,7 +780,7 @@ namespace mongo { lock = new SimpleRWLock(); ls.otherLock = lock; } - fassert(0,weLocked==0); + fassert(16135,weLocked==0); ls.otherLock->lock_shared(); weLocked = ls.otherLock; } diff --git a/src/mongo/db/dur.cpp b/src/mongo/db/dur.cpp index 47339add132..09ab9ebfb35 100644 --- a/src/mongo/db/dur.cpp +++ b/src/mongo/db/dur.cpp @@ -271,8 +271,8 @@ namespace mongo { if( t == 'R' || t == 'W' ) return; // 'w' case we use runExclusively - fassert( 0, t == 'w' ); - fassert( 0, in_f == 1 ); + fassert( 16110, t == 'w' ); + fassert( 16111, in_f == 1 ); } /** we may need to commit earlier than normal if data are being written at diff --git a/src/mongo/db/mongommf.cpp b/src/mongo/db/mongommf.cpp index 952f848f5ac..5767d92ffb1 100644 --- a/src/mongo/db/mongommf.cpp +++ b/src/mongo/db/mongommf.cpp @@ -148,7 +148,7 @@ namespace mongo { //privateViews.remove(_view_private); _view_private = remapPrivateView(_view_private); //privateViews.add(_view_private, this); - fassert( 0, _view_private == old ); + fassert( 16112, _view_private == old ); } /** register view. threadsafe */ diff --git a/src/mongo/db/repl/rs_sync.cpp b/src/mongo/db/repl/rs_sync.cpp index 689a2faca6f..122bb7539d9 100644 --- a/src/mongo/db/repl/rs_sync.cpp +++ b/src/mongo/db/repl/rs_sync.cpp @@ -636,7 +636,7 @@ namespace mongo { return; } - fassert(0, !Lock::isLocked()); + fassert(16113, !Lock::isLocked()); try { _syncThread(); diff --git a/src/mongo/util/concurrency/qlock.h b/src/mongo/util/concurrency/qlock.h index e235190a93d..a87cfd25f2b 100644 --- a/src/mongo/util/concurrency/qlock.h +++ b/src/mongo/util/concurrency/qlock.h @@ -218,7 +218,7 @@ namespace mongo { boost::mutex::scoped_lock lk(m); assert( R.n > 0 && W.n == 0 ); U.n++; - fassert( 0, U.n == 1 ); // for now we only allow one upgrade attempter + fassert( 16136, U.n == 1 ); // for now we only allow one upgrade attempter int pass = 0; while( W.n + R.n + w.n + r.n > 1 ) { if( ++pass >= 3 ) { @@ -256,25 +256,25 @@ namespace mongo { inline void QLock::unlock_r() { boost::mutex::scoped_lock lk(m); - fassert(0, r.n > 0); + fassert(16137, r.n > 0); if( --r.n == 0 ) notifyWeUnlocked('r'); } inline void QLock::unlock_w() { boost::mutex::scoped_lock lk(m); - fassert(0, w.n > 0); + fassert(16138, w.n > 0); if( --w.n == 0 ) notifyWeUnlocked('w'); } inline void QLock::unlock_R() { boost::mutex::scoped_lock lk(m); - fassert(0, R.n > 0); + fassert(16139, R.n > 0); if( --R.n == 0 ) notifyWeUnlocked('R'); } inline void QLock::unlock_W() { boost::mutex::scoped_lock lk(m); - fassert(0, W.n == 1); + fassert(16140, W.n == 1); W.n--; notifyWeUnlocked('W'); }