[SERVER-7617] V8 assertion from running ./test in debug mode Created: 11/Nov/12  Updated: 11/Jul/16  Resolved: 18/Nov/12

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: 2.3.1
Fix Version/s: 2.3.1

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: buildbot
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-2407 Switch to v8 Closed
Duplicate
is duplicated by SERVER-7620 V8 failure in jstests/and.js on OS X ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Running the js suite in test will hit an assertion where V8 is attempting to load a value from thread local storage:

./test js
 
<etc>
Sun Nov 11 11:20:53.405 [testsuite] info PageFaultRetryableSection will not yield, already locked upon reaching
 
 
#
# Fatal error in src/third_party/v8/src/objects-inl.h, line 1126
# CHECK(heap->isolate() == Isolate::Current()) failed
#
 

The jstests/and.js unit test also hits this issue.



 Comments   
Comment by auto [ 16/Nov/12 ]

Author:

{u'date': u'2012-11-16T16:48:42Z', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'}

Message: SERVER-7617 Use V8_SIMPLE_HEADER in V8Scope::hasOutOfMemoryException()

Use our standard macro to set our state in V8Scope::hasOutOfMemoryException()
before calling _context->HasOutOfMemoryException().
Branch: master
https://github.com/mongodb/mongo/commit/879fb0899b1d0f3530ee0f01364f5d808d8ef706

Comment by Tad Marshall [ 14/Nov/12 ]

The earlier fix caused jstests/ora.js to segfault on all platforms (SERVER-7650).

Comment by auto [ 14/Nov/12 ]

Author:

{u'date': u'2012-11-14T15:24:01Z', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'}

Message: Revert "SERVER-7617 Enter and Exit our scope's Isolate in V8"

This reverts commit a2e429d299dbb5bd58dc3ecca8918b89ac17ae59.
Branch: master
https://github.com/mongodb/mongo/commit/789b09ef9bb6bb72a53953a364173f2aa5e48003

Comment by auto [ 13/Nov/12 ]

Author:

{u'date': u'2012-11-12T15:53:59Z', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'}

Message: SERVER-7617 Enter and Exit our scope's Isolate in V8

Added Scope::enter() and exit() member functions, only doing something
in V8 builds, to enter and exit the Isolate of the Scope we are using.
Call these functions when fetching a Scope from the pool/ScopeCache and
when returning one to the pool or deleting one. The Isolate is the actual
"state" container for V8, so many things don't work properly if this isn't
set up. There may be other situations where we need this, but this fixes
(at least) this particular case.
Branch: master
https://github.com/mongodb/mongo/commit/a2e429d299dbb5bd58dc3ecca8918b89ac17ae59

Comment by Tad Marshall [ 11/Nov/12 ]

Testing the 64-bit debug Windows build built with scons:

Sun Nov 11 14:14:00.188 [testsuite]      going to run test: class JSTests::ObjectMapping
Sun Nov 11 14:14:00.550 [testsuite]      going to run test: class JSTests::ObjectDecoding
Sun Nov 11 14:14:00.899 [testsuite]      going to run test: class JSTests::JSOIDTests
Sun Nov 11 14:14:00.899 [testsuite]      going to run test: class JSTests::SetImplicit
Sun Nov 11 14:14:01.246 [testsuite]      going to run test: class JSTests::ObjectModReadonlyTests
cannot write property y to read-only object
cannot write property a to read-only object
cannot write property a to read-only object
cannot delete property x from read-only object
Sun Nov 11 14:14:01.602 [testsuite]      going to run test: class JSTests::OtherJSTypes
Sun Nov 11 14:14:01.966 [testsuite]      going to run test: class JSTests::SpecialDBTypes
Sun Nov 11 14:14:02.314 [testsuite]      going to run test: class JSTests::TypeConservation
Sun Nov 11 14:14:02.664 [testsuite]      going to run test: class JSTests::NumberLong
Sun Nov 11 14:14:03.170 [testsuite] _DEBUG ReadContext db wasn't open, will try to open blah.system.js
Sun Nov 11 14:14:03.170 [testsuite] opening db:  blah
Sun Nov 11 14:14:03.184 [testsuite]      going to run test: class JSTests::NumberLong2
Sun Nov 11 14:14:03.714 [testsuite]      going to run test: class JSTests::RenameTest
Sun Nov 11 14:14:04.061 [testsuite]      going to run test: class JSTests::WeirdObjects
Sun Nov 11 14:14:04.680 [testsuite]      going to run test: class JSTests::CodeTests
Sun Nov 11 14:14:05.031 [testsuite]      going to run test: class JSTests::DBRefTest
Sun Nov 11 14:14:05.031 [testsuite] opening db:  unittest
Sun Nov 11 14:14:05.032 [testsuite] CMD: drop unittest.dbref.a
Sun Nov 11 14:14:05.032 [testsuite] CMD: drop unittest.dbref.b
Sun Nov 11 14:14:05.033 [FileAllocator] allocating new datafile /tmp/unittest\unittest.ns, filling with zeroes...
Sun Nov 11 14:14:05.111 [FileAllocator] done allocating datafile /tmp/unittest\unittest.ns, size: 16MB,  took 0.077 secs
Sun Nov 11 14:14:05.115 [FileAllocator] allocating new datafile /tmp/unittest\unittest.0, filling with zeroes...
Sun Nov 11 14:14:05.193 [FileAllocator] done allocating datafile /tmp/unittest\unittest.0, size: 16MB,  took 0.077 secs
Sun Nov 11 14:14:05.193 [testsuite] datafileheader::init initializing /tmp/unittest\unittest.0 n:0
Sun Nov 11 14:14:05.195 [testsuite] build index unittest.dbref.a { _id: 1 }
Sun Nov 11 14:14:05.196 [testsuite] build index done.  scanned 0 total records. 0.001 secs
Sun Nov 11 14:14:05.197 [testsuite] insert unittest.dbref.a keyUpdates:0 locks(micros) w:163964 163ms
Sun Nov 11 14:14:05.197 [testsuite] build index unittest.dbref.b { _id: 1 }
Sun Nov 11 14:14:05.199 [testsuite] build index done.  scanned 0 total records. 0.001 secs
 
 
#
# Fatal error in g:\visual studio 2010 projects\mongodev\src\third_party\v8\src\objects-inl.h, line 1126
# CHECK(heap->isolate() == Isolate::Current()) failed
#

>Debug.ListCallStack
 Index  Function
--------------------------------------------------------------------------------
 1      test.exe!v8::internal::OS::DebugBreak() 
 2      test.exe!v8::internal::OS::Abort() 
 3      test.exe!V8_Fatal(const char * file=0x0000000141276700, int line=0x00000466, const char * format=0x0000000141276760, ...) 
 4      test.exe!v8::internal::HeapObject::GetHeap() 
 5      test.exe!v8::internal::Object::IsContext() 
 6      test.exe!v8::internal::Context::cast(v8::internal::Object * context=0x0000000078f14679) 
 7      test.exe!v8::internal::GlobalObject::global_context() 
 8      test.exe!v8::internal::Context::global_context() 
*9      test.exe!v8::internal::Context::has_out_of_memory() 
 10     test.exe!v8::Context::HasOutOfMemoryException() 
 11     test.exe!mongo::V8Scope::hasOutOfMemoryException() 
 12     test.exe!mongo::ScopeCache::done(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & pool="unittest", mongo::Scope * s=0x00000000039f5cd0) 
 13     test.exe!mongo::PooledScope::~PooledScope() 
 14     test.exe!mongo::PooledScope::`scalar deleting destructor'() 
 15     test.exe!std::auto_ptr<mongo::Scope>::~auto_ptr<mongo::Scope>() 
 16     test.exe!mongo::dbEval(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & dbName="unittest", mongo::BSONObj & cmd={...}, mongo::BSONObjBuilder & result={...}, std::basic_string<char,std::char_traits<char>,std::allocator<char> > & errmsg="") 
 17     test.exe!mongo::CmdEval::run(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & dbname="unittest", mongo::BSONObj & cmdObj={...}, int __formal=0x00000000, std::basic_string<char,std::char_traits<char>,std::allocator<char> > & errmsg="", mongo::BSONObjBuilder & result={...}, bool fromRepl=false) 
 18     test.exe!mongo::_execCommand(mongo::Command * c=0x0000000141c9d298, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & dbname="unittest", mongo::BSONObj & cmdObj={...}, int queryOptions=0x00000000, mongo::BSONObjBuilder & result={...}, bool fromRepl=false) 
 19     test.exe!mongo::execCommand(mongo::Command * c=0x0000000141c9d298, mongo::Client & client={...}, int queryOptions=0x00000000, const char * cmdns=0x0000000001e5df14, mongo::BSONObj & cmdObj={...}, mongo::BSONObjBuilder & result={...}, bool fromRepl=false) 
 20     test.exe!mongo::_runCommands(const char * ns=0x0000000001e5df14, mongo::BSONObj & _cmdobj={...}, mongo::_BufBuilder<mongo::TrivialAllocator> & b={...}, mongo::BSONObjBuilder & anObjBuilder={...}, bool fromRepl=false, int queryOptions=0x00000000) 
 21     test.exe!mongo::runCommands(const char * ns=0x0000000001e5df14, mongo::BSONObj & jsobj={...}, mongo::CurOp & curop={...}, mongo::_BufBuilder<mongo::TrivialAllocator> & b={...}, mongo::BSONObjBuilder & anObjBuilder={...}, bool fromRepl=false, int queryOptions=0x00000000) 
 22     test.exe!mongo::runQuery(mongo::Message & m={...}, mongo::QueryMessage & q={...}, mongo::CurOp & curop={...}, mongo::Message & result={...}) 
 23     test.exe!mongo::receivedQuery(mongo::Client & c={...}, mongo::DbResponse & dbresponse={...}, mongo::Message & m={...}) 
 24     test.exe!mongo::assembleResponse(mongo::Message & m={...}, mongo::DbResponse & dbresponse={...}, const mongo::HostAndPort & remote={...}) 
 25     test.exe!mongo::DBDirectClient::call(mongo::Message & toSend={...}, mongo::Message & response={...}, bool assertOk=false, std::basic_string<char,std::char_traits<char>,std::allocator<char> > * actualServer=0x0000000059e30e38 "DBDirectClient") 
 26     test.exe!mongo::DBClientCursor::init() 
 27     test.exe!mongo::DBClientBase::query(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & ns="unittest.$cmd", mongo::Query * query=0x000000000027c980, int nToReturn=0x00000001, int nToSkip=0x00000000, const mongo::BSONObj * fieldsToReturn=0x0000000000000000, int queryOptions=0x00000000, int batchSize=0x00000000) 
 28     test.exe!mongo::DBDirectClient::query(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & ns="unittest.$cmd", mongo::Query * query=0x000000000027cc40, int nToReturn=0x00000001, int nToSkip=0x00000000, const mongo::BSONObj * fieldsToReturn=0x0000000000000000, int queryOptions=0x00000000, int batchSize=0x00000000) 
 29     test.exe!mongo::DBClientInterface::findN(std::vector<mongo::BSONObj,std::allocator<mongo::BSONObj> > & out=[0x00000000](), const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & ns="unittest.$cmd", mongo::Query * query=0x000000000027cdb8, int nToReturn=0x00000001, int nToSkip=0x00000000, const mongo::BSONObj * fieldsToReturn=0x0000000000000000, int queryOptions=0x00000000) 
 30     test.exe!mongo::DBClientInterface::findOne(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & ns="unittest.$cmd", const mongo::Query & query={...}, const mongo::BSONObj * fieldsToReturn=0x0000000000000000, int queryOptions=0x00000000) 
 31     test.exe!mongo::DBClientWithCommands::runCommand(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & dbname="unittest", const mongo::BSONObj & cmd={...}, mongo::BSONObj & info={...}, int options=0x00000000, const mongo::AuthenticationTable * auth=0x0000000000000000) 
 32     test.exe!mongo::DBClientWithCommands::eval(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & dbname="unittest", const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & jscode="x = db.dbref.b.findOne(); assert.eq( 17 , x.c.fetch().a , 'ref working' );", mongo::BSONObj & info={...}, mongo::BSONElement & retValue={...}, mongo::BSONObj * args=0x0000000000000000) 
 33     test.exe!mongo::DBClientWithCommands::eval(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & dbname="unittest", const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & jscode="x = db.dbref.b.findOne(); assert.eq( 17 , x.c.fetch().a , 'ref working' );") 
 34     test.exe!JSTests::DBRefTest::run() 
 35     test.exe!mongo::unittest::Suite::runTestObject<JSTests::DBRefTest>() 
 36     test.exe!boost::detail::function::void_function_invoker0<void (__cdecl*)(void),void>::invoke(boost::detail::function::function_buffer & function_ptr={...}) 
 37     test.exe!boost::function0<void>::operator()() 
 38     test.exe!mongo::unittest::TestHolder::run() 
 39     test.exe!mongo::unittest::Suite::run(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & filter="", int runsPerTest=0x00000001) 
 40     test.exe!mongo::unittest::Suite::run(const std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > & suites=[0x00000000](), const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & filter="", int runsPerTest=0x00000001) 
 41     test.exe!mongo::dbtests::runDbTests(int argc=0x00000001, char * * argv=0x00000000002a4020, std::basic_string<char,std::char_traits<char>,std::allocator<char> > * default_dbpath=0x000000000027f840 "/tmp/unittest") 
 42     test.exe!main(int argc=0x00000001, char * * argv=0x00000000002a4020, char * * envp=0x00000000002a4080) 
 43     test.exe!__tmainCRTStartup() 
 44     test.exe!mainCRTStartup() 
 45     kernel32.dll!BaseThreadInitThunk() 
 46     ntdll.dll!RtlUserThreadStart() 
 
>

Generated at Thu Feb 08 03:15:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.