WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
121883
[Windows] Refactor RuntimeEnabledFeatures as a Singleton to prevent crashes caused by cross-DLL boundary access
https://bugs.webkit.org/show_bug.cgi?id=121883
Summary
[Windows] Refactor RuntimeEnabledFeatures as a Singleton to prevent crashes c...
Brent Fulgham
Reported
2013-09-24 17:21:31 PDT
The RuntimeEnabledFeatures pseudo-singleton class has a number of inline getters and setters. When these are used to access the static members of the class across a DLL boundary, we are encountering crashes under Windows. While this seems to be behavior specific to Visual Studio, it is not a good design and should be refactored to act as a 'real' Singleton object to avoid non-deterministic behavior for reading/writing this memory.
Attachments
Patch
(99.21 KB, patch)
2013-09-24 18:33 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Patch
(125.19 KB, patch)
2013-09-25 10:43 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Updated after removal of HTMLContentElement.cpp
(124.28 KB, patch)
2013-09-25 10:57 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Patch
(124.41 KB, patch)
2013-09-25 11:19 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Removed offending WebCore.exp.in entries
(126.61 KB, patch)
2013-09-25 12:05 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Removed typo from WebCore.exp.in
(126.42 KB, patch)
2013-09-25 13:39 PDT
,
Brent Fulgham
no flags
Details
Formatted Diff
Diff
Updated with missing symbol in WebCore.exp.in
(126.48 KB, patch)
2013-09-25 14:15 PDT
,
Brent Fulgham
jer.noble
: review+
Details
Formatted Diff
Diff
Show Obsolete
(6)
View All
Add attachment
proposed patch, testcase, etc.
Brent Fulgham
Comment 1
2013-09-24 18:33:21 PDT
Created
attachment 212529
[details]
Patch
Early Warning System Bot
Comment 2
2013-09-24 18:41:34 PDT
Comment on
attachment 212529
[details]
Patch
Attachment 212529
[details]
did not pass qt-ews (qt): Output:
http://webkit-queues.appspot.com/results/2174074
Early Warning System Bot
Comment 3
2013-09-24 18:43:07 PDT
Comment on
attachment 212529
[details]
Patch
Attachment 212529
[details]
did not pass qt-wk2-ews (qt-wk2): Output:
http://webkit-queues.appspot.com/results/2165004
EFL EWS Bot
Comment 4
2013-09-24 18:50:39 PDT
Comment on
attachment 212529
[details]
Patch
Attachment 212529
[details]
did not pass efl-wk2-ews (efl-wk2): Output:
http://webkit-queues.appspot.com/results/2162073
Build Bot
Comment 5
2013-09-24 19:16:54 PDT
Comment on
attachment 212529
[details]
Patch
Attachment 212529
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/2217006
Build Bot
Comment 6
2013-09-24 19:23:24 PDT
Comment on
attachment 212529
[details]
Patch
Attachment 212529
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/2169077
kov's GTK+ EWS bot
Comment 7
2013-09-24 19:42:24 PDT
Comment on
attachment 212529
[details]
Patch
Attachment 212529
[details]
did not pass gtk-ews (gtk): Output:
http://webkit-queues.appspot.com/results/2174085
EFL EWS Bot
Comment 8
2013-09-24 19:44:40 PDT
Comment on
attachment 212529
[details]
Patch
Attachment 212529
[details]
did not pass efl-ews (efl): Output:
http://webkit-queues.appspot.com/results/2190067
Jer Noble
Comment 9
2013-09-25 08:30:32 PDT
Comment on
attachment 212529
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=212529&action=review
Awesome. Just a few nits.
> Source/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp:142 > +RuntimeEnabledFeatures& RuntimeEnabledFeatures::sharedRuntimeEnabledFeatures()
RuntimeEnabledFeatures::sharedRuntimeEnabledFeatures() seems a bit redundant. How about RuntimeEnabledFeatures::sharedFeatures()?
> Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h:45 > class RuntimeEnabledFeatures { > public:
You should add WTF_MAKE_NONCOPYABLE(RuntimeEnabledFeatures) here now that we have an instance.
> Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h:317 > + bool isLocalStorageEnabled; > + bool isSessionStorageEnabled; > + bool isWebkitNotificationsEnabled; > + bool isApplicationCacheEnabled; > + bool isDataTransferItemsEnabled; > + bool isGeolocationEnabled; > + bool isIndexedDBEnabled; > + bool isTouchEnabled; > + bool isDeviceMotionEnabled; > + bool isDeviceOrientationEnabled; > + bool isSpeechInputEnabled; > + bool isCanvasPathEnabled; > + bool isCSSExclusionsEnabled; > + bool isCSSShapesEnabled; > + bool isCSSRegionsEnabled; > + bool isCSSCompositingEnabled; > + bool isLangAttributeAwareFormControlUIEnabled;
While we're cleaning up bad coding style, we should really make all these variables conform to WebKit Coding Style, with m_ prefixes for each.
Brent Fulgham
Comment 10
2013-09-25 10:43:41 PDT
Created
attachment 212601
[details]
Patch
Brent Fulgham
Comment 11
2013-09-25 10:57:04 PDT
Created
attachment 212604
[details]
Updated after removal of HTMLContentElement.cpp
Brent Fulgham
Comment 12
2013-09-25 11:01:37 PDT
Once this patch is in place we can reactivate CSS Shapes on Windows (i.e., revert
Bug 121879
).
Early Warning System Bot
Comment 13
2013-09-25 11:07:29 PDT
Comment on
attachment 212604
[details]
Updated after removal of HTMLContentElement.cpp
Attachment 212604
[details]
did not pass qt-wk2-ews (qt-wk2): Output:
http://webkit-queues.appspot.com/results/2212053
Early Warning System Bot
Comment 14
2013-09-25 11:13:08 PDT
Comment on
attachment 212604
[details]
Updated after removal of HTMLContentElement.cpp
Attachment 212604
[details]
did not pass qt-ews (qt): Output:
http://webkit-queues.appspot.com/results/2217054
Brent Fulgham
Comment 15
2013-09-25 11:19:07 PDT
Created
attachment 212608
[details]
Patch
Build Bot
Comment 16
2013-09-25 11:51:26 PDT
Comment on
attachment 212608
[details]
Patch
Attachment 212608
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/2217061
Brent Fulgham
Comment 17
2013-09-25 12:05:19 PDT
Created
attachment 212612
[details]
Removed offending WebCore.exp.in entries
Brent Fulgham
Comment 18
2013-09-25 12:26:10 PDT
Comment on
attachment 212612
[details]
Removed offending WebCore.exp.in entries Watching the mac/mac-wk2 bots. They will probably fail one more time to show me the symbol I need to add to WebCore.exp.in to support the new Singleton object.
Build Bot
Comment 19
2013-09-25 12:45:11 PDT
Comment on
attachment 212612
[details]
Removed offending WebCore.exp.in entries
Attachment 212612
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/2224054
Build Bot
Comment 20
2013-09-25 13:08:18 PDT
Comment on
attachment 212612
[details]
Removed offending WebCore.exp.in entries
Attachment 212612
[details]
did not pass mac-ews (mac): Output:
http://webkit-queues.appspot.com/results/2220014
Brent Fulgham
Comment 21
2013-09-25 13:39:01 PDT
Created
attachment 212620
[details]
Removed typo from WebCore.exp.in
Build Bot
Comment 22
2013-09-25 14:11:32 PDT
Comment on
attachment 212620
[details]
Removed typo from WebCore.exp.in
Attachment 212620
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
http://webkit-queues.appspot.com/results/2240010
Brent Fulgham
Comment 23
2013-09-25 14:15:24 PDT
Created
attachment 212625
[details]
Updated with missing symbol in WebCore.exp.in
Jer Noble
Comment 24
2013-09-25 14:18:40 PDT
Comment on
attachment 212625
[details]
Updated with missing symbol in WebCore.exp.in r=me
Brent Fulgham
Comment 25
2013-09-25 15:18:22 PDT
Committed
r156424
: <
http://trac.webkit.org/changeset/156424
>
Csaba Osztrogonác
Comment 26
2013-10-29 08:38:08 PDT
Comment on
attachment 212625
[details]
Updated with missing symbol in WebCore.exp.in View in context:
https://bugs.webkit.org/attachment.cgi?id=212625&action=review
> Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h:419 > +#ifndef CLASS_IF_GCC > +#if COMPILER(GCC) > +#define CLASS_IF_GCC class > +#else > +#define CLASS_IF_GCC > +#endif > +#endif > + friend CLASS_IF_GCC NeverDestroyed<RuntimeEnabledFeatures>;
Sooooooo ugly. :-/ Is it a well-known MSVC bug? It seems we ran into the same bug in
https://bugs.webkit.org/show_bug.cgi?id=123442
But I prefer a general fix for it instead of adding workarounds everywhere.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug