Title: [239873] trunk/Source/WTF
Revision
239873
Author
[email protected]
Date
2019-01-11 14:01:07 -0800 (Fri, 11 Jan 2019)

Log Message

WorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread::create().
https://bugs.webkit.org/show_bug.cgi?id=191350

Reviewed by Brent Fulgham.

The non COCOA version of WorkQueue::concurrentApply() creates a temporary
String for the threadName and passes the raw pointer of this String to
Thread::create(). After freeing this String, Thread::entryPoint() uses
the raw char pointer to internally initialize the thread.

The fix is to use a single literal string for all the threads' names since
they are created for a thread-pool.

* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (239872 => 239873)


--- trunk/Source/WTF/ChangeLog	2019-01-11 21:57:46 UTC (rev 239872)
+++ trunk/Source/WTF/ChangeLog	2019-01-11 22:01:07 UTC (rev 239873)
@@ -1,3 +1,21 @@
+2019-01-11  Said Abou-Hallawa  <[email protected]>
+
+        WorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread::create().
+        https://bugs.webkit.org/show_bug.cgi?id=191350
+
+        Reviewed by Brent Fulgham.
+
+        The non COCOA version of WorkQueue::concurrentApply() creates a temporary
+        String for the threadName and passes the raw pointer of this String to
+        Thread::create(). After freeing this String, Thread::entryPoint() uses
+        the raw char pointer to internally initialize the thread.
+
+        The fix is to use a single literal string for all the threads' names since
+        they are created for a thread-pool.
+
+        * wtf/WorkQueue.cpp:
+        (WTF::WorkQueue::concurrentApply):
+
 2019-01-11  Dominik Infuehr  <[email protected]>
 
         Enable DFG on ARM/Linux again

Modified: trunk/Source/WTF/wtf/WorkQueue.cpp (239872 => 239873)


--- trunk/Source/WTF/wtf/WorkQueue.cpp	2019-01-11 21:57:46 UTC (rev 239872)
+++ trunk/Source/WTF/wtf/WorkQueue.cpp	2019-01-11 22:01:07 UTC (rev 239873)
@@ -75,7 +75,7 @@
 
             m_workers.reserveInitialCapacity(threadCount);
             for (unsigned i = 0; i < threadCount; ++i) {
-                m_workers.append(Thread::create(String::format("ThreadPool Worker %u", i).utf8().data(), [this] {
+                m_workers.append(Thread::create("ThreadPool Worker", [this] {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                     threadBody();
                 }));
             }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to