error: initializer for thread-local variable must be a constant expression
Categories
(Core :: Networking: JAR, defect, P3)
Tracking
()
People
(Reporter: Sylvestre, Unassigned)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression, Whiteboard: [necko-triaged])
with clang trunk on a Debian:
In file included from Unified_cpp_modules_libjar0.cpp:2:
/var/lib/jenkins/workspace/firefox-clang-last/modules/libjar/MmapFaultHandler.cpp:18:43: error: initializer for thread-local variable must be a constant expression
static MOZ_THREAD_LOCAL(MmapAccessScope*) sMmapAccessScope;
^~~~~~~~~~~~~~~~
/var/lib/jenkins/workspace/firefox-clang-last/modules/libjar/MmapFaultHandler.cpp:18:43: note: use 'thread_local' to allow this
This may be a bug in clang, the implicit = nullptr
initializer for this pointer seems like an acceptable constant expression.
It may or may not be a clang bug, but I think this was tickled by something that changed on the m-c side. I'm seeing this failure now even with 10.0.0 RC revisions that had previously given successful builds.
Bisection points to bug 1618165, which seems unrelated to libjar. Perhaps that commit might have brought to light a latent bug in clang-10 (was it gecko's first use of deduction guides?)
Updated•5 years ago
|
The worst part is that I can't reproduce this locally, not even with the same clang from CI!
Comment 5•5 years ago
|
||
(In reply to :dmajor from comment #3)
Bisection points to bug 1618165, which seems unrelated to libjar. Perhaps that commit might have brought to light a latent bug in clang-10 (was it gecko's first use of deduction guides?)
AFAIK, this was Gecko's first use of deduction guides (maybe Skia or ANGLE or something that's super-aggressive about C++ support might have had them first).
Ok, by turning the diagnostic into a crash, and saving the crash reproducer from CI, I can finally reproduce this locally. I'll continue looking tomorrow.
Comment 7•5 years ago
|
||
Interesting. Does MOZ_THREAD_LOCAL
use a BaseAutoLock
? I had a brief look, but at least couldn't find any use of it.
Updated•5 years ago
|
Comment 11•5 years ago
|
||
Looks like a bug in clang. I'm not sure what we can do in libjar.
Reporter | ||
Comment 12•5 years ago
|
||
Fixed in 11. I asked for the clang patch to be fixed in 10.
Reporter | ||
Comment 13•5 years ago
|
||
Landed in
https://github.com/llvm/llvm-project/commit/5b5a111c6794a0bb0385d04721ea854dd56da357
for the branch 10
I think we are good now
Description
•