Skip to content

config: error configure_plugins_type on invalid properties #10296

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

Merged
merged 2 commits into from
May 29, 2025

Conversation

stoksc
Copy link
Contributor

@stoksc stoksc commented May 6, 2025

After this change, when a plugin configuration contains an invalid property, configure_plugins_type returns an error which ultimately crashes fluentbit, instead of only printing an error log and continuing on. The change also fixes a small issue where name was printed by flb_error after it was freed. To properly test this change and get the test to pass with -DSANITIZE_ADDRESS=On on all platforms, I had to update configure_plugins_type to free objects that it fails to instantiate.


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

Added tests, so the configuration files and outputs can be found there.

  • [N/A] Attached Valgrind output that shows no leaks or memory corruption was found

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.

@stoksc stoksc force-pushed the stoksc/invalid-input-property branch from 82e5741 to ea1ea67 Compare May 6, 2025 19:46
@stoksc stoksc force-pushed the stoksc/invalid-input-property branch from 511c426 to e85d7f7 Compare May 6, 2025 21:20
@stoksc stoksc force-pushed the stoksc/invalid-input-property branch 2 times, most recently from e85d7f7 to ffffa03 Compare May 9, 2025 21:10
@stoksc stoksc force-pushed the stoksc/invalid-input-property branch 2 times, most recently from 677fc73 to df46f10 Compare May 12, 2025 16:03
@leonardo-albertovich
Copy link
Collaborator

Nope, it passes, I approve it, tag it if possible and ping @edsiper so he merges it when he considers it appropriate.

@edsiper
Copy link
Member

edsiper commented May 22, 2025

thanks for this contribution. Code looks good to me.

To get this merged, please split the commits per interface, now there is 1 commit but 2 interfaces are being touched:

image

something like:

  • config: ..
  • tests: internal: config_format_yaml: ....

After this change, when a plugin configuration contains an invalid property,
`configure_plugins_type` returns an error which ultimately crashes fluentbit,
instead of only printing an error log and continuing on. The change also fixes
a small issue where `name` was printed by `flb_error` after it was freed. To
properly test this change and get the test to pass with `-DSANITIZE_ADDRESS=On`
on all platforms, I had to update `configure_plugins_type` to free objects that
it fails to instantiate.

Signed-off-by: Bradley Laney <[email protected]>
@stoksc stoksc force-pushed the stoksc/invalid-input-property branch from 48f4886 to ab5e219 Compare May 22, 2025 15:00
@stoksc stoksc force-pushed the stoksc/invalid-input-property branch from ab5e219 to 1d00d34 Compare May 22, 2025 15:01
@edsiper edsiper merged commit a28a631 into fluent:master May 29, 2025
49 checks passed
@edsiper
Copy link
Member

edsiper commented May 29, 2025

thank you

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.

3 participants