Skip to content
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

Closed
firebird-automations opened this issue Oct 23, 2013 · 7 comments
Closed

AV in guardian at process shutdown [CORE4250] #4574

firebird-automations opened this issue Oct 23, 2013 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

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

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

description: Reported by arothstein

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.

=>

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.

@firebird-automations
Copy link
Collaborator Author

Commented by: @hvlad

Thanks to "arothstein" for the report and idea of the fix

@firebird-automations
Copy link
Collaborator Author

Modified by: @hvlad

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.5.3 [ 10461 ]

Fix Version: 3.0 Alpha 2 [ 10560 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test

@firebird-automations
Copy link
Collaborator Author

Modified by: @pavel-zotov

status: Closed [ 6 ] => Closed [ 6 ]

QA Status: No test => Cannot be tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants