[SERVER-14040] MapViewOfFileEx failed in repair_server12955.js Created: 23/May/14  Updated: 10/Dec/14  Resolved: 17/Jul/14

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

Type: Bug Priority: Major - P3
Reporter: Eric Milkie Assignee: Eric Milkie
Resolution: Incomplete Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Steps To Reproduce:

I ran smokeParallel in a loop on Windows using VS2013 until it failed.
I have the minidump and full log available.

Participants:

 Description   

2014-05-22T14:20:51.586-0400 [conn29] MapViewOfFileEx for /data/db/sconsTests\_tmp_repairDatabase_0\repair_server12955.0 at address 00000040D10F1000 failed with errno:1132 The base address or the file offset specified does not have the proper alignment. (file size is 67108864) in MemoryMappedFile::map                                        
2014-05-22T14:20:51.586-0400 [conn29] Fatal Assertion 16166                                                                                                                
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\util\stacktrace.cpp(172)                            mongo::printStackTrace+0x43                            
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\util\log.cpp(124)                                   mongo::logContext+0xd7                                 
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\util\assert_util.cpp(139)                           mongo::fassertFailed+0xbb                              
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\util\mmap_win.cpp(296)                              mongo::MemoryMappedFile::map+0x996                     
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\storage\durable_mapped_file.cpp(152)             mongo::DurableMappedFile::create+0x129                 
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\storage\data_file.cpp(150)                       mongo::DataFile::open+0x1c6                            
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\storage\mmap_v1\mmap_v1_extent_manager.cpp(160)  mongo::MmapV1ExtentManager::getFile+0x579              
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\storage\mmap_v1\mmap_v1_extent_manager.cpp(306)  mongo::MmapV1ExtentManager::_createExtent+0x148        
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\storage\mmap_v1\mmap_v1_extent_manager.cpp(412)  mongo::MmapV1ExtentManager::allocateExtent+0x71        
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\structure\record_store_v1_base.cpp(359)          mongo::RecordStoreV1Base::increaseStorageSize+0x46     
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\catalog\database.cpp(762)                        mongo::Database::createCollection+0x581                
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\catalog\database.cpp(797)                        mongo::Database::_addNamespaceToCatalog+0x31c          
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\catalog\database.cpp(716)                        mongo::Database::createCollection+0x3ae                
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\repair_database.cpp(370)                         mongo::repairDatabase+0x127d                           
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\dbcommands.cpp(298)                              mongo::CmdRepairDatabase::run+0x28f                    
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\dbcommands.cpp(1400)                             mongo::_execCommand+0x72                               
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\dbcommands.cpp(1585)                             mongo::Command::execCommand+0xdb5                      
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\dbcommands.cpp(1659)                             mongo::_runCommands+0x459                              
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\query\new_find.cpp(121)                          mongo::runCommands+0x43                                
2014-05-22T14:20:52.227-0400 [conn29] mongod.exe  ...\src\mongo\db\query\new_find.cpp(432)                          mongo::newRunQuery+0x3c1   



 Comments   
Comment by Eric Milkie [ 27/May/14 ]

I looked at the dump – nothing else is happening; the other interesting threads are blocked waiting to gain various dblocks.
I can run the test in a loop again; is there anything I can do as far as code modification or debugging output that would help here?

Comment by Eric Milkie [ 27/May/14 ]

I will take a look at the dump.
I'm not sure multiple files can be allocated by different threads at the same time. Shouldn't LockMongoFiles prevent that? I haven't looked at the code in detail yet.

Comment by Mark Benvenuto [ 23/May/14 ]

Is parallel.js allocating/deallocating multiple files in parallel? The answer to this question is probably yes. Did the dump should concurrent operations in this vane? If we can prove this happened, we can workaround it, but I am not going to add locks unless we can get to the bottom of this.

Comment by Eric Milkie [ 23/May/14 ]

The test was running in the parallel suite – is it possible that MapViewOfFileEx isn't threadsafe and some other thread in mongod called into a conflicting Windows system function?

Comment by Mark Benvenuto [ 23/May/14 ]

The allocation granularity is 0x1000, i.e. 4k, and this address is properly aligned since it ends in 0x1000. I do not see how this error could have occurred unless the wrong error code was returned by Windows.

Comment by Eric Milkie [ 23/May/14 ]

I don't understand how getNextMemoryMappedFileLocation() could provide a non-aligned address.

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