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

winevtlog: change total_size_threshold to size_t #8853

Merged
merged 1 commit into from
May 23, 2024

Conversation

braydonk
Copy link
Contributor

@braydonk braydonk commented May 22, 2024

The total_size_threshold field was originally an unsigned int. The field in the config map uses FLB_CONFIG_MAP_SIZE, which reads the value as a size_t and then writes it to the offset of the field in the struct. On a 64-bit machine, this is 8 bytes. This means the 8 byte value would be written at this offset, as a result overriding the value of the next struct field. This would cause string_inserts with default values to end up being false when it should be true.

This PR changes total_size_threshold to a size_t. This seems consistent with other usages of FLB_CONFIG_MAP_SIZE that I was able to find.

#8854


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
  • [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

  • [N/A] 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.

The `total_size_threshold` field was originally an unsigned int. The
field in the config map uses `FLB_CONFIG_MAP_SIZE`, which reads the
value as a `size_t` and then writes it to the offset of the field in the
struct. On a 64-bit machine, this is 8 bytes. This means the 8 byte
value would be written at this offset, as a result overriding the value
of the next struct field. This would cause `string_inserts` with default
values to end up being `false` when it should be `true`.

This PR changes `total_size_threshold` to a `size_t`. This seems
consistent with other usages of `FLB_CONFIG_MAP_SIZE` that I was able to
find.

Signed-off-by: braydonk <braydonk@google.com>
@braydonk
Copy link
Contributor Author

macos jemalloc unit tests is the usual flake.

Copy link
Contributor

@cosmo0920 cosmo0920 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, got it. Thanks for the detailed explanations.
To be honest, I didn't recognize this issue because I'm always specifying as string_inserts true...

@edsiper edsiper added this to the Fluent Bit v3.0.5 milestone May 23, 2024
@edsiper edsiper merged commit 7ac7d50 into fluent:master May 23, 2024
45 of 46 checks passed
markuman pushed a commit to markuman/fluent-bit that referenced this pull request May 29, 2024
The `total_size_threshold` field was originally an unsigned int. The
field in the config map uses `FLB_CONFIG_MAP_SIZE`, which reads the
value as a `size_t` and then writes it to the offset of the field in the
struct. On a 64-bit machine, this is 8 bytes. This means the 8 byte
value would be written at this offset, as a result overriding the value
of the next struct field. This would cause `string_inserts` with default
values to end up being `false` when it should be `true`.

This PR changes `total_size_threshold` to a `size_t`. This seems
consistent with other usages of `FLB_CONFIG_MAP_SIZE` that I was able to
find.

Signed-off-by: braydonk <braydonk@google.com>
Signed-off-by: Markus Bergholz <git@osuv.de>
erikbledsoe added a commit to erikbledsoe/fluent-bit that referenced this pull request Jul 11, 2024
Adds the logos of TisaLabs and Kakao as requested in [issue fluent#8836](fluent#8836) and [issue fluent#8853](fluent#8653)

Signed-off-by: Erik Bledsoe <erik.bledsoe@chronosphere.io>
edsiper pushed a commit that referenced this pull request Jul 11, 2024
Adds the logos of TisaLabs and Kakao as requested in [issue #8836](#8836) and [issue #8853](#8653)

Signed-off-by: Erik Bledsoe <erik.bledsoe@chronosphere.io>
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