Bug 271108
| Summary: | REGRESSION(274077@main): failure to build on i586 (and likely other 32bit arches): static assertion failed: Timer should stay small | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Dominique Leuenberger <dimstar> |
| Component: | WebKitGTK | Assignee: | Michael Catanzaro <mcatanzaro> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | berto, bugs-noreply, mcatanzaro, rniwa |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=268703 | ||
Dominique Leuenberger
[ 1646s] In file included from /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/build/WebCore/DerivedSources/unified-sources/UnifiedSource-3c72abbe-12.cpp:2:
[ 1646s] /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/WebCore/platform/Timer.cpp:269:29: error: static assertion failed: Timer should stay small
[ 1646s] 269 | static_assert(sizeof(Timer) == sizeof(SameSizeAsTimer), "Timer should stay small");
[ 1646s] | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
[ 1646s] /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/WebCore/platform/Timer.cpp:269:29: note: the comparison reduces to ‘(40 == 36)’
[ 1646s] /home/abuild/rpmbuild/BUILD/webkitgtk-2.44.0/Source/WebCore/platform/Timer.cpp:275:46: error: static assertion failed: DeferrableOneShotTimer should stay small
[ 1646s] 275 | static_assert(sizeof(DeferrableOneShotTimer) == sizeof(SameSizeAsDeferrableOneShotTimer), "DeferrableOneShotTimer should stay small");
[ 1646s] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Dominique Leuenberger
Version 2.43.4 was the last I tested and that still built successfylly
Michael Catanzaro
I think SameSizeAsTimer is missing the size of the bitfields, which don't get compacted on 32-bit architectures. Let me test it...
Michael Catanzaro
Hey Ryosuke, are you OK with this? I will create a pull request soon.
(Alternatively, we could put the uint8_t at the bottom of the struct by reordering the Timer data members.)
diff --git a/Source/WebCore/platform/Timer.cpp b/Source/WebCore/platform/Timer.cpp
index 4f7c0f5c39ca..0f3734cca247 100644
--- a/Source/WebCore/platform/Timer.cpp
+++ b/Source/WebCore/platform/Timer.cpp
@@ -263,7 +263,11 @@ struct SameSizeAsTimer {
WeakPtr<TimerAlignment> timerAlignment;
double times[2];
- void* pointers[3];
+ void* pointers[2];
+#if CPU(ADDRESS32)
+ uint8_t bitfields;
+#endif
+ void* pointer;
};
static_assert(sizeof(Timer) == sizeof(SameSizeAsTimer), "Timer should stay small");
Michael Catanzaro
Pull request: https://github.com/WebKit/WebKit/pull/26053
EWS
Committed 276282@main (2922af379dc7): <https://commits.webkit.org/276282@main>
Reviewed commits have been landed. Closing PR #26053 and removing active labels.