Title: [90939] trunk/Source
Revision
90939
Author
[email protected]
Date
2011-07-13 12:19:23 -0700 (Wed, 13 Jul 2011)

Log Message

Possible race condition in ThreadIdentifierData::initializeKeyOnce and shouldCallRealDebugger.
https://bugs.webkit.org/show_bug.cgi?id=64465

Reviewed by Dmitry Titov.

There isn't a good way to test this as it is very highly unlikely to occur.

Source/_javascript_Core:

* wtf/ThreadIdentifierDataPthreads.cpp:
(WTF::ThreadIdentifierData::initializeKeyOnce): Since scoped static initialization
isn't thread-safe, change the initialization to be global.

Source/WebKit2:

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::shouldCallRealDebugger): :Since scoped static initialization
isn't thread-safe, change the initialization to be global.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (90938 => 90939)


--- trunk/Source/_javascript_Core/ChangeLog	2011-07-13 18:59:34 UTC (rev 90938)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-07-13 19:19:23 UTC (rev 90939)
@@ -1,3 +1,16 @@
+2011-07-13  David Levin  <[email protected]>
+
+        Possible race condition in ThreadIdentifierData::initializeKeyOnce and shouldCallRealDebugger.
+        https://bugs.webkit.org/show_bug.cgi?id=64465
+
+        Reviewed by Dmitry Titov.
+
+        There isn't a good way to test this as it is very highly unlikely to occur.
+
+        * wtf/ThreadIdentifierDataPthreads.cpp:
+        (WTF::ThreadIdentifierData::initializeKeyOnce): Since scoped static initialization
+        isn't thread-safe, change the initialization to be global.
+
 2011-07-12  Gavin Barraclough  <[email protected]>
 
         https://bugs.webkit.org/show_bug.cgi?id=64424

Modified: trunk/Source/_javascript_Core/wtf/ThreadIdentifierDataPthreads.cpp (90938 => 90939)


--- trunk/Source/_javascript_Core/wtf/ThreadIdentifierDataPthreads.cpp	2011-07-13 18:59:34 UTC (rev 90938)
+++ trunk/Source/_javascript_Core/wtf/ThreadIdentifierDataPthreads.cpp	2011-07-13 19:19:23 UTC (rev 90939)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2009, 2011 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -39,6 +39,7 @@
 namespace WTF {
 
 pthread_key_t ThreadIdentifierData::m_key;
+static pthread_once_t _onceControl_ = PTHREAD_ONCE_INIT;
 
 void clearPthreadHandleForIdentifier(ThreadIdentifier);
 
@@ -86,7 +87,6 @@
 
 void ThreadIdentifierData::initializeKeyOnce()
 {
-    static pthread_once_t _onceControl_ = PTHREAD_ONCE_INIT;
     if (pthread_once(&onceControl, initializeKeyOnceHelper))
         CRASH();
 }

Modified: trunk/Source/WebKit2/ChangeLog (90938 => 90939)


--- trunk/Source/WebKit2/ChangeLog	2011-07-13 18:59:34 UTC (rev 90938)
+++ trunk/Source/WebKit2/ChangeLog	2011-07-13 19:19:23 UTC (rev 90939)
@@ -1,3 +1,16 @@
+2011-07-13  David Levin  <[email protected]>
+
+        Possible race condition in ThreadIdentifierData::initializeKeyOnce and shouldCallRealDebugger.
+        https://bugs.webkit.org/show_bug.cgi?id=64465
+
+        Reviewed by Dmitry Titov.
+
+        There isn't a good way to test this as it is very highly unlikely to occur.
+
+        * PluginProcess/mac/PluginProcessMac.mm:
+        (WebKit::shouldCallRealDebugger): :Since scoped static initialization
+        isn't thread-safe, change the initialization to be global.
+
 2011-07-13  Andreas Kling  <[email protected]>
 
         [Qt][WK2] Remove invalid signal/slot connection in QTouchWebView.

Modified: trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm (90938 => 90939)


--- trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm	2011-07-13 18:59:34 UTC (rev 90938)
+++ trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm	2011-07-13 19:19:23 UTC (rev 90939)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2011 Google Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -39,6 +40,8 @@
 
 namespace WebKit {
 
+static pthread_once_t shouldCallRealDebuggerOnce = PTHREAD_ONCE_INIT;
+
 class FullscreenWindowTracker {
     WTF_MAKE_NONCOPYABLE(FullscreenWindowTracker);
 
@@ -132,7 +135,6 @@
 
 static bool shouldCallRealDebugger()
 {
-    static pthread_once_t shouldCallRealDebuggerOnce = PTHREAD_ONCE_INIT;
     pthread_once(&shouldCallRealDebuggerOnce, initShouldCallRealDebugger);
     
     return isUserbreakSet;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to