-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
out_cloudwatch: fix integer overflow in timestamps (issue #3640) #3648
Conversation
By the way, the test suite is already failing on ARMv7, but not for Cloudwatch. There doesn't seem to be a test for the formatting of the log HTTP messages.
|
@nbertram Can you check DCO error ? @edsiper @PettitWesley I tested a test code on Ubuntu 20.04(x86_64) environment setting
test code
#include <stdio.h>
#include <time.h>
int main() {
unsigned long long timestamp;
unsigned long long timestamp_patch;
time_t sec = 1624437067;
long nsec = 456789000;
timestamp = (unsigned long long)(sec * 1000 +
nsec / 1000000);
timestamp_patch = (unsigned long long)(sec * 1000ull +
nsec / 1000000);
printf("timestamp =%lld\n", timestamp);
printf("timestamp(p) =%lld\n", timestamp_patch);
} Outputtimestamp(p) is right value.
|
@nbertram Can you please fix the DCO error? Commit the message like this as an example:
|
Sorry I'll get on to this shorty. It's got an entry in my todo list now! |
…g tv_sec to millis (fluent#3640) Signed-off-by: Neil Bertram <[email protected]>
@PettitWesley sorry for the delay, have added the DCO. Anything else you need from me? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
This is the simplest fix to avoid integer overflows when multiplying (32 bit) timestamp values by 1000 on 32 bit systems (ARMv7). See the related issue for context.
Fixes #3640
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:
Documentation
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.