-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: 2.1.2
-
Component/s: None
-
None
-
ALL
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
Observed behavior: The ttl thread seg faults if a collection is dropped between the system.indexes query and construction of the Client::WriteLock for the collection.
Expected behavior: no seg fault
If a collection observed in the system.indexes scan is dropped, the subsequent call to nsdetails() will return NULL causing a seg fault.
Test (note I dropped the ttl timeout to 1 second to reproduce easily):
c = db.c;
while( 1 ) {
c.ensureIndex( { a:1 }, { expireAfterSeconds:60 } );
c.drop();
}
Log:
Mon Jun 25 18:47:34 Invalid access at address: 0x1a4 from thread: TTLMonitor Mon Jun 25 18:47:34 Got signal: 11 (Segmentation fault: 11). Mon Jun 25 18:47:34 Backtrace: 0x104ac94b5 0x10477bdbe 0x10477bad9 0x10744acfa 0x104791023 0x104ab6e84 0x104ab5500 0x104a4acf8 0x104a4cb93 0x104a4cc92 0x104a4cd64 0x104a4cd8f 0x104d2de69 0x1073f68bf 0x1073f9b75 0 mongod 0x0000000104ac94b5 _ZN5mongo15printStackTraceERSo + 37 1 mongod 0x000000010477bdbe _ZN5mongo10abruptQuitEi + 446 2 mongod 0x000000010477bad9 _ZN5mongo24abruptQuitWithAddrSignalEiP9__siginfoPv + 537 3 libsystem_c.dylib 0x000000010744acfa _sigtramp + 26 4 mongod 0x0000000104791023 _ZStltIcSt11char_traitsIcESaIcEEbRKSbIT_T0_T1_ES8_ + 35 5 mongod 0x0000000104ab6e84 _ZN5mongo10TTLMonitor10doTTLForDBERKSs + 3742 6 mongod 0x0000000104ab5500 _ZN5mongo10TTLMonitor3runEv + 726 7 mongod 0x0000000104a4acf8 _ZN5mongo13BackgroundJob7jobBodyEN5boost10shared_ptrINS0_9JobStatusEEE + 1292 8 mongod 0x0000000104a4cb93 _ZNK5boost4_mfi3mf1IvN5mongo13BackgroundJobENS_10shared_ptrINS3_9JobStatusEEEEclEPS3_S6_ + 155 9 mongod 0x0000000104a4cc92 _ZN5boost3_bi5list2INS0_5valueIPN5mongo13BackgroundJobEEENS2_INS_10shared_ptrINS4_9JobStatusEEEEEEclINS_4_mfi3mf1IvS4_S9_EENS0_5list0EEEvNS0_4typeIvEERT_RT0_i + 138 10 mongod 0x0000000104a4cd64 _ZN5boost3_bi6bind_tIvNS_4_mfi3mf1IvN5mongo13BackgroundJobENS_10shared_ptrINS5_9JobStatusEEEEENS0_5list2INS0_5valueIPS5_EENSB_IS8_EEEEEclEv + 92 11 mongod 0x0000000104a4cd8f _ZN5boost6detail11thread_dataINS_3_bi6bind_tIvNS_4_mfi3mf1IvN5mongo13BackgroundJobENS_10shared_ptrINS7_9JobStatusEEEEENS2_5list2INS2_5valueIPS7_EENSD_ISA_EEEEEEE3runEv + 37 12 mongod 0x0000000104d2de69 thread_proxy + 169 13 libsystem_c.dylib 0x00000001073f68bf _pthread_start + 335 14 libsystem_c.dylib 0x00000001073f9b75 thread_start + 13