Skip to content
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

build: Enable thread_local for MinGW-w64 builds #30099

Closed
wants to merge 1 commit into from

Conversation

hebasto
Copy link
Member

@hebasto hebasto commented May 14, 2024

The assumption in the commit 188ca75 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.

@DrahtBot
Copy link
Contributor

DrahtBot commented May 14, 2024

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.

@theuni
Copy link
Member

theuni commented May 14, 2024

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.

@hebasto
Copy link
Member Author

hebasto commented May 14, 2024

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 188ca75 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.

@fanquake
Copy link
Member

It is hard to say because 188ca75 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.

@hebasto
Copy link
Member Author

hebasto commented May 15, 2024

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 188ca75 was not justified by the tests that proved a bug in GCC. It rather showed a bug in the Wine runtime.

@hebasto
Copy link
Member Author

hebasto commented May 15, 2024

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.

@maflcko
Copy link
Member

maflcko commented May 15, 2024

utACK df879e5

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

@fanquake
Copy link
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.

@hebasto
Copy link
Member Author

hebasto commented May 16, 2024

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.

@maflcko
Copy link
Member

maflcko commented May 17, 2024

utACK 5822a82

Copy link
Member

@theuni theuni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 5822a82.

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

@fanquake
Copy link
Member

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

Maybe not. See #30137.

@laanwj
Copy link
Member

laanwj commented May 19, 2024

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).

@DrahtBot
Copy link
Contributor

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

The assumption in the commit 188ca75
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.
@hebasto
Copy link
Member Author

hebasto commented May 21, 2024

Rebased on top of the merged #30095.

@hebasto
Copy link
Member Author

hebasto commented May 21, 2024

Closing in favour of #30137.

@hebasto hebasto closed this May 21, 2024
@hebasto hebasto deleted the 240514-mingw-tl branch May 21, 2024 19:22
fanquake added a commit that referenced this pull request May 21, 2024
17fe948 build: remove --enable-threadlocal (fanquake)
1e7c20b doc: remove comment about using thread_local (fanquake)
5bba433 build: Enable `thread_local` for MinGW-w64 builds (Hennadii Stepanov)

Pull request description:

  Includes a commit from #30099.
  Closes #29952.

ACKs for top commit:
  laanwj:
    Code review ACK 17fe948
  maflcko:
    utACK 17fe948
  hebasto:
    ACK 17fe948.
  theuni:
    utACK 17fe948

Tree-SHA512: 2aad6d19e79c4d6d7aefd0f41b215ac8d9320f5908808221d78e6ee1c77503832a02759bee2ad397e235b6739e22aca8dcf5c5ef8854deb8c697b18ac56a06da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants