Skip to content

engine: free after log worker thread has been stopped#8486

Merged
edsiper merged 1 commit intofluent:masterfrom
hiroyha1:fix-memory-error
May 22, 2024
Merged

engine: free after log worker thread has been stopped#8486
edsiper merged 1 commit intofluent:masterfrom
hiroyha1:fix-memory-error

Conversation

@hiroyha1
Copy link
Contributor

In the current code, config->log_file may be referenced in the log_push function after it is freed. This fix frees log_file after calling flb_log_destroy function so that it waits for log_worker_collector function to exit.

Fixes #8429


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • [N/A] Example configuration file for the change
  • [N/A] Debug log output from testing the change

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [N/A] Run local packaging test showing all targets (including any new ones) build.
  • [N/A] Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • [N/A] Documentation required for this feature

Backporting

  • Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

Signed-off-by: Hiroyuki Hasebe <31443554+hiroyha1@users.noreply.github.com>
@hiroyha1
Copy link
Contributor Author

cc: @edsiper @leonardo-albertovich Could you please review this pr?

@RepinStyle
Copy link

@edsiper and @leonardo-albertovich - any update on this review?

1 similar comment
@RepinStyle
Copy link

@edsiper and @leonardo-albertovich - any update on this review?

@edsiper edsiper merged commit 9100098 into fluent:master May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

log_file may be used after free which cause generating garbage files

3 participants