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

network: utils: Fix int conversion errors [Backport to 2.2] #8575

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

cosmo0920
Copy link
Contributor

This is backport PR for #8555.


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:

  • Example configuration file for the change
  • Debug log output from testing the change
  • 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.

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

Documentation

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

out_size is just for used to return the lentgth of ID string.
Removing this flb_free does not cause memory leaks.

```
% leaks -atExit -- bin/flb-it-utils test_flb_utils_get_machine_id
flb-it-utils(34841) MallocStackLogging: could not tag MSL-related memory as no_footprint, so those pages will be included in process footprint - (null)
flb-it-utils(34841) MallocStackLogging: recording malloc and VM allocation stacks using lite mode
Test test_flb_utils_get_machine_id...           [ OK ]
SUCCESS: All unit tests have passed.
Process 34841 is not debuggable. Due to security restrictions, leaks can only show or save contents of readonly memory of restricted processes.

Process:         flb-it-utils [34841]
Path:            /Users/USER/*/flb-it-utils
Load Address:    0x1023cc000
Identifier:      flb-it-utils
Version:         0
Code Type:       ARM64
Platform:        macOS
Parent Process:  leaks [34840]

Date/Time:       2024-03-06 23:42:29.641 +0900
Launch Time:     2024-03-06 23:42:29.596 +0900
OS Version:      macOS 14.3.1 (23D60)
Report Version:  7
Analysis Tool:   /usr/bin/leaks

Physical footprint:         4385K
Physical footprint (peak):  4385K
Idle exit:                  untracked
----

leaks Report Version: 4.0, multi-line stacks
Process 34841: 516 nodes malloced for 42 KB
Process 34841: 0 leaks for 0 total leaked bytes.
```

Signed-off-by: Hiroshi Hatake <[email protected]>
@cosmo0920 cosmo0920 marked this pull request as ready for review March 13, 2024 06:57
@edsiper edsiper merged commit 222b76a into 2.2 Mar 13, 2024
17 checks passed
@edsiper edsiper deleted the cosmo0920-fix-int-conversion-errors-2.2 branch March 13, 2024 17:20
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.

2 participants