[SERVER-8880] mongo_sm.exe segfaults for certain configuration settings when building with VS2010 Created: 06/Mar/13  Updated: 11/Jul/16  Resolved: 07/Mar/13

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 2.4.0-rc3, 2.5.0

Type: Bug Priority: Trivial - P5
Reporter: Andrew Emil (Inactive) Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: Windows
Steps To Reproduce:

1) Build mongodb_sm.sln using one of the specified configurations
2) Run mongod so that there is a server running for shell to connect to
3) Run mongo_sm.exe

Participants:

 Description   

Certain VS2010 build configurations will cause mongo_sm.exe to segfault. Specifically, the builds that are known to do this now:

Release Win32
Release x64
Win2008PlusRelease Win32
Win2008PlusRelease x64

stack trace:

MongoDB shell version: 2.4.0-rc2-pre-
Tue Mar 05 23:35:32.278 mongo got signal 11 (SIGSEGV), stack trace:

Tue Mar 05 23:35:32.667 mongo_sm.exe ...\src\mongo\shell\dbshell.cpp(216)
quitAbruptly+0x14f
Tue Mar 05 23:35:32.668 mongo_sm.exe f:\dd\vctools\crt_bld\self_64_amd64\crt\sr
c\winxfltr.c(372) _XcptFilter+0x1ad
Tue Mar 05 23:35:32.668 mongo_sm.exe f:\dd\vctools\crt_bld\self_64_amd64\crt\sr
c\threadex.c(316) _callthreadstartex$filt$0+0x16
Tue Mar 05 23:35:32.668 mongo_sm.exe
__C_specific_handler+0x97
Tue Mar 05 23:35:32.668 ntdll.dll
RtlDecodePointer+0xbd
Tue Mar 05 23:35:32.668 ntdll.dll
RtlUnwindEx+0xbbf
Tue Mar 05 23:35:32.668 ntdll.dll
KiUserExceptionDispatcher+0x2e
Tue Mar 05 23:35:32.668 mongo_sm.exe ...\src\third_party\js-1.7\jsparse.c(972)
BindLocalVariable+0x3d
Tue Mar 05 23:35:32.669 mongo_sm.exe ...\src\third_party\js-1.7\jsparse.c(1876)
BindVarOrConst+0x3dd
Tue Mar 05 23:35:32.669 mongo_sm.exe ...\src\third_party\js-1.7\jsparse.c(3711)
Variables+0x1fa
Tue Mar 05 23:35:32.669 mongo_sm.exe ...\src\third_party\js-1.7\jsparse.c(3308)
Statement+0x1908
Tue Mar 05 23:35:32.670 mongo_sm.exe ...\src\third_party\js-1.7\jsparse.c(1463)
Statements+0x12a
Tue Mar 05 23:35:32.670 mongo_sm.exe ...\src\third_party\js-1.7\jsparse.c(502)
js_CompileTokenStream+0x72
Tue Mar 05 23:35:32.671 mongo_sm.exe ...\src\third_party\js-1.7\jsapi.c(3774)
CompileTokenStream+0x17e
Tue Mar 05 23:35:32.671 mongo_sm.exe ...\src\third_party\js-1.7\jsapi.c(3870)
JS_CompileUCScriptForPrincipals+0x70
Tue Mar 05 23:35:32.671 mongo_sm.exe ...\src\third_party\js-1.7\jsapi.c(4293)
JS_EvaluateUCScriptForPrincipals+0x50
Tue Mar 05 23:35:32.672 mongo_sm.exe ...\src\third_party\js-1.7\jsapi.c(4240)
JS_EvaluateScript+0xb2
Tue Mar 05 23:35:32.672 mongo_sm.exe ...\src\mongo\scripting\engine_spidermonke
y.cpp(1622) mongo::spidermonkey::SMScope::exec+0x13b
Tue Mar 05 23:35:32.673 mongo_sm.exe ...\src\mongo\scripting\engine.h(116)
mongo::Scope::execSetup+0x22
Tue Mar 05 23:35:32.673 mongo_sm.exe ...\src\mongo\scripting\engine.h(119)
mongo::Scope::execSetup+0x77



 Comments   
Comment by auto [ 07/Mar/13 ]

Author:

{u'date': u'2013-03-07T16:36:22Z', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-8880 Visual Studio – remove /OPT:REF and /OPT:ICF

The /OPT:REF (Optimize References) and /OPT:ICF (Enable COMDAT Folding)
Linker flags were set for Release and Win2008PlusRelease builds, which
does not match the link flags set for the scons build. Remove those
settings to match scons, and to fix the crashes in the SpiderMonkey builds.
Branch: master
https://github.com/mongodb/mongo/commit/08da87aa68a489dab7f24e059916b1ba2aa33452

Comment by Tad Marshall [ 07/Mar/13 ]

The setting of link options /OPT:REF and /OPT:ICF are the cause of this. These aren't needed and are not set in the scons build. Since the purpose of the Visual Studio projects is to provide IDE support for the same code that we build with scons, these options should be removed. This affects only the *.vcxproj files.

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