New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AV in guardian at process shutdown [CORE4250] #4574
Comments
Modified by: @hvladassignee: Vlad Khorsun [ hvlad ] |
Modified by: @hvladdescription: Reported by arothstein When guardian is run as a service main thread could run cleanup procedures while watcher thread is still worked. => Reported by arothstein : In Windows, Firebird service fbguard.exe has a synchronization error in its shutdown logic. In normal execution the error occurs rarely, maybe never. To see the error, add a 1 second delay just before the write_log(IDS_LOG_STOP) call in start_and_watch_server; and a 2 second delay after the external_free(extents_cache) loop in MemoryPool::cleanup. The write_log call then references the freed memory, the resulting exception is unhandled by fbguard, and the OS's unhandled exception filter terminates the process. The IDS_LOG_STOP message does not reach the Windows event log. Mine comment: |
Commented by: @hvlad Thanks to "arothstein" for the report and idea of the fix |
Modified by: @hvladstatus: Open [ 1 ] => Resolved [ 5 ] resolution: Fixed [ 1 ] Fix Version: 2.5.3 [ 10461 ] Fix Version: 3.0 Alpha 2 [ 10560 ] |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovstatus: Closed [ 6 ] => Closed [ 6 ] QA Status: No test => Cannot be tested |
Submitted by: @hvlad
Reported by arothstein :
In Windows, Firebird service fbguard.exe has a synchronization error in its shutdown logic. In normal execution the error occurs rarely, maybe never. To see the error, add a 1 second delay just before the write_log(IDS_LOG_STOP) call in start_and_watch_server; and a 2 second delay after the external_free(extents_cache) loop in MemoryPool::cleanup. The write_log call then references the freed memory, the resulting exception is unhandled by fbguard, and the OS's unhandled exception filter terminates the process. The IDS_LOG_STOP message does not reach the Windows event log.
Mine comment:
When guardian is run as a service main thread could run cleanup procedures while watcher thread is still worked.
In this case AV in watcher thread could happen.
Commits: d17940c 7ce9758 FirebirdSQL/fbt-repository@396bab7 FirebirdSQL/fbt-repository@50f6483
The text was updated successfully, but these errors were encountered: