Closed Bug 1746145 Opened 2 years ago Closed 2 years ago

heap-unclassified leak in the main process when using webrender

Categories

(Core :: Graphics: WebRender, defect, P3)

Firefox 97
x86_64
Linux
defect

Tracking

()

RESOLVED MOVED
Tracking Status
firefox97 --- wontfix

People

(Reporter: ryn.and0, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(2 files, 2 obsolete files)

9.51 MB, application/octet-stream
Details
78.14 KB, application/gzip
Details
Attached file DMD-report (obsolete) —

Steps to Reproduce:

just browse the web for some days and see heap-unclassified growing.

i have been dealing with this issue for some time now, i once switched to webrender software to see if i could replicate it and i couldn't, so i only encountered this issue when i use webrender.

clicking on memory minimize doesn't free that memory.

i made a local build to debug the issue and was able to get a DMD report

i am using arch linux, kernel version 5.15.7 and mesa version 21.3.1

i am using Mozilla official builds of firefox

Attached file memory-report.json.gz (obsolete) —

i forgot to add that i am not using wayland

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)

I made another dmd report that is better than the first one.

Attached file DMD-report_2
Attachment #9255450 - Attachment is obsolete: true
Attachment #9255451 - Attachment is obsolete: true
Blocks: gfx-triage
Severity: -- → S4
Flags: needinfo?(jmathies)
Priority: -- → P3

It looks like the majority of memory is:

Unreported {
  3,392,620 blocks in heap block record 1 of 64,352
  434,255,360 bytes (434,255,360 requested / 0 slop)
  Individual block sizes: 128 x 3,392,620
  52.66% of the heap (52.66% cumulative)
  60.75% of unreported (60.75% cumulative)
  Allocated at {
    #01: alloc_surface_states.lto_priv.4.lto_priv.0 (../mesa-21.3.4/src/gallium/drivers/iris/iris_state.c:2274)
    #02: iris_create_surface.lto_priv.0 (../mesa-21.3.4/src/gallium/drivers/iris/iris_state.c:2600)
    #03: tc_create_surface (../mesa-21.3.4/src/gallium/auxiliary/util/u_threaded_context.c:1790)
    #04: ??? (/usr/lib/dri/iris_dri.so + 0x23c0ac)
    #05: texture_sub_image.lto_priv.0 (../mesa-21.3.4/src/mesa/main/teximage.c:3613)
    #06: texsubimage_err (../mesa-21.3.4/src/mesa/main/teximage.c:3666)
    #07: _mesa_TexSubImage2D (../mesa-21.3.4/src/mesa/main/teximage.c:3892)
    #08: <gleam::gl::GlFns as gleam::gl::Gl>::tex_sub_image_2d_pbo (/home/rayan/Downloads/gecko-dev/third_party/rust/gleam/src/gl_fns.rs:762)
    #09: webrender::device::gl::TextureUploader::update_impl (gfx/wr/webrender/src/device/gl.rs:4689)
    #10: webrender::device::gl::TextureUploader::flush_buffer (gfx/wr/webrender/src/device/gl.rs:4642)
    #11: webrender::device::gl::TextureUploader::flush (gfx/wr/webrender/src/device/gl.rs:4651)
    #12: webrender::renderer::vertex::VertexDataTextures::update (gfx/wr/webrender/src/renderer/vertex.rs:980)
  }
}

This looks like a driver leak. I've reported it upstream:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/5976

No longer blocks: gfx-triage

ryn.and0, is it possible for you to try an older version of Mesa to see if you can reproduce the issue there?

Flags: needinfo?(ryn.and0)

Please provide steps and configuration witch you use for dmd.py for get DMD report, I want to try reproduce on different version mesa

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

ryn.and0, is it possible for you to try an older version of Mesa to see if you can reproduce the issue there?

i will try that and report back.

(In reply to Stanislav from comment #10)

Please provide steps and configuration witch you use for dmd.py for get DMD report, I want to try reproduce on different version mesa

you need to add "ac_add_options --enable-dmd" to mozconfig file
then you need to run ./mach bootstrap to install fix-stacks tool which is important to dmd.py
then ./mach build to build firefox
after the build is finished run firefox by typing ./mach run --dmd --stacks=full
try to reproduce the issue then go to "about:memory" page and click on save dmd button
the generated files will be in /tmp folder
then go to where the dmd.py file is (i think it is inside (firefox_source_code)/obj-x86_64-pc-linux-gnu/dist/bin/) and type ./dmd.py -a -f 24 /tmp/dmd-numbers-(main process id).json.gz > file

Flags: needinfo?(ryn.and0)

You can also specify the model and version of the processor and video card

(In reply to Stanislav from comment #12)

You can also specify the model and version of the processor and video card

the cpu is intel i7-5500u and the gpu is Intel HD Graphics 5500

The patch in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15010 which was added to mesa 21.3.7 fixed my issue
Thank you for looking into this and reporting it upstream.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: