[SERVER-16506] race condition in currentOp Created: 11/Dec/14  Updated: 21/Aug/15  Resolved: 08/Jun/15

Status: Closed
Project: Core Server
Component/s: Concurrency
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Geert Bosch Assignee: Geert Bosch
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
duplicates SERVER-18277 Sanitize maxTimeMS and the CurOp type Closed
Related
related to SERVER-17077 jstests/core/evalc.js should not run ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

No reliable reproducer, but evalc.js occasionally triggers this on a debug build.

Sprint: Quint Iteration 3.1.2, Quint Iteration 5
Participants:
Linked BF Score: 0

 Description   

As evidenced by spurious failures in evalc.js, there is a race condition in the currentOp command that causes it to access freed memory.

The test failed due to timeout after the following failure:

2014-12-10 18:04:17 EST	
2014-12-10T23:04:17.327+0000 I CONTROL  [conn19] mongod.exe    ...\src\mongo\util\log.cpp(136)                                  mongo::logContext+0xd7
2014-12-10T23:04:17.327+0000 I CONTROL  [conn19] mongod.exe    ...\src\mongo\util\assert_util.cpp(212)                          mongo::msgasserted+0x114
2014-12-10T23:04:17.327+0000 I CONTROL  [conn19] mongod.exe    ...\src\mongo\util\assert_util.cpp(204)                          mongo::msgasserted+0x1a
2014-12-10T23:04:17.327+0000 I CONTROL  [conn19] mongod.exe    ...\src\mongo\util\net\message.h(83)                             mongo::opToString+0x124
2014-12-10T23:04:17.327+0000 I CONTROL  [conn19] mongod.exe    ...\src\mongo\db\curop.cpp(170)                                  mongo::CurOp::reportState+0x166
2014-12-10T23:04:17.327+0000 I CONTROL  [conn19] mongod.exe    ...\src\mongo\db\currentop_command.cpp(126)                      mongo::inProgCmd+0x80c
2014-12-10T23:04:17.327+0000 I CONTROL  [conn19] mongod.exe    ...\src\mongo\db\instance.cpp(328)                               mongo::assembleResponse+0x188
2014-12-10T23:04:17.327+0000 I CONTROL  [conn19] mongod.exe    ...\src\mongo\db\db.cpp(195)                                     mongo::MyMessageHandler::process+0xb6
2014-12-10T23:04:17.327+0000 I CONTROL  [conn19] mongod.exe    ...\src\mongo\util\net\message_server_port.cpp(235)              mongo::PortMessageServer::handleIncomingMsg+0x7ef
2014-12-10T23:04:17.327+0000 I CONTROL  [conn19] mongod.exe    ...\src\third_party\boost\libs\thread\src\win32\thread.cpp(185)  boost::`anonymous namespace'::thread_start_function+0x21
2014-12-10T23:04:17.327+0000 I CONTROL  [conn19] mongod.exe    f:\dd\vctools\crt\crtw32\startup\threadex.c(376)                 _callthreadstartex+0x25
2014-12-10T23:04:17.328+0000 I CONTROL  [conn19] mongod.exe    f:\dd\vctools\crt\crtw32\startup\threadex.c(359)                 _threadstartex+0xe7
2014-12-10T23:04:17.328+0000 I CONTROL  [conn19] kernel32.dll                                                                   BaseThreadInitThunk+0xd
2014-12-10T23:04:17.328+0000 I CONTROL  [conn19] 
2014-12-10T23:04:17.328+0000 I NETWORK  [conn19] AssertionException handling request, closing client connection: 16141 cannot translate opcode -842150451

The opcode corresponds to 0xCDCDCDCD, which is the fill code for deleted memory in the debug build.



 Comments   
Comment by Geert Bosch [ 08/Jun/15 ]

I would expect yes. On second thought, it may not be worth the time to
try to confirm this is fixed and we can instead just close it as such.

-Geert

Comment by Andy Schwerin [ 08/Jun/15 ]

geert.bosch, did this go away as part of SERVER-18277? My intention with that work was to make currentOp race-free.

Comment by Githook User [ 27/Apr/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-16506 Don't run as many currentOp commands to avoid spurious timeout

(cherry picked from commit 36642967c8cdb2b64e5ce8e87966abb329bdf369)
Branch: v3.0
https://github.com/mongodb/mongo/commit/b2cbcdce48096da0ba4e7edf58fe8023871b3fcb

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