Fix mainloop call crash on freebsd#4262
Merged
MrAnno merged 2 commits intoDec 29, 2022
Merged
Conversation
As a preparation for fixing syslog-ng#4258, this patch extracts a few lines as a new function from main_loop_call(). The goal of the new function is to wait for any pending executions of mainloop-calls, which can happen if a worker thread submits a new one while the old is still executing. At the moment, there can be only ONE outstanding mainloop-calls at the same time. Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
…ead deinit time As explained in syslog-ng#4258, a crash can happen in syslog-ng if a worker thread exits while a mainloop call is still being processed. The solution is to prevent the worker from exiting until that pending call is finished. NOTE: in this state the worker is not going to execute tasks, but for all ivykis knows this thread does not really exist anymore. So if the workpool requires new threads, they are going to be launched, while this exists in limbo. Reported-by: @chucksilvers Signed-off-by: Balazs Scheidler <bazsi77@gmail.com>
7fce9b8 to
e415a87
Compare
Contributor
|
No news file has been detected. Please write one, if applicable. |
Contributor
|
Build FAILURE |
Collaborator
Author
|
Btw I reproduced the issue by inserting a sleep(15) into a mainloop_call handler, to trigger a worker exit while the call is executing. The one I used was the ml_batched_timer()'s update function. |
MrAnno
approved these changes
Dec 29, 2022
alltilla
added a commit
to alltilla/syslog-ng
that referenced
this pull request
Feb 14, 2023
…yslog-ng#4302, syslog-ng#4305, syslog-ng#4313 Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
Genfood
pushed a commit
to Genfood/syslog-ng
that referenced
this pull request
Jun 14, 2023
…yslog-ng#4302, syslog-ng#4305, syslog-ng#4313 Signed-off-by: Attila Szakacs <szakacs.attila96@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The patches in this branch fixes #4258.
Thanks a lot for @chucksilvers for the diagnosis and the proposed fix. At the end I wasn't using the proposed fix as it was, but I did included a Reported-By header. This fix would probably not exist today if it wasn't your hard work to reproduce and diagnose the issue.