⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 201612 in webkit


Ignore:
Timestamp:
Jun 2, 2016, 12:57:41 PM (10 years ago)
Author:
Chris Dumez
Message:

Crash under WebProcess::registerWithStateDumper()
https://bugs.webkit.org/show_bug.cgi?id=158304
<rdar://problem/25329276>

Reviewed by Anders Carlsson.

The issue is that the block in registerWithStateDumper() was executed in
a background thread and is iterating over m_pageMap HashMap. The crash
occurs when a page gets removed from the m_pageMap HashMap while the
block is iterating over this same HashMap in another thread.

The solution proposed is to execute the registerWithStateDumper()'s
block in the main thread.

  • WebProcess/cocoa/WebProcessCocoa.mm:

(WebKit::WebProcess::registerWithStateDumper):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r201603 r201612  
     12016-06-02  Chris Dumez  <cdumez@apple.com>
     2
     3        Crash under WebProcess::registerWithStateDumper()
     4        https://bugs.webkit.org/show_bug.cgi?id=158304
     5        <rdar://problem/25329276>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        The issue is that the block in registerWithStateDumper() was executed in
     10        a background thread and is iterating over m_pageMap HashMap. The crash
     11        occurs when a page gets removed from the m_pageMap HashMap while the
     12        block is iterating over this same HashMap in another thread.
     13
     14        The solution proposed is to execute the registerWithStateDumper()'s
     15        block in the main thread.
     16
     17        * WebProcess/cocoa/WebProcessCocoa.mm:
     18        (WebKit::WebProcess::registerWithStateDumper):
     19
    1202016-06-02  Brady Eidson  <beidson@apple.com>
    221
  • trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm

    r199326 r201612  
    218218void WebProcess::registerWithStateDumper()
    219219{
    220     dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
    221     os_state_add_handler(queue, ^(os_state_hints_t hints) {
     220    os_state_add_handler(dispatch_get_main_queue(), ^(os_state_hints_t hints) {
    222221
    223222        @autoreleasepool {
Note: See TracChangeset for help on using the changeset viewer.