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-issue-importer opened this issue Oct 23, 2013 · 7 comments
Closed

AV in guardian at process shutdown [CORE4250] #4574

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

Comments

@firebird-issue-importer

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 23, 2013

Modified by: @hvlad

assignee: Vlad Khorsun [ hvlad ]

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 23, 2013

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 23, 2013

Commented by: @hvlad

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Oct 23, 2013

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-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Sep 22, 2015

Modified by: @pcisar

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

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented Jan 18, 2016

Modified by: @pavel-zotov

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

QA Status: No test

@firebird-issue-importer
Copy link
Author

@firebird-issue-importer firebird-issue-importer commented May 25, 2016

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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants