Changeset 265003 in webkit


Ignore:
Timestamp:
Jul 28, 2020 1:22:03 PM (4 years ago)
Author:
Fujii Hironori
Message:

[WinCairo] ANGLE D3D renderer can crash when PlatformDisplayWin is destructed in IPC thread
https://bugs.webkit.org/show_bug.cgi?id=214241

Reviewed by Don Olmstead.

Web process calls _exit() in IPC thread when the IPC connection is
closed. PlatformDisplay::sharedDisplay has a static variable of
std::unique_ptr<PlatformDisplay> to ensure it will be destructed
on the process termination. This rarely causes crashes in ANGLE
because ANGLE D3D renderer isn't thread-safe at the moment.

  • platform/graphics/PlatformDisplay.cpp:

(WebCore::PlatformDisplay::sharedDisplay): Don't destruct
PlatformDisplay for PLATFORM(WIN). Use unique_ptr::release to leak it.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r265002 r265003  
     12020-07-28  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [WinCairo] ANGLE D3D renderer can crash when PlatformDisplayWin is destructed in IPC thread
     4        https://bugs.webkit.org/show_bug.cgi?id=214241
     5
     6        Reviewed by Don Olmstead.
     7
     8        Web process calls _exit() in IPC thread when the IPC connection is
     9        closed. PlatformDisplay::sharedDisplay has a static variable of
     10        std::unique_ptr<PlatformDisplay> to ensure it will be destructed
     11        on the process termination. This rarely causes crashes in ANGLE
     12        because ANGLE D3D renderer isn't thread-safe at the moment.
     13
     14        * platform/graphics/PlatformDisplay.cpp:
     15        (WebCore::PlatformDisplay::sharedDisplay): Don't destruct
     16        PlatformDisplay for PLATFORM(WIN). Use unique_ptr::release to leak it.
     17
    1182020-07-28  Clark Wang  <clark_wang@apple.com>
    219
  • trunk/Source/WebCore/platform/graphics/PlatformDisplay.cpp

    r261905 r265003  
    127127PlatformDisplay& PlatformDisplay::sharedDisplay()
    128128{
     129#if PLATFORM(WIN)
     130    // ANGLE D3D renderer isn't thread-safe. Don't destruct it on non-main threads which calls _exit().
     131    ASSERT(isMainThread());
     132    static PlatformDisplay* display = createPlatformDisplay().release();
     133    return *display;
     134#else
    129135    static std::once_flag onceFlag;
    130136    IGNORE_CLANG_WARNINGS_BEGIN("exit-time-destructors")
     
    135141    });
    136142    return *display;
     143#endif
    137144}
    138145
Note: See TracChangeset for help on using the changeset viewer.