build: Enable thread_local for MinGW-w64 builds #30099

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:240514-mingw-tl changing 1 files +2 −12
  1. hebasto commented at 4:44 pm on May 14, 2024: member

    The assumption in the commit 188ca75e5fe4837d16241446558c7566912f67b2 about the broken thread_local implementation in GCC was misguided because the initial failure was not due to GCC, but a bug in the Wine runtime, as evidenced, for example, here:

    Consequently, it is safe to re-enable thread_local support for MinGW-w64 builds.

    Fixes one item from #29952.

  2. hebasto added the label Windows on May 14, 2024
  3. DrahtBot commented at 4:44 pm on May 14, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Stale ACK maflcko, theuni

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. theuni commented at 5:06 pm on May 14, 2024: member

    The previously mentioned erroneous behavior is not an issue anymore

    Erm, as of what version? Or what fix? We need more info here to be able to have any confidence.

  5. hebasto commented at 6:28 pm on May 14, 2024: member

    Erm, as of what version?

    I used this test case on platforms that support C++20.

    … which means, starting from gcc 9.3 (Ubuntu 20.04) and onwards.

    Or what fix?

    It is hard to say because https://github.com/bitcoin/bitcoin/commit/188ca75e5fe4837d16241446558c7566912f67b2 refers to the mentioned test case only. There was no links to any upstream issues.

    We need more info here to be able to have any confidence.

    At this moment, there are no evidences that the test case fails for any supported platform.

  6. fanquake commented at 5:20 am on May 15, 2024: member

    It is hard to say because https://github.com/bitcoin/bitcoin/commit/188ca75e5fe4837d16241446558c7566912f67b2 refers to the mentioned test case only. There was no links to any upstream issues.

    What did you find in the mingw-w64 / GCC changelogs?

    Erm, as of what version? Or what fix? We need more info here to be able to have any confidence.

    there are no evidences that the test case fails for any supported platform.

    There’s also not really much evidence anything has been fixed. It seems it’s just assumed that everything is now “fine” because a testcase no-longer appears to fail. However, given the historical issues we’ve seen with GCC & mingw-w64, and in particular, in regards to threading, that doesn’t seem like the right approach.

  7. hebasto commented at 5:58 am on May 15, 2024: member

    Please note, that the test case fails when running a Windows binary a.exe on Ubuntu 14.04 LTS. It is reasonable to assume that it uses packages wine-binfmt and wine.

    The error messages like “err:ntdll:RtlpWaitForCriticalSection section 0x100a8 “heap.c: main process heap section” wait timed out in thread 0064, blocked by 0055, retrying (60 sec)” are specific to the Wine runtime. For example, https://www.winehq.org/pipermail/wine-devel/2003-January/013655.html.

    My point is that the https://github.com/bitcoin/bitcoin/commit/188ca75e5fe4837d16241446558c7566912f67b2 was not justified by the tests that proved a bug in GCC. It rather showed a bug in the Wine runtime.

  8. hebasto commented at 6:09 am on May 15, 2024: member
    I found that the test case error messages are quite similar to ones reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917307. That bug has been fixed as well.
  9. maflcko commented at 8:05 am on May 15, 2024: member

    utACK df879e5a91134a67ada3167ebff4e87f163b81a9

    Seems reasonable to assume that this was a wine issue, or another issue that is now fixed.

  10. fanquake commented at 10:32 am on May 16, 2024: member
    Now that the research has been done, it should be added to the commit message and PR description, so it’s clear why this change might be safe, or the previous thread_local assumptions misguided. The commit message of The previously mentioned erroneous behavior is not an issue anymore. explains nothing.
  11. hebasto force-pushed on May 16, 2024
  12. hebasto commented at 11:00 am on May 16, 2024: member

    Now that the research has been done, it should be added to the commit message and PR description, so it’s clear why this change might be safe, or the previous thread_local assumptions misguided. The commit message of The previously mentioned erroneous behavior is not an issue anymore. explains nothing.

    Thanks! Done.

  13. maflcko commented at 3:40 pm on May 17, 2024: member
    utACK 5822a82a88e46ef08e5c18c41489ffd3e9d899c6
  14. theuni approved
  15. theuni commented at 4:58 pm on May 17, 2024: member

    utACK 5822a82a88e46ef08e5c18c41489ffd3e9d899c6.

    After this and #30095, is there any need to keep the thread_local option at all?

  16. fanquake commented at 3:05 am on May 18, 2024: member

    After this and #30095, is there any need to keep the thread_local option at all?

    Maybe not. See #30137.

  17. laanwj commented at 3:29 pm on May 19, 2024: member

    After this and #30095, is there any need to keep the thread_local option at all?

    +1 i’d also prefer getting rid ot the option (so #30137).

  18. DrahtBot added the label Needs rebase on May 21, 2024
  19. DrahtBot commented at 10:54 am on May 21, 2024: contributor

    🐙 This pull request conflicts with the target branch and needs rebase.

  20. build: Enable `thread_local` for MinGW-w64 builds
    The assumption in the commit 188ca75e5fe4837d16241446558c7566912f67b2
    about the broken `thread_local` implementation in GCC was misguided
    because the initial failure was not due to GCC, but a bug in the Wine
    runtime, as evidenced, for example, here:
     - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=917307
     - https://bugs.freedesktop.org/show_bug.cgi?id=108662
    
    Consequently, it is safe to re-enable `thread_local` support for
    MinGW-w64 builds.
    ba09bb4d76
  21. hebasto force-pushed on May 21, 2024
  22. hebasto commented at 11:01 am on May 21, 2024: member
    Rebased on top of the merged #30095.
  23. hebasto commented at 11:09 am on May 21, 2024: member
    Closing in favour of #30137.
  24. hebasto closed this on May 21, 2024

  25. hebasto deleted the branch on May 21, 2024

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: 2024-06-29 07:13 UTC

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