threads: fix potential unitialized members in sched_param #14342

pull theuni wants to merge 1 commits into bitcoin:master from theuni:fix-musl-sched changing 1 files +15 −2
  1. theuni commented at 10:53 PM on September 27, 2018: member

    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.

  2. 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.
    8c0bcb9ba9
  3. fanquake added the label Utils/log/libs on Sep 27, 2018
  4. DrahtBot commented at 1:29 AM on September 28, 2018: member

    <!--32850dd3fdea838b4049e64f46995ea2-->

    Coverage Change (pull 14342) Reference (master)
    Lines -0.0579 % 87.0361 %
    Functions -0.0463 % 84.1130 %
    Branches -0.0436 % 51.5451 %
  5. practicalswift commented at 5:55 AM on September 28, 2018: contributor

    Concept ACK

    Nice find!

  6. fanquake commented at 1:19 PM on October 14, 2018: member

    Concept ACK

    I assume this turned up during some 🐢 related work? I'm planning on getting setup to test that/musl going forward, so will give a proper ACK here if I get that done before this is merged.

  7. DrahtBot commented at 11:16 AM on November 5, 2018: member

    <!--cf906140f33d8803c4a75a2196329ecb-->Needs rebase

  8. DrahtBot added the label Needs rebase on Nov 5, 2018
  9. practicalswift commented at 12:25 PM on November 5, 2018: contributor

    @theuni I'd like to reproduce by building against musl myself - do you remember which build parameters you used? :-)

  10. fanquake commented at 10:59 AM on November 29, 2018: member

    Rebased in #14839.

  11. fanquake closed this on Nov 29, 2018

  12. laanwj referenced this in commit fcb6694a99 on Jan 16, 2019
  13. laanwj removed the label Needs rebase on Oct 24, 2019
  14. PastaPastaPasta referenced this in commit 31e18d0e23 on Jun 26, 2021
  15. PastaPastaPasta referenced this in commit f591a545eb on Jun 26, 2021
  16. PastaPastaPasta referenced this in commit b6faa97716 on Jun 27, 2021
  17. PastaPastaPasta referenced this in commit f2b33a7d34 on Jun 28, 2021
  18. MarcoFalke locked this on Dec 16, 2021

github-metadata-mirror

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