Subject Crash during garbage collection - 2.1.2 Embedded
Author mmcde
I am a developer working on a project that utilizes the embedded version of Firebird (2.1.2) on Win32. The application is written in C++ and the IBPP library is used. I have seen the following crash on several occasions now. This occurs after a nightly cleanup process that deletes a large number of records. Unfortunately, I am not able to reproduce it at will.

FAULTING_IP:
msvcr80!memmove+5a
7814537a f3a5 rep movs dword ptr es:[edi],dword ptr [esi]

EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 7814537a (msvcr80!memmove+0x0000005a)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000001
Parameter[1]: 06c50000
Attempt to write to address 06c50000

DEFAULT_BUCKET_ID: APPLICATION_FAULT

PROCESS_NAME: SecurityGateway.exe

ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at "0x%08lx" referenced memory at "0x%08lx". The memory could not be "%s".

WRITE_ADDRESS: 06c50000

BUGCHECK_STR: ACCESS_VIOLATION

NTGLOBALFLAG: 0

APPLICATION_VERIFIER_FLAGS: 0

LAST_CONTROL_TRANSFER: from 013797ed to 7814537a

STACK_TEXT:
01777834 013797ed 06c43a5c 06c43a60 fffffffc msvcr80!memmove+0x5a
0177784c 0137c6a7 00000081 0108d978 0177fea4 fbembed!Firebird::Array<Jrd::CachedLock *,Firebird::EmptyStorage<Jrd::CachedLock *> >::remove+0x2d [d:\fb21

\fb21_dev\r2_1_2\firebird2\src\common\classes\array.h @ 173]
01777874 0137f008 0177fea4 00000081 0177da78 fbembed!Jrd::LocksCache<Jrd::CachedLock>::get+0xd7 [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\lockscache.h @ 164]
01777898 0137f6dd 0177fea4 0177da78 0177db10 fbembed!Jrd::BtrPageGCLock::isPageGCAllowed+0x68 [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\btr.cpp @ 290]
0177d9ec 0138087d 0177fea4 000cf762 0177db10 fbembed!garbage_collect+0x4d [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\btr.cpp @ 4924]
0177da0c 0138085a 000cf762 0177db10 0177da78 fbembed!remove_node+0xdd [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\btr.cpp @ 6381]
0177da4c 0138094c 00113fee 0177db10 0177da78 fbembed!remove_node+0xba [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\btr.cpp @ 6376]
0177dab4 013c4204 0177fea4 0177daf8 0177db02 fbembed!BTR_remove+0x9c [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\btr.cpp @ 1865]
0177fc04 01343cfc 0177fea4 0177fc84 0177fc44 fbembed!IDX_garbage_collect+0x284 [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\idx.cpp @ 766]
0177fc58 013448c9 0177fea4 000f9eba 0177fc78 fbembed!garbage_collect+0x17c [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\vio.cpp @ 3797]
0177fcf4 013465c6 012acd58 00000000 0177fea4 fbembed!expunge+0xf9 [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\vio.cpp @ 3728]
0177fd84 01346aed 0177fe01 012378ec 00000000 fbembed!VIO_chase_record_version+0x616 [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\vio.cpp @ 907]
0177fdb0 0134a16c 00000003 0177fe34 00000000 fbembed!VIO_next_record+0x6d [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\vio.cpp @ 2476]
0177ff50 012f9c55 0108d978 279255c4 00000000 fbembed!garbage_collector+0x56c [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\vio.cpp @ 4031]
0177ff78 781329bb 0107df58 27a07b25 00000000 fbembed!`anonymous namespace'::threadStart+0x55 [d:\fb21\fb21_dev\r2_1_2\firebird2\src\jrd\threaddata.cpp @ 283]
0177ffb0 78132a47 00000000 77e6482f 01053c30 msvcr80!_endthreadex+0x3b
0177ffb8 77e6482f 01053c30 00000000 00000000 msvcr80!_endthreadex+0xc7
0177ffec 00000000 781329e1 01053c30 00000000 kernel32!BaseThreadStart+0x34


STACK_COMMAND: ~3s; .ecxr ; kb

FAULTING_THREAD: 00000d9c

FOLLOWUP_IP:
msvcr80!memmove+5a
7814537a f3a5 rep movs dword ptr es:[edi],dword ptr [esi]

SYMBOL_STACK_INDEX: 0

SYMBOL_NAME: msvcr80!memmove+5a

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: msvcr80

IMAGE_NAME: msvcr80.dll

DEBUG_FLR_IMAGE_TIMESTAMP: 471eb5ae

BUCKET_ID: ACCESS_VIOLATION_msvcr80!memmove+5a

FAILURE_BUCKET_ID: msvcr80.dll!memmove_c0000005_APPLICATION_FAULT

Followup: MachineOwner
---------