<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>228953</bug_id>
          
          <creation_ts>2021-08-10 07:21:40 -0700</creation_ts>
          <short_desc>[GTK][Wayland] wlExternalApiLock: Assertion `!&quot;failed to lock pthread mutex&quot;&apos; failed</short_desc>
          <delta_ts>2021-08-11 06:43:41 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Makoto Kato">m_kato</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bugs-noreply</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1783159</commentid>
    <comment_count>0</comment_count>
    <who name="Makoto Kato">m_kato</who>
    <bug_when>2021-08-10 07:21:40 -0700</bug_when>
    <thetext>This is copy of https://gitlab.gnome.org/GNOME/epiphany/-/issues/1575

Epiphany is 3.38.2 and NVIDIA driver is 470.57.02.
When using wayland + NVIDIA proprietary driver, epiphany won&apos;t be always started on my Debian/sid env by the following SIGABRT.


[Detaching after fork from child process 1115599]
epiphany: ../src/wayland-thread.c:87: wlExternalApiLock: Assertion `!&quot;failed to lock pthread mutex&quot;&apos; failed.

Thread 1 &quot;epiphany&quot; received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7023537 in __GI_abort () at abort.c:79
#2  0x00007ffff702340f in __assert_fail_base
    (fmt=0x7ffff718c128 &quot;%s%s%s:%u: %s%sAssertion `%s&apos; failed.\n%n&quot;, assertion=0x7fffe663d1e0 &quot;!\&quot;failed to lock pthread mutex\&quot;&quot;, file=0x7fffe663d0c2 &quot;../src/wayland-thread.c&quot;, line=87, function=&lt;optimized out&gt;) at assert.c:92
#3  0x00007ffff7032662 in __GI___assert_fail
    (assertion=0x7fffe663d1e0 &quot;!\&quot;failed to lock pthread mutex\&quot;&quot;, file=0x7fffe663d0c2 &quot;../src/wayland-thread.c&quot;, line=87, function=0x7fffe663d270 &quot;wlExternalApiLock&quot;) at assert.c:101
#4  0x00007fffe6637719 in  () at /lib/x86_64-linux-gnu/libnvidia-egl-wayland.so.1
#5  0x00007fffe663c1a7 in  () at /lib/x86_64-linux-gnu/libnvidia-egl-wayland.so.1
#6  0x00007fffe495ead5 in  () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#7  0x00007fffe49005ed in  () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#8  0x00007fffe66393a2 in  () at /lib/x86_64-linux-gnu/libnvidia-egl-wayland.so.1
#9  0x00007fffe6637ee1 in  () at /lib/x86_64-linux-gnu/libnvidia-egl-wayland.so.1
#10 0x00007fffe4963ed9 in  () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#11 0x00007fffe4903a0a in  () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#12 0x00007ffff0768718 in WS::ImplEGL::initialize(void*) (this=0x55555584d800, eglDisplay=0x5555558de490) at ../src/ws-egl.cpp:140
#13 0x00007ffff3eac3c8 in tryInitializeEGL () at ../Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:111
#14 WebKit::AcceleratedBackingStoreWayland::checkRequirements() () at ../Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:155
#15 0x00007ffff3eb64db in WebKit::HardwareAccelerationManager::HardwareAccelerationManager() ()
    at ../Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp:60
#16 0x00007ffff3eb655c in WTF::NeverDestroyed&lt;WebKit::HardwareAccelerationManager, WTF::AnyThreadsAccessTraits&gt;::NeverDestroyed&lt;&gt;() ()
    at DerivedSources/ForwardingHeaders/wtf/NeverDestroyed.h:67
#17 WebKit::HardwareAccelerationManager::singleton() () at ../Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp:36
#18 0x00007ffff3ebabb9 in WebKit::WebPreferences::platformInitializeStore() () at ../Source/WebKit/UIProcess/gtk/WebPreferencesGtk.cpp:42
#19 0x00007ffff3d70292 in WebKit::WebPreferences::create(WTF::String const&amp;, WTF::String const&amp;, WTF::String const&amp;) ()
    at ../Source/WebKit/UIProcess/WebPreferences.cpp:45
#20 0x00007ffff3d7077f in WebKit::WebPreferences::createWithLegacyDefaults(WTF::String const&amp;, WTF::String const&amp;, WTF::String const&amp;) ()
    at ../Source/WebKit/UIProcess/WebPreferences.cpp:50
#21 0x00007ffff3d50149 in WebKit::WebPageGroup::WebPageGroup(WTF::String const&amp;) () at ../Source/WebKit/UIProcess/WebPageGroup.cpp:85
#22 0x00007ffff3d503e2 in WebKit::WebPageGroup::create(WTF::String const&amp;) () at ../Source/WebKit/UIProcess/WebPageGroup.cpp:59
#23 0x00007ffff3d89109 in WebKit::WebProcessPool::WebProcessPool(API::ProcessPoolConfiguration&amp;) ()
    at ../Source/WebKit/UIProcess/WebProcessPool.cpp:275
#24 0x00007ffff3d89927 in WebKit::WebProcessPool::create(API::ProcessPoolConfiguration&amp;) () at ../Source/WebKit/UIProcess/WebProcessPool.cpp:196
#25 0x00007ffff3e07879 in webkitWebContextConstructed() () at ../Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp:404
#26 0x00007ffff74bb6f7 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x00007ffff74bd264 in g_object_new_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x00007ffff74bd5c9 in g_object_new () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#29 0x00007ffff7f7221a in  () at /usr/lib/x86_64-linux-gnu/epiphany-browser/libephymain.so
#30 0x00007ffff74bb6f7 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#31 0x00007ffff74bd264 in g_object_new_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#32 0x00007ffff74bd5c9 in g_object_new () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#33 0x00007ffff7f4ba82 in _ephy_shell_create_instance () at /usr/lib/x86_64-linux-gnu/epiphany-browser/libephymain.so
#34 0x0000555555558af6 in  ()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1783166</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-08-10 08:02:53 -0700</bug_when>
    <thetext>&gt; /lib/x86_64-linux-gnu/libnvidia-egl-wayland.so.1

It seems this library is open source. Can you install debug symbols for it and take the backtrace again, please?

Upstream seems to be https://github.com/NVIDIA/egl-wayland/issues so we might need to report it there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1783172</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-08-10 08:28:34 -0700</bug_when>
    <thetext>Looks very similar to https://bugzilla.redhat.com/show_bug.cgi?id=1842473 aka https://github.com/NVIDIA/egl-wayland/issues/27, but that one is supposedly already fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1783347</commentid>
    <comment_count>3</comment_count>
    <who name="Makoto Kato">m_kato</who>
    <bug_when>2021-08-10 16:17:46 -0700</bug_when>
    <thetext>Adding libnvidia-egl-wayland dbgsym.

[Detaching after fork from child process 1309697]
epiphany: ../src/wayland-thread.c:87: wlExternalApiLock: Assertion `!&quot;failed to lock pthread mutex&quot;&apos; failed.

Thread 1 &quot;epiphany&quot; received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7023537 in __GI_abort () at abort.c:79
#2  0x00007ffff702340f in __assert_fail_base (fmt=0x7ffff718c128 &quot;%s%s%s:%u: %s%sAssertion `%s&apos; failed.\n%n&quot;, assertion=0x7fffe663d1e0 &quot;!\&quot;failed to lock pthread mutex\&quot;&quot;, file=0x7fffe663d0c2 &quot;../src/wayland-thread.c&quot;, line=87, function=&lt;optimized out&gt;) at assert.c:92
#3  0x00007ffff7032662 in __GI___assert_fail
    (assertion=assertion@entry=0x7fffe663d1e0 &quot;!\&quot;failed to lock pthread mutex\&quot;&quot;, file=file@entry=0x7fffe663d0c2 &quot;../src/wayland-thread.c&quot;, line=line@entry=87, function=function@entry=0x7fffe663d270 &lt;__PRETTY_FUNCTION__.2&gt; &quot;wlExternalApiLock&quot;) at assert.c:101
#4  0x00007fffe6637719 in wlExternalApiLock () at ../src/wayland-thread.c:87
#5  0x00007fffe663c1a7 in wlEglGetInternalHandleExport (dpy=0x555555981b90, type=13233, handle=0x555555981b90) at ../src/wayland-eglhandle.c:146
#6  0x00007fffe495ead5 in  () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#7  0x00007fffe49005ed in  () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#8  0x00007fffe66393a2 in wl_eglstream_display_bind (data=data@entry=0x5555557efbe0, wlDisplay=wlDisplay@entry=0x5555557cb320, eglDisplay=eglDisplay@entry=0x555555981b90) at ../src/wayland-eglstream-server.c:311
#9  0x00007fffe6637ee1 in wlEglBindDisplaysHook (data=0x5555557efbe0, dpy=0x555555981b90, nativeDpy=0x5555557cb320) at ../src/wayland-egldisplay.c:87
#10 0x00007fffe4963ed9 in  () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#11 0x00007fffe4903a0a in  () at /lib/x86_64-linux-gnu/libEGL_nvidia.so.0
#12 0x00007ffff0768718 in WS::ImplEGL::initialize(void*) (this=0x5555558d7b60, eglDisplay=0x555555981b90) at ../src/ws-egl.cpp:140
#13 0x00007ffff3eac3c8 in tryInitializeEGL () at ../Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:111
#14 WebKit::AcceleratedBackingStoreWayland::checkRequirements() () at ../Source/WebKit/UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:155
#15 0x00007ffff3eb64db in WebKit::HardwareAccelerationManager::HardwareAccelerationManager() () at ../Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp:60
#16 0x00007ffff3eb655c in WTF::NeverDestroyed&lt;WebKit::HardwareAccelerationManager, WTF::AnyThreadsAccessTraits&gt;::NeverDestroyed&lt;&gt;() () at DerivedSources/ForwardingHeaders/wtf/NeverDestroyed.h:67
#17 WebKit::HardwareAccelerationManager::singleton() () at ../Source/WebKit/UIProcess/gtk/HardwareAccelerationManager.cpp:36
#18 0x00007ffff3ebabb9 in WebKit::WebPreferences::platformInitializeStore() () at ../Source/WebKit/UIProcess/gtk/WebPreferencesGtk.cpp:42
#19 0x00007ffff3d70292 in WebKit::WebPreferences::create(WTF::String const&amp;, WTF::String const&amp;, WTF::String const&amp;) () at ../Source/WebKit/UIProcess/WebPreferences.cpp:45
#20 0x00007ffff3d7077f in WebKit::WebPreferences::createWithLegacyDefaults(WTF::String const&amp;, WTF::String const&amp;, WTF::String const&amp;) () at ../Source/WebKit/UIProcess/WebPreferences.cpp:50
#21 0x00007ffff3d50149 in WebKit::WebPageGroup::WebPageGroup(WTF::String const&amp;) () at ../Source/WebKit/UIProcess/WebPageGroup.cpp:85
#22 0x00007ffff3d503e2 in WebKit::WebPageGroup::create(WTF::String const&amp;) () at ../Source/WebKit/UIProcess/WebPageGroup.cpp:59
#23 0x00007ffff3d89109 in WebKit::WebProcessPool::WebProcessPool(API::ProcessPoolConfiguration&amp;) () at ../Source/WebKit/UIProcess/WebProcessPool.cpp:275
#24 0x00007ffff3d89927 in WebKit::WebProcessPool::create(API::ProcessPoolConfiguration&amp;) () at ../Source/WebKit/UIProcess/WebProcessPool.cpp:196
#25 0x00007ffff3e07879 in webkitWebContextConstructed() () at ../Source/WebKit/UIProcess/API/glib/WebKitWebContext.cpp:404
#26 0x00007ffff74bb6f7 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#27 0x00007ffff74bd264 in g_object_new_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#28 0x00007ffff74bd5c9 in g_object_new () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#29 0x00007ffff7f7221a in  () at /usr/lib/x86_64-linux-gnu/epiphany-browser/libephymain.so
#30 0x00007ffff74bb6f7 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#31 0x00007ffff74bd264 in g_object_new_valist () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#32 0x00007ffff74bd5c9 in g_object_new () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#33 0x00007ffff7f4ba82 in _ephy_shell_create_instance () at /usr/lib/x86_64-linux-gnu/epiphany-browser/libephymain.so
#34 0x0000555555558af6 in  ()
#35 0x00007ffff7024d0a in __libc_start_main (main=0x555555558570, argc=1, argv=0x7fffffffe168, init=&lt;optimized out&gt;, fini=&lt;optimized out&gt;, rtld_fini=&lt;optimized out&gt;, stack_end=0x7fffffffe158) at ../csu/libc-start.c:308
#36 0x0000555555558eda in  ()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1783353</commentid>
    <comment_count>4</comment_count>
    <who name="Makoto Kato">m_kato</who>
    <bug_when>2021-08-10 16:23:54 -0700</bug_when>
    <thetext>Ah, this may be https://github.com/NVIDIA/egl-wayland/commit/9558ec02d0f7bbf30dc1f9ee4c0b06c9b0c49afe. My libnvidia-egl-wayland is 1.1.5</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1783479</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2021-08-11 06:43:41 -0700</bug_when>
    <thetext>(In reply to Makoto Kato from comment #4)
&gt; Ah, this may be
&gt; https://github.com/NVIDIA/egl-wayland/commit/
&gt; 9558ec02d0f7bbf30dc1f9ee4c0b06c9b0c49afe. My libnvidia-egl-wayland is 1.1.5

OK, it looks pretty similar indeed. Would be curious to know if this is fixed when you get 1.1.6/1.1.7.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>