Building with gcc 8.2 against musl libc, which apparently has more attributes available in its sched_param. The following warnings were produced:
warning: missing initializer for member 'sched_param::sched_ss_low_priority' [-Wmissing-field-initializers]
warning: missing initializer for member 'sched_param::sched_ss_repl_period' [-Wmissing-field-initializers]
warning: missing initializer for member 'sched_param::sched_ss_init_budget' [-Wmissing-field-initializers]
warning: missing initializer for member 'sched_param::sched_ss_max_repl' [-Wmissing-field-initializers]
Since the current thread may have interesting non-zero values for these fields, we want to be sure to only change the intended one. Query and modify the current sched_param rather than starting from a zeroed one.
fanquake added the label Utils/log/libs on Nov 29, 2018
practicalswift
commented at 12:43 PM on December 4, 2018:
contributor
@fanquake I'm trying to reproduce. Can you provide the options you used when building?
promag
commented at 3:05 PM on December 4, 2018:
member
sched_param param;
param.sched_priority = 0;
if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, ¶m)) {
theuni
commented at 9:58 PM on December 6, 2018:
member
@promag You're right, but that's a little over-simplified :).
SCHED_BATCH is non-standard, so it's not immediately clear if the optional fields would override any current thread params. Also, other libc's may have additional non-standard fields.
The two major pthread implementations in question:
Since SCHED_BATCH is Linux-specific, and the Linux kernel discards everything other than priority and policy, we know that no libc-specific sched_param members will be used. So the my proposed change was overly paranoid. All we really need to do is zero the whole struct rather than just the first member to silence the warnings:
fanquake
commented at 1:08 PM on December 7, 2018:
member
I’ll update this PR next week.
threads: fix unitialized members in sched_param
Building with gcc 8.2 against musl libc, which apparently has more attributes
available in its sched_param. The following warnings were produced:
warning: missing initializer for member 'sched_param::sched_ss_low_priority' [-Wmissing-field-initializers]
warning: missing initializer for member 'sched_param::sched_ss_repl_period' [-Wmissing-field-initializers]
warning: missing initializer for member 'sched_param::sched_ss_init_budget' [-Wmissing-field-initializers]
warning: missing initializer for member 'sched_param::sched_ss_max_repl' [-Wmissing-field-initializers]
Since the current thread may have interesting non-zero values for these fields,
we want to be sure to only change the intended one. Query and modify the
current sched_param rather than starting from a zeroed one.
89282379ba
fanquake force-pushed on Dec 9, 2018
fanquake
commented at 6:59 AM on December 10, 2018:
member
@theuni I've updated this with your suggested change.
MarcoFalke added the label Needs gitian build on Dec 10, 2018
DrahtBot removed the label Needs gitian build on Dec 11, 2018
laanwj
commented at 3:55 PM on January 16, 2019:
member
utACK89282379baa503156d9b85f116ae5672f8588b39
MarcoFalke deleted a comment on Jan 16, 2019
MarcoFalke added this to the milestone 0.18.0 on Jan 16, 2019
promag
commented at 4:05 PM on January 16, 2019:
member
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me