ci: Fixes after Debian release #969

pull real-or-random wants to merge 2 commits into bitcoin-core:master from real-or-random:202108-ci-bullseye changing 2 files +7 −5
  1. real-or-random commented at 10:52 AM on August 19, 2021: contributor

    Debian stable is now bullseye. This results in an update of compiler versions, which make some minor fixes necessary. See commit messages for details.

    Tip: If you want to build the docker image locally, use --pull to force docker to pull the latest Debian image as a base, e.g., docker build . -f ci/linux-debian.Dockerfile --pull.

  2. ci: Install libasan6 (instead of 5) after Debian upgrade 3d2f492ceb
  3. in src/tests.c:5273 in 892f0ce87f outdated
    5269 |      random_scalar_order_test(&msg);
    5270 |      random_scalar_order_test(&key);
    5271 |      secp256k1_ecmult_gen(&ctx->ecmult_gen_ctx, &pubj, &key);
    5272 |      secp256k1_ge_set_gej(&pub, &pubj);
    5273 |      getrec = secp256k1_testrand_bits(1);
    5274 | -    random_sign(&sigr, &sigs, &key, &msg, getrec?&recid:NULL);
    


    elichai commented at 11:23 AM on August 19, 2021:

    fwiw, assigning the pointer to a variable also seems to solve this, Isolated case: https://godbolt.org/z/q1T6eMccT


    real-or-random commented at 12:48 PM on August 19, 2021:

    I see, yeah. I tried a variant of this, which didn't work. I think both "fixes" are fine, I'm going to keep mine if noone objects.

    Interestingly, your test case shows that the warning appears also on clang 12. But I can't get valgrind to complain on clang 12 output...

  4. tests: Rewrite code to circument potential bug in clang
    clang 7 to 11 (and maybe earlier versions) warn about recid being
    potentially unitiliazed in "CHECK(recid >= 0 [...]", which was mitigated
    in commit 3d2cf6c5bd35b0d72716b47bdd7e3892388aafc4 by initializing recid
    to make clang happy but VG_UNDEF'ing the variable after initializiation
    in order to ensure valgrind's memcheck analysis will still be sound and
    complain if recid is not actually written to when creating a signature.
    
    However, it turns out that at least for binaries produced by clang 11
    (but not clang 7), valgrind complains about a branch on unitialized data
    in the recid variable in that line before *and* after the aforementioned
    commit. While the complaint after the commit could be spurious (clang
    knows that recid is initialized, so it's fine to access it even though
    the access is stupid), the complaint before the commit indicates a real
    problem: it might be the case that clang is performing a wrong
    optimization that leads to a situation where recid is really not
    guaranteed to be initialized when it's accessed. As a result, clang
    warns about this and generates code that just accesses the variable.
    
    I'm not going to bother with this further because this is fixed in
    clang 12 and the problem is just in our test code, not in the tested
    code.
    
    This commit rewrites the code in a way that groups the signing together
    with the CHECK such that it's very easy to figure out for clang that
    recid will be initialized properly. This seems to circument the issue.
    5d5c74a057
  5. real-or-random force-pushed on Aug 19, 2021
  6. jonasnick commented at 6:05 PM on August 19, 2021: contributor

    ACK 5d5c74a057f3951677691113747952f4cbdde86b

    Can confirm that clang 7, 11 and 12 don't complain.

  7. elichai commented at 2:07 PM on August 20, 2021: contributor

    ACK 5d5c74a

    It seems that removing the variable initialization and the valgrind macro even clang 12 warns, but this fixes it anyway.

  8. jonasnick merged this on Aug 20, 2021
  9. jonasnick closed this on Aug 20, 2021

  10. jonasnick cross-referenced this on Sep 15, 2021 from issue Upstream PRs 969, 956, 783, 976 by jonasnick
  11. fanquake referenced this in commit ff458a7b78 on Sep 29, 2021
  12. real-or-random referenced this in commit 7812feb896 on Oct 15, 2021
  13. fanquake referenced this in commit 8f5cd5e893 on Oct 20, 2021
  14. sipa referenced this in commit f727914d7e on Oct 28, 2021
  15. sipa referenced this in commit 440f7ec80e on Oct 31, 2021
  16. dhruv referenced this in commit 395e1155b9 on Nov 2, 2021
  17. dhruv referenced this in commit 184e1fac17 on Nov 2, 2021
  18. sipa referenced this in commit d057eae556 on Dec 2, 2021
  19. fanquake referenced this in commit c4a1e09a8c on Dec 3, 2021
  20. sipa referenced this in commit 86dbc4d075 on Dec 15, 2021
  21. gwillen referenced this in commit 35d6112a72 on May 25, 2022
  22. janus referenced this in commit 879a9a27b9 on Jul 10, 2022
  23. patricklodder referenced this in commit 21badcf9d2 on Jul 25, 2022
  24. patricklodder referenced this in commit 03002a9013 on Jul 28, 2022
  25. Fabcien referenced this in commit c297b01b65 on Jan 6, 2023
  26. deadalnix referenced this in commit f7e8b6df47 on Jan 7, 2023
  27. Fabcien referenced this in commit 5f47cd0547 on Jan 9, 2023
  28. deadalnix referenced this in commit 826d64fb6d on Jan 10, 2023
  29. backpacker69 referenced this in commit 77186f4a04 on Jan 18, 2023
  30. str4d referenced this in commit 6de4698bf9 on Apr 21, 2023
  31. vmta referenced this in commit e1120c94a1 on Jun 4, 2023
  32. vmta referenced this in commit 8f03457eed on Jul 1, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-01 14:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me