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
Version 5.9.0 will not build as x86 system #3179
Comments
Hi, what do you mean here: does it work or doesn't it? Are you cross-compiling on non x86 systems? Please also add info in the used c-compiler, as I suspect that to be the issue here. |
My builder is an x86_64 system. |
My build will stuck at the same errors as informed at my first information. |
Hmm, it works on or koji-type builder https://review.rdoproject.org/r/#/c/21124/ I assume, you're running into an incarnation of #3038 |
Please get the information, that gcc is in version 7.3.0. |
Sorry. No change. Building still leaks with identical messages from my first post here. |
Hello,
|
FWIW,
What happens here is running a new compiler with better "analysis power". It's independent from architecture. If |
However I would not cast |
The other question here is, who sets |
Hello,
version 5.9.1 from GitHub will also not work for me original.
I have now change in src/daemon/plugin.c two more lines from snprintf to ssnprintf
and then the build on the x86 system will work.
changes will be:
@@ -645,7 +645,7 @@ static void start_read_threads(size_t nu
}
char name[THREAD_NAME_MAX];
- snprintf(name, sizeof(name), "reader#%" PRIu64, (uint64_t)read_threads_num);
+ ssnprintf(name, sizeof(name), "reader#%" PRIu64, (uint64_t)read_threads_num);
set_thread_name(read_threads[read_threads_num], name);
read_threads_num++;
@@ -834,7 +834,7 @@ static void start_write_threads(size_t n
}
char name[THREAD_NAME_MAX];
- snprintf(name, sizeof(name), "writer#%" PRIu64,
+ ssnprintf(name, sizeof(name), "writer#%" PRIu64,
(uint64_t)write_threads_num);
set_thread_name(write_threads[write_threads_num], name);
Best regards,
Roland Franke
From: Alexander Dahl
Sent: Sunday, July 14, 2019 8:46 AM
To: collectd/collectd
Cc: Roland-F ; Author
Subject: Re: [collectd/collectd] Version 5.9.0 will not build as x86 system (#3179)
I saw commit abaa1c8 in master which seems not to be part of the 5.9 branch, which "solves" that problem by introducing a wrapper around snprintf() … 😲
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
By building collect 5.9.0 with cross-compiling (Buildroot), it works for an x86_64 system.
But when i try this for an x86 system i will get during the build the following faults:
src/daemon/plugin.c: In function 'plugin_init_all':
src/daemon/plugin.c:838:34: error: '%llu' directive output may be truncated writing between 1 and 10 bytes into a region of size 9 [-Werror=format-truncation=]
snprintf(name, sizeof(name), "writer#%" PRIu64,
^~~~~~~~~~
src/daemon/plugin.c:838:42: note: format string is defined here
snprintf(name, sizeof(name), "writer#%" PRIu64,
src/daemon/plugin.c:838:34: note: directive argument in the range [0, 4294967295]
snprintf(name, sizeof(name), "writer#%" PRIu64,
^~~~~~~~~~
src/daemon/plugin.c:838:5: note: 'snprintf' output between 9 and 18 bytes into a destination of size 16
snprintf(name, sizeof(name), "writer#%" PRIu64,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(uint64_t)write_threads_num);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/daemon/plugin.c:649:34: error: '%llu' directive output may be truncated writing between 1 and 10 bytes into a region of size 9 [-Werror=format-truncation=]
snprintf(name, sizeof(name), "reader#%" PRIu64, (uint64_t)read_threads_num);
^~~~~~~~~~
src/daemon/plugin.c:649:42: note: format string is defined here
snprintf(name, sizeof(name), "reader#%" PRIu64, (uint64_t)read_threads_num);
src/daemon/plugin.c:649:34: note: directive argument in the range [0, 4294967295]
snprintf(name, sizeof(name), "reader#%" PRIu64, (uint64_t)read_threads_num);
^~~~~~~~~~
src/daemon/plugin.c:649:5: note: 'snprintf' output between 9 and 18 bytes into a destination of size 16
snprintf(name, sizeof(name), "reader#%" PRIu64, (uint64_t)read_threads_num);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I suggest that this problem come up as by the src/daemon/plugin.c now will be set some parts for pure x86_64 system (PRIu64; unit64_t) and they will be not available as x86 system.
Best regards,
Roland Franke
The text was updated successfully, but these errors were encountered: