Bug 259859

Summary: [GTK][Nvidia] WebProcess crash in WebCore::GBMBufferSwapchain::getBuffer when logging in to Google
Product: WebKit Reporter: Kdwk <kdwkleung>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: bugs-noreply, cgarcia, mcatanzaro, philn
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
See Also: https://bugs.webkit.org/show_bug.cgi?id=258831
Attachments:
Description Flags
gdb (bt full; c) output.txt
none
gdb (bt full; c) 2.txt
none
gdb (bt full; c) from WebKitGTK 2.41.9 none

Description Kdwk 2023-08-05 02:30:47 PDT
Created attachment 467207 [details]
gdb (bt full; c) output.txt

1. Log into Google
2. Type username
3. Enter
4. WebProcess crash

Tested with: Gnome Web 44.6/ WebKitGTK 2.40.4
Tested on: Nvidia RTX 4070 (driver version 535 via Universal Blue)
Comment 1 Kdwk 2023-08-05 03:34:52 PDT
This seems to be happening all over the place. I just hit this when scrolling through Reddit
Comment 2 Kdwk 2023-08-05 03:51:07 PDT
This just happened again on Proton Mail
Comment 3 Michael Catanzaro 2023-08-10 12:06:00 PDT
This looks really familiar, but I couldn't immediately find any related bug reports.

I wonder if this is fixed on main by the recent graphics stack changes there.
Comment 4 Kdwk 2023-08-10 20:32:06 PDT
Looks similar: https://bugs.webkit.org/show_bug.cgi?id=258831
Comment 5 Michael Catanzaro 2023-08-11 05:08:02 PDT
Heh, and I had just commented in that bug one hour before this one. Well, you're right. Good find.

The bug is not identical, though, so I'll mark it as See Also rather than a duplicate.
Comment 6 Kdwk 2023-08-18 05:58:51 PDT
Created attachment 467322 [details]
gdb (bt full; c) 2.txt

Hit it again in Tech Preview (I can use it now after disabling DMABUF).

I'm hitting this in lots of different places. It is as of now the biggest barrier to daily driving Epiphany on Nvidia hardware because it reliably stops users from logging in to Google or using Reddit.
Comment 7 Kdwk 2023-08-18 06:01:40 PDT
It affects both stable 2.40 and 2.41 series
Comment 8 Carlos Garcia Campos 2023-08-18 06:15:38 PDT
(In reply to kdwkleung from comment #7)
> It affects both stable 2.40 and 2.41 series

Are you sure? we don't use use GBMBufferSwapchain in 2.41 since 2.41.6.
Comment 9 Michael Catanzaro 2023-08-18 06:16:39 PDT
(In reply to Michael Catanzaro from comment #5)
> The bug is not identical, though, so I'll mark it as See Also rather than a
> duplicate.

Looking this over again, I think it's really the same bug.

*** This bug has been marked as a duplicate of bug 258831 ***
Comment 10 Kdwk 2023-08-18 06:18:30 PDT
I disabled DMABUF and am using the WPE renderer because using DMABUF results in a blank screen in 2.41.x (Nvidia hardware). Could that be why GBMBufferSwapchain is still used?
Comment 11 Carlos Garcia Campos 2023-08-18 06:22:23 PDT
(In reply to kdwkleung from comment #6)
> Created attachment 467322 [details]
> gdb (bt full; c) 2.txt
> 
> Hit it again in Tech Preview (I can use it now after disabling DMABUF).

What do you mean by disabling DMABUF exactly? Because the DMABUF renderer has nothing to do with the DMABUF used for WebGL.

> I'm hitting this in lots of different places. It is as of now the biggest
> barrier to daily driving Epiphany on Nvidia hardware because it reliably
> stops users from logging in to Google or using Reddit.
Comment 12 Kdwk 2023-08-18 06:25:07 PDT
(In reply to Carlos Garcia Campos from comment #11)
> (In reply to kdwkleung from comment #6)
> > Created attachment 467322 [details]
> > gdb (bt full; c) 2.txt
> > 
> > Hit it again in Tech Preview (I can use it now after disabling DMABUF).
> 
> What do you mean by disabling DMABUF exactly? Because the DMABUF renderer
> has nothing to do with the DMABUF used for WebGL.
> 
> > I'm hitting this in lots of different places. It is as of now the biggest
> > barrier to daily driving Epiphany on Nvidia hardware because it reliably
> > stops users from logging in to Google or using Reddit.

WEBKIT_DISABLE_DMABUF_RENDERER=1
Comment 13 Carlos Garcia Campos 2023-08-18 06:26:16 PDT
(In reply to kdwkleung from comment #12)
> (In reply to Carlos Garcia Campos from comment #11)
> > (In reply to kdwkleung from comment #6)
> > > Created attachment 467322 [details]
> > > gdb (bt full; c) 2.txt
> > > 
> > > Hit it again in Tech Preview (I can use it now after disabling DMABUF).
> > 
> > What do you mean by disabling DMABUF exactly? Because the DMABUF renderer
> > has nothing to do with the DMABUF used for WebGL.
> > 
> > > I'm hitting this in lots of different places. It is as of now the biggest
> > > barrier to daily driving Epiphany on Nvidia hardware because it reliably
> > > stops users from logging in to Google or using Reddit.
> 
> WEBKIT_DISABLE_DMABUF_RENDERER=1

That shouldn't affect WebGL, what WebKitGTK version exactly?
Comment 14 Kdwk 2023-08-18 06:27:56 PDT
Both Gnome Web 44.6/ WebKitGTK 2.40.4 and Epiphany Technology Preview 45.beta-26-ge3949b7dc+/ WebKitGTK 2.41.90
Comment 15 Carlos Garcia Campos 2023-08-18 06:44:51 PDT
(In reply to kdwkleung from comment #14)
> Both Gnome Web 44.6/ WebKitGTK 2.40.4 and Epiphany Technology Preview
> 45.beta-26-ge3949b7dc+/ WebKitGTK 2.41.90

I don't understand how a GraphicsContextGLGBM can be created with 2.41.90, could you provide a bt of 2.41.90?

I see reshapeDisplayBufferBacking in the bt which was removed in April in 263496@main
Comment 16 Kdwk 2023-08-18 06:52:24 PDT
Created attachment 467324 [details]
gdb (bt full; c) from WebKitGTK 2.41.9

This is freshly caught be visiting reddit.com. Interestingly, I can now log in to Google.
Comment 17 Carlos Garcia Campos 2023-08-18 07:15:46 PDT
(In reply to kdwkleung from comment #16)
> Created attachment 467324 [details]
> gdb (bt full; c) from WebKitGTK 2.41.9
> 
> This is freshly caught be visiting reddit.com. Interestingly, I can now log
> in to Google.

Ok, this makes more sense. You can log in google because that uses WebGL, the reddit issue is because of the media player. You can workaround the issue for now by disabling dmabuf video sink (WEBKIT_GST_DMABUF_SINK_DISABLED=1). The problem is that for some reason gbm_bo_create() is failing. I can try to add a null check there, but we need to figure out why it's failing.
Comment 18 Kdwk 2023-08-19 00:34:13 PDT
(In reply to Carlos Garcia Campos from comment #17)
> You can workaround the issue for now by disabling dmabuf video sink
> (WEBKIT_GST_DMABUF_SINK_DISABLED=1).

This makes the page not crash but all HTML5 video tag elements fail to play
Comment 19 Carlos Garcia Campos 2023-08-19 02:35:06 PDT
(In reply to kdwkleung from comment #18)
> (In reply to Carlos Garcia Campos from comment #17)
> > You can workaround the issue for now by disabling dmabuf video sink
> > (WEBKIT_GST_DMABUF_SINK_DISABLED=1).
> 
> This makes the page not crash but all HTML5 video tag elements fail to play

That means the gl video sink is broken too :-( Any error on stderr/stdout?
Comment 20 Kdwk 2023-08-19 02:44:45 PDT
No, I can't see any
Comment 21 Philippe Normand 2023-08-19 03:41:00 PDT
Then you should add this WEBKIT_GST_DISABLE_GL_SINK=1 to the env var soup. Since nothing works with nvidia.
Comment 22 Kdwk 2023-08-19 03:53:15 PDT
(In reply to Philippe Normand from comment #21)
> Then you should add this WEBKIT_GST_DISABLE_GL_SINK=1 to the env var soup.
> Since nothing works with nvidia.

That appears to work at first but after a while Epiphany keeps getting SIGSEGV on sites with video like apple.com
Comment 23 Kdwk 2023-08-19 03:54:08 PDT
If I look at the backtrace it looks like “?? ()”