Open Bug 1865747 Opened 6 months ago Updated 3 hours ago

Firefox crashes on Google Maps with Arch Linux

Categories

(Core :: Graphics: CanvasWebGL, defect)

Firefox 119
x86_64
Linux
defect

Tracking

()

ASSIGNED

People

(Reporter: assaf_hershko, Assigned: stransky, NeedInfo)

References

(Blocks 2 open bugs)

Details

(Keywords: topcrash)

Crash Data

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/119.0

Steps to reproduce:

I'm running the latest version of Firefox on Linux (Arch), with the Hyprland tiling manager, and trying to access https://www.google.com/maps.

Actual results:

Firefox crashes. If I comment out the "env = GBM_BACKEND,nvidia-drm" line in the config (as suggested here https://wiki.hyprland.org/Nvidia/) it fixes it.

However, my understanding is that by commenting the line I'm basically blocking Firefox from using the GPU (Nvidia), which in turn makes sites such as chess.com sluggish for some reason.

Expected results:

Google Maps should load with no issue, as it does (for example) on Chromium.

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: WebRender' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: WebRender
Product: Firefox → Core

Can you paste some of the crashes from about:crashes ?

Also, a copy of your about:support would be helpful.

Flags: needinfo?(assaf_hershko)

Thanks for the reply.

Here's the crash - https://crash-stats.mozilla.org/report/index/1a1387fe-6cd6-4451-8ad9-882140231121

Here's the about:support output - https://justpaste.it/al057

Happy to send more info, of course.

Flags: needinfo?(assaf_hershko)
Component: Graphics: WebRender → Graphics: CanvasWebGL

Is that about:support text with or without your env = GBM_BACKEND,nvidia-drm line? It lists Intel graphics in the WebGL section, if it is with the line then it may be trying to do something like send Intel command buffers to NVIDIA driver which wouldn't work.

Also it's a bit more helpful if the about:support is attached to this bug as an attachment, as I couldn't view that using the json viewer in Firefox when it's on another paste site, but I can work with it either way.

Flags: needinfo?(assaf_hershko)

(Martin Stránský [:stransky] from bug 1814873 comment #6)

This crash comes from broken systems, looks like there are some leftovers from old NVIDIA drivers while system is running on Intel.
Mesa (Intel) drivers (/usr/src/debug/mesa/mesa-22.3.5/src/gbm/main/backend.c:101) calls NvRmShimImportMemContextFromFd() from libnvidia-allocator.so.1.

No idea why libnvidia-allocator.so.1 is installed on the system.

Crash Signature: [@ NvRmShimImportMemContextFromFd ]
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
See Also: → 1814873

The bug has a crash signature, thus the bug will be considered confirmed.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Attached file aboutsupport.txt

Attaching about:support output, as requested in one of the comments.

Flags: needinfo?(assaf_hershko)

(In reply to Ashley Hale [:ahale] from comment #4)

Is that about:support text with or without your env = GBM_BACKEND,nvidia-drm line? It lists Intel graphics in the WebGL section, if it is with the line then it may be trying to do something like send Intel command buffers to NVIDIA driver which wouldn't work.

Also it's a bit more helpful if the about:support is attached to this bug as an attachment, as I couldn't view that using the json viewer in Firefox when it's on another paste site, but I can work with it either way.

Yes, it is with the line (env = GBM_BACKEND,nvidia-drm). It doesn't crash without the line.
I've attached about:support to the bug, as requested.
Thanks again.

(In reply to Darkspirit from comment #5)

(Martin Stránský [:stransky] from bug 1814873 comment #6)

This crash comes from broken systems, looks like there are some leftovers from old NVIDIA drivers while system is running on Intel.
Mesa (Intel) drivers (/usr/src/debug/mesa/mesa-22.3.5/src/gbm/main/backend.c:101) calls NvRmShimImportMemContextFromFd() from libnvidia-allocator.so.1.

No idea why libnvidia-allocator.so.1 is installed on the system.

This is a fresh install, following the standard instructions at the Arch and Hyprland sites. The Nvidia drivers on the system are the latest and only ones installed, there were no older drivers installed before.

Looks like libnvidia-allocator.so.1 is simply part of the latest NVIDIA file set (see here: https://archlinux.org/packages/extra/x86_64/nvidia-utils/files/).

Severity: -- → S2

Sharing another crash: https://crash-stats.mozilla.org/report/index/a2d555e5-5d4a-44ee-80f4-b68a70231210

This one happened when trying to open an invoice link from Amazon.
I suspect it's the same root cause (i.e., issue with the canvas).

Thanks again. I would really much prefer to use Firefox, please :)

The bug is linked to a topcrash signature, which matches the following criterion:

  • Top 5 desktop browser crashes on Linux on beta

For more information, please visit BugBot documentation.

Keywords: topcrash

Based on the topcrash criteria, the crash signature linked to this bug is not a topcrash signature anymore.

For more information, please visit BugBot documentation.

Keywords: topcrash

Since the crash volume is low (less than 15 per week), the severity is downgraded to S3. Feel free to change it back if you think the bug is still critical.

For more information, please visit BugBot documentation.

Severity: S2 → S3

Huge spike in the last week, upgrading again.

Severity: S3 → S2
Keywords: topcrash

@ekurzinger Do you have any ideas?

Flags: needinfo?(ekurzinger)

Is it possible Firefox is passing an invalid DRM FD to gbm_create_device? As far as I can tell by inspection, that would be the only way our create_device function could segfault. We pass the provided DRM fd to drmGetVersion and then dereference the returned pointer without checking if it's NULL, which it would be if the fd was invalid. So the proximate cause may indeed be a driver bug, but the root cause would still be in Firefox.

P.S. ignore "NvRmShimImportMemContextFromFd", I suspect that's just appearing in the back-trace as an artifact. That function is only used on our Tegra mobile platform.

Flags: needinfo?(ekurzinger)

Martin, do you think we might be passing a in a bad fd?

Flags: needinfo?(stransky)

Just wanted to say that since this can be duplicated consistently on my machine, if there's a test build that you want me to try I'm happy to help.

The crash here is caused by driver misconfiguration, at least https://crash-stats.mozilla.org/report/index/a2d555e5-5d4a-44ee-80f4-b68a70231210
From the backtrace and gfx info you use your primary Intel GFX / Mesa but dmabuf creation is redirected to NV drivers component libnvidia-allocator.so.1 So just remove libnvidia-allocator.so.1 file (and related ones).
I guess it's broken NVIDIA binary driver setup here as this setup can't work. Looks like NVIDIA binary uninstall was incomplete or broken or so. Also 'consistent reproduction' indicates it.

Flags: needinfo?(stransky)

To be clear here - you can't create dmabuf surface on NVIDIA gfx card and use it on Intel as you try here. That just doesn't work for many good reasons.

libnvidia-allocator.so.1 seems to come from nvidia-utils package. Majority of the crashes comes from

Arch Linux 	179 	54.7%
NixOS 24.05 (Uakari) 	58 	17.7%
NixOS 23.11 (Tapir) 	31 	9.5%

I wonder if that's distro side breakage when nvidia-utils is installed by default or so?

This is (or rather was) a fresh install of EndeavourOS with standard Nvidia drivers (installed by the distro as part of the installation process), so if there was a driver misconfiguration it's in whatever the distro is doing. Reproduced consistently, even if I wiped the drive and reinstalled completely. So whatever the issue is, it's baked in there somewhere. I'm happy to reinstall and try again if that would help.

Note that the guidance "If you encounter crashes in Firefox, remove the line env = GBM_BACKEND,nvidia-drm" appears in the Hyprland official guide (https://wiki.hyprland.org/Nvidia) so whatever the crash is, it's not just me.

(And of course to confirm - EndeavourOS is indeed Arch)

Having said that - note the crash does not occur on Chromium. It's a Firefox only issue. So even if the driver is misconfigured, the question remains why can Chromium handle it just fine, whereas Firefox crashes.

No longer blocks: gfx-triage

(In reply to assaf_hershko from comment #24)

Having said that - note the crash does not occur on Chromium. It's a Firefox only issue. So even if the driver is misconfigured, the question remains why can Chromium handle it just fine, whereas Firefox crashes.

Because Chromium ignores the GBM_BACKEND,nvidia-drm settings you use.

Summary: Firefox crashes on Google Maps → Firefox crashes on Google Maps with Arch Linux

Martin, do you have an idea what the misconfiguration might be and how Arch Linux can fix it?

Flags: needinfo?(stransky)

assaf_hershko, are you able to report this issue with upstream Arch Linux and post a link to it here?

Flags: needinfo?(assaf_hershko)

(In reply to Jeff Muizelaar [:jrmuizel] from comment #26)

Martin, do you have an idea what the misconfiguration might be and how Arch Linux can fix it?

It may be wrong distro howto, wrong NVIDIA driver setup, wrong new package shipped there.

It may also come from this wrong guide - section 1.4 of https://wiki.archlinux.org/title/NVIDIA/Troubleshooting

Try these NVIDIA-specific options in the root environment file /etc/environment:

GBM_BACKEND=nvidia-drm
__GLX_VENDOR_LIBRARY_NAME=nvidia
ENABLE_VKBASALT=1
LIBVA_DRIVER_NAME=nvidia
Flags: needinfo?(stransky)

As a hotfix we can unset GBM_BACKEND or clear GBM_BACKEND if it contains nvidia-drm. But GBM_BACKEND/nvidia-drm may be valid if you're actually running NIVIDIA. The crashes here are caused by Firefox running on Intel (perhaps the integrated one) while NVIDIA is not used but we try to allocate dmabuf on it as forced by GBM_BACKEND.

Assignee: nobody → stransky
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: