Changeset 261905 in webkit


Ignore:
Timestamp:
May 19, 2020 9:18:03 PM (4 years ago)
Author:
Fujii Hironori
Message:

[WinCairo] ASSERT(m_eglDisplay == EGL_NO_DISPLAY) fails in ~PlatformDisplay()
https://bugs.webkit.org/show_bug.cgi?id=212065

Reviewed by Don Olmstead.

Source/WebCore:

PlatformDisplay destoys m_eglDisplay by using std::atexit to
ensure they are destructed before EGL's atexit handler (Bug 157973).
However, calling eglTerminate in atexit handler causes a
crash on Windows (Bug 145832, Bug 170331).

Then, r214688 added shutDownEglDisplays() and explicitly call it
in shutDownWebKit() to destory m_eglDisplay in Windows WebKit1.
However, Windows WebKit2 may call _exit() in IPC::Connection's
WorkQueue thread. It doesn't seem a good idea that explicitly
destructing m_eglDisplay by calling shutDownEglDisplays().

Remove shutDownEglDisplays() and the assertion for Windows.

  • platform/graphics/PlatformDisplay.cpp:

(WebCore::PlatformDisplay::~PlatformDisplay): Conditioned out the
assertion for PLATFORM(WIN).
(WebCore::PlatformDisplay::initializeEGLDisplay): Restored the
original atexit handler of r201595.
(WebCore::PlatformDisplay::shutDownEglDisplays): Deleted.

  • platform/graphics/PlatformDisplay.h:

Source/WebKitLegacy/win:

  • WebKitDLL.cpp:

(shutDownWebKit): Don't call PlatformDisplay::shutDownEglDisplays().

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r261903 r261905  
     12020-05-19  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [WinCairo] ASSERT(m_eglDisplay == EGL_NO_DISPLAY) fails in ~PlatformDisplay()
     4        https://bugs.webkit.org/show_bug.cgi?id=212065
     5
     6        Reviewed by Don Olmstead.
     7
     8        PlatformDisplay destoys m_eglDisplay by using std::atexit to
     9        ensure they are destructed before EGL's atexit handler (Bug 157973).
     10        However, calling eglTerminate in atexit handler causes a
     11        crash on Windows (Bug 145832, Bug 170331).
     12
     13        Then, r214688 added shutDownEglDisplays() and explicitly call it
     14        in shutDownWebKit() to destory m_eglDisplay in Windows WebKit1.
     15        However, Windows WebKit2 may call _exit() in IPC::Connection's
     16        WorkQueue thread. It doesn't seem a good idea that explicitly
     17        destructing m_eglDisplay by calling shutDownEglDisplays().
     18
     19        Remove shutDownEglDisplays() and the assertion for Windows.
     20
     21        * platform/graphics/PlatformDisplay.cpp:
     22        (WebCore::PlatformDisplay::~PlatformDisplay): Conditioned out the
     23        assertion for PLATFORM(WIN).
     24        (WebCore::PlatformDisplay::initializeEGLDisplay): Restored the
     25        original atexit handler of r201595.
     26        (WebCore::PlatformDisplay::shutDownEglDisplays): Deleted.
     27        * platform/graphics/PlatformDisplay.h:
     28
    1292020-05-19  Darin Adler  <darin@apple.com>
    230
  • trunk/Source/WebCore/platform/graphics/PlatformDisplay.cpp

    r260750 r261905  
    159159PlatformDisplay::~PlatformDisplay()
    160160{
    161 #if USE(EGL)
     161#if USE(EGL) && !PLATFORM(WIN)
    162162    ASSERT(m_eglDisplay == EGL_NO_DISPLAY);
    163163#endif
     
    233233        // See https://bugs.webkit.org/show_bug.cgi?id=157973.
    234234        eglAtexitHandlerInitialized = true;
    235         std::atexit(shutDownEglDisplays);
     235        std::atexit([] {
     236            while (!eglDisplays().isEmpty()) {
     237                auto* display = eglDisplays().takeAny();
     238                display->terminateEGLDisplay();
     239            }
     240        });
    236241    }
    237242#endif
     
    252257}
    253258
    254 void PlatformDisplay::shutDownEglDisplays()
    255 {
    256     while (!eglDisplays().isEmpty()) {
    257         auto* display = eglDisplays().takeAny();
    258         display->terminateEGLDisplay();
    259     }
    260 }
    261 
    262259#endif // USE(EGL)
    263260
  • trunk/Source/WebCore/platform/graphics/PlatformDisplay.h

    r257463 r261905  
    7676    EGLDisplay eglDisplay() const;
    7777    bool eglCheckVersion(int major, int minor) const;
    78     static void shutDownEglDisplays();
    7978#endif
    8079
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r261586 r261905  
     12020-05-19  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        [WinCairo] ASSERT(m_eglDisplay == EGL_NO_DISPLAY) fails in ~PlatformDisplay()
     4        https://bugs.webkit.org/show_bug.cgi?id=212065
     5
     6        Reviewed by Don Olmstead.
     7
     8        * WebKitDLL.cpp:
     9        (shutDownWebKit): Don't call PlatformDisplay::shutDownEglDisplays().
     10
    1112020-05-12  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebKitLegacy/win/WebKitDLL.cpp

    r248444 r261905  
    164164{
    165165    WebKit::WebStorageNamespaceProvider::closeLocalStorage();
    166 #if USE(EGL)
    167     PlatformDisplay::shutDownEglDisplays();
    168 #endif
    169166}
    170167
Note: See TracChangeset for help on using the changeset viewer.