[SERVER-23588] mongod with WiredTiger won't start on Windows when built with --dbg=on --opt=off Created: 06/Apr/16 Updated: 22/Nov/16 Resolved: 08/Apr/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | WiredTiger |
| Affects Version/s: | 3.3.5 |
| Fix Version/s: | 3.2.6, 3.3.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kaloian Manassiev | Assignee: | Alexander Gorrod |
| Resolution: | Done | Votes: | 0 |
| Labels: | code-only | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Completed: | |||||||||
| Steps To Reproduce: | Build mongod.exe with the following command line:
|
||||||||
| Participants: | |||||||||
| Description |
|
The WT bootstrap code double-opens the .turtle file, which causes validation exception and process termination in Windows debug builds. The second open happens at this line and the file has previously been opened here. With this problem debug builds on Windows are unusable and evergreen does not catch it because we build with --dbg=on --opt=off, which includes the release runtime. This is the call stack:
This is the error:
|
| Comments |
| Comment by Githook User [ 14/Apr/16 ] | |
|
Author: {u'name': u'Ramon Fernandez', u'email': u'ramon@mongodb.com'}Message: Import wiredtiger-wiredtiger-2.8.0-201-g7ea2631.tar.gz from wiredtiger branch mongodb-3.2 ref: 43e885a..7ea2631
| |
| Comment by Githook User [ 08/Apr/16 ] | |
|
Author: {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'}Message: Merge pull request #2638 from wiredtiger/server-23588-win-fopen
| |
| Comment by Githook User [ 08/Apr/16 ] | |
|
Author: {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexg@wiredtiger.com'}Message: It introduced some odd failures on debug MongoDB builds. Switch | |
| Comment by Githook User [ 08/Apr/16 ] | |
|
Author: {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexg@wiredtiger.com'}Message: Import wiredtiger-wiredtiger-2.8.0-140-g7bcf6fc.tar.gz from wiredtiger branch mongodb-3.4 ref: 94c171d..7bcf6fc
| |
| Comment by Githook User [ 08/Apr/16 ] | |
|
Author: {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'}Message: Merge pull request #2638 from wiredtiger/server-23588-win-fopen
| |
| Comment by Githook User [ 08/Apr/16 ] | |
|
Author: {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexg@wiredtiger.com'}Message: It introduced some odd failures on debug MongoDB builds. Switch | |
| Comment by Githook User [ 08/Apr/16 ] | |
|
Author: {u'username': u'michaelcahill', u'name': u'Michael Cahill', u'email': u'michael.cahill@mongodb.com'}Message: Merge pull request #2638 from wiredtiger/server-23588-win-fopen
| |
| Comment by Githook User [ 08/Apr/16 ] | |
|
Author: {u'username': u'agorrod', u'name': u'Alex Gorrod', u'email': u'alexg@wiredtiger.com'}Message: It introduced some odd failures on debug MongoDB builds. Switch | |
| Comment by Alexander Gorrod [ 08/Apr/16 ] | |
|
Thanks kaloian.manassiev I was able to reproduce when I included the enterprise modules. I didn't have much luck figuring out where we were going wrong with the API usage exactly, but I ended up switching out our usage of _os_openfhandle and fdopen to using fopen instead. With that change, our code became simpler and the problem was resolved. I've pushed that change into a pull request (https://github.com/wiredtiger/wiredtiger/pull/2638). | |
| Comment by Kaloian Manassiev [ 07/Apr/16 ] | |
|
Thanks, Alex. I looked into this a little bit more and I noticed that it only happens when enterprise mongod.exe is built with --dbg=on --opt=off, but does not happen when only building the free version. This is the command line I used, which should apply for spawnhost:
As far as msvcr120.dll is involved, I am not sure why this gets linked when using these parameters. mark.benvenuto, do you have any idea? | |
| Comment by Alexander Gorrod [ 07/Apr/16 ] | |
|
Another thing I noticed is that the stack trace you posted is using msvcr120.dll, but you mention building against the debug version which would be msvcr120d.dll. | |
| Comment by Alexander Gorrod [ 07/Apr/16 ] | |
|
kaloian.manassiev I've attempted to reproduce the failure you mention without success. I've also reviewed the code, and it appears reasonable to me. It follows the pattern outlined on StackOverflow here: http://stackoverflow.com/questions/7369445/is-there-a-windows-equivalent-to-fdopen-for-handles, which appears to comply with the Windows documentation for the functionality. Could you provide some additional information about the failure? I'm using an Evergreen Windows VS 2013 spawn host. I created a build as per your instructions in the ticket description. I started mongod from both a clean dbpath and a dbpath with an existing database (with and without content). I notice that you use --dbg=on --opt=off in both the build steps, and the reason why Evergreen doesn't encounter the problem. Do I need to do something else to link against debug runtime libraries on Windows? |