Closed Bug 1655677 Opened 1 year ago Closed 8 months ago

WebRender hangs with mp4 HTML5 video

Categories

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

Firefox 81
x86_64
macOS
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox79 --- wontfix
firefox80 --- wontfix
firefox81 --- wontfix
firefox82 --- wontfix
firefox83 --- fix-optional

People

(Reporter: markus, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Crash Data

I'm regularly experiencing hangs with WebRender when visiting a site that has an html video element. When visiting such a site, the graphics on my computer freeze completely (except for the mouse cursor) for about 30-40 seconds, before the site continues to work as usual.

Disabling WebRender seems to fix the issue so it seems related to WebRender.

A minimal example that triggers the hang for me is https://jsbin.com/lugadoyate/2/edit?html,output. It seems to depend on the video format being mp4, I couldn't reproduce this with ogg or webm.

I use macOS 10.14.6 with a NVIDIA Quadro K2000 2 GB and Firefox 81.0a1 (2020-07-27).


From the graphics section in about:support:

{
"graphics": {
    "numTotalWindows": 1,
    "numAcceleratedWindows": 1,
    "windowLayerManagerType": "WebRender",
    "windowLayerManagerRemote": true,
    "windowUsingAdvancedLayers": false,
    "adapterDescription": "",
    "adapterVendorID": "0x10de",
    "adapterDeviceID": "0x0ffe",
    "adapterRAM": 0,
    "adapterDrivers": "",
    "driverVendor": "",
    "driverVersion": "",
    "driverDate": "",
    "usesTiling": true,
    "contentUsesTiling": true,
    "offMainThreadPaintEnabled": true,
    "offMainThreadPaintWorkerCount": 4,
    "targetFrameRate": 60,
    "webgl1Renderer": "NVIDIA Corporation -- NVIDIA Quadro K2000 OpenGL Engine",
    "webgl1Version": "4.1 NVIDIA-12.0.24 355.11.10.50.10.103",
    "webgl1DriverExtensions": "GL_ARB_blend_func_extended GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5 GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_occlusion_query2 GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_subroutine GL_ARB_shading_language_include GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_vertex_attrib_64bit GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_depth_bounds_test GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_EXT_texture_mirror_clamp GL_EXT_texture_sRGB_decode GL_APPLE_client_storage GL_APPLE_container_object_shareable GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_texture_range GL_ATI_texture_mirror_once GL_NV_texture_barrier",
    "webgl1Extensions": "ANGLE_instanced_arrays EXT_blend_minmax EXT_color_buffer_half_float EXT_float_blend EXT_frag_depth EXT_shader_texture_lod EXT_sRGB EXT_texture_compression_rgtc EXT_texture_filter_anisotropic MOZ_debug OES_element_index_uint OES_fbo_render_mipmap OES_standard_derivatives OES_texture_float OES_texture_float_linear OES_texture_half_float OES_texture_half_float_linear OES_vertex_array_object WEBGL_color_buffer_float WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_depth_texture WEBGL_draw_buffers WEBGL_lose_context",
    "webgl1WSIInfo": "CGL",
    "webgl2Renderer": "NVIDIA Corporation -- NVIDIA Quadro K2000 OpenGL Engine",
    "webgl2Version": "4.1 NVIDIA-12.0.24 355.11.10.50.10.103",
    "webgl2DriverExtensions": "GL_ARB_blend_func_extended GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5 GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_occlusion_query2 GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_subroutine GL_ARB_shading_language_include GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transform_feedback2 GL_ARB_transform_feedback3 GL_ARB_vertex_attrib_64bit GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_array GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_depth_bounds_test GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_texture_compression_s3tc GL_EXT_texture_filter_anisotropic GL_EXT_texture_mirror_clamp GL_EXT_texture_sRGB_decode GL_APPLE_client_storage GL_APPLE_container_object_shareable GL_APPLE_flush_render GL_APPLE_object_purgeable GL_APPLE_rgb_422 GL_APPLE_row_bytes GL_APPLE_texture_range GL_ATI_texture_mirror_once GL_NV_texture_barrier",
    "webgl2Extensions": "EXT_color_buffer_float EXT_float_blend EXT_texture_compression_rgtc EXT_texture_filter_anisotropic MOZ_debug OES_texture_float_linear WEBGL_compressed_texture_s3tc WEBGL_compressed_texture_s3tc_srgb WEBGL_debug_renderer_info WEBGL_debug_shaders WEBGL_lose_context",
    "webgl2WSIInfo": "CGL",
    "info": {
      "AzureCanvasBackend": "skia",
      "AzureFallbackCanvasBackend": "none",
      "AzureContentBackend": "skia",
      "ApzWheelInput": 1,
      "ApzDragInput": 1,
      "ApzKeyboardInput": 1,
      "ApzAutoscrollInput": 1,
      "TileHeight": 512,
      "TileWidth": 512,
      "CMSOutputProfile": "8476 bytes, too large",
      "DisplayCount": 2,
      "Display0": "1920x1200 scale:1.000000",
      "Display1": "1920x1080 scale:1.000000"
    },
    "featureLog": {
      "features": [
        {
          "name": "HW_COMPOSITING",
          "description": "Compositing",
          "status": "available",
          "log": [
            {
              "type": "default",
              "status": "available"
            }
          ]
        },
        {
          "name": "OPENGL_COMPOSITING",
          "description": "OpenGL Compositing",
          "status": "available",
          "log": [
            {
              "type": "default",
              "status": "available"
            }
          ]
        },
        {
          "name": "WEBRENDER",
          "description": "WebRender",
          "status": "available",
          "log": [
            {
              "type": "default",
              "status": "opt-in",
              "message": "WebRender is an opt-in feature"
            },
            {
              "type": "user",
              "status": "available",
              "message": "Force enabled by pref"
            }
          ]
        },
        {
          "name": "WEBRENDER_QUALIFIED",
          "description": "WebRender qualified",
          "status": "available",
          "log": [
            {
              "type": "default",
              "status": "available"
            }
          ]
        },
        {
          "name": "WEBRENDER_COMPOSITOR",
          "description": "WebRender native compositor",
          "status": "available",
          "log": [
            {
              "type": "default",
              "status": "available"
            }
          ]
        },
        {
          "name": "WEBRENDER_ANGLE",
          "description": "WebRender ANGLE",
          "status": "opt-in",
          "log": [
            {
              "type": "default",
              "status": "opt-in",
              "message": "WebRender ANGLE is an opt-in feature"
            }
          ]
        },
        {
          "name": "WEBRENDER_DCOMP_PRESENT",
          "description": "WebRender DirectComposition",
          "status": "opt-in",
          "log": [
            {
              "type": "default",
              "status": "opt-in",
              "message": "WebRender DirectComposition is an opt-in feature"
            }
          ]
        },
        {
          "name": "OMTP",
          "description": "Off Main Thread Painting",
          "status": "available",
          "log": [
            {
              "type": "default",
              "status": "available"
            }
          ]
        },
        {
          "name": "WEBGPU",
          "description": "WebGPU",
          "status": "disabled",
          "log": [
            {
              "type": "default",
              "status": "disabled",
              "message": "Disabled by default"
            }
          ]
        }
      ],
      "fallbacks": []
    },
    "crashGuards": []
  }

This bug is for crash report bp-8b227fed-7341-4e24-b9f2-53acc0200728.

Top 10 frames of crashing thread:

0 libsystem_kernel.dylib mach_msg_trap 
1 CoreFoundation __CFRunLoopServiceMachPort 
2 CoreFoundation __CFRunLoopRun 
3 CoreFoundation CFRunLoopRunSpecific 
4 HIToolbox RunCurrentEventLoopInMode 
5 HIToolbox ReceiveNextEventCommon 
6 HIToolbox _BlockUntilNextEventMatchingListInModeWithFilter 
7 AppKit _DPSNextEvent 
8 AppKit -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] 
9 XUL -[GeckoNSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] widget/cocoa/nsAppShell.mm:171
Summary: Crash in [@ __CFRunLoopServiceMachPort] → WebRender hangs with mp4 HTML5 video

Also interesting: If I disable WebRender, restart Firefox, then enable WebRender again and restart Firefox again, the hangs stop occurring until the next restart of my computer…

Would you be able to get a profile of one of these hangs using the builtin profiler? https://profiler.firefox.com/

Flags: needinfo?(markus)

Sure! It's available at https://share.firefox.dev/3hUPhn5

Flags: needinfo?(markus)

Thanks!

It looks like its hanging for 37s making a copy of the list of the workspace on your computer. Very odd. Do you have anything unusual about your setup with respect to workspaces?

I have 4 workspaces and I also have a dual monitor setup. Nothing too unusual really… Also this started to happen a couple of weeks ago where I didn't change anything regarding the workspace or monitor setup.

Webrender was enabled on mac around that time, so that is likely the cause.

You could try using mozregression to see if something regressed this recently

https://mozilla.github.io/mozregression/

You would want to make sure use mozregression to set the pref gfx.webrender.all when doing the testing.

Blocks: wr-mac
OS: Unspecified → macOS

I tested this out a bit this morning and I found both WR and non-WR hung as compared to Safari and Chrome.

Seems like WebRender is a red herring then. I was able to confirm this with WR disabled too.

What's curious is that enabling or disabling WebRender and restarting Firefox solves this until the next reboot. But if I clear the startup cache via about:support, the error reoccurs without rebooting the machine.

For me I don't get a hang but the video just doesn't start. And it does seem linked to webrender (I haven't been able to reproduce without webrender). It does seem that changing tabs helps to get the video to start when I'm using webrender.

Regression range for me

https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=5cc77ea38625158138620dea6d8ba0bfa6ed64b7&tochange=2284f261a1689451c75154ca86aad71e3317add0

-> bug 1620679

That bug caused bug 1643204, which has a patch in review. I tested on a local build and I could reproduce the bug. Then I applied the patch from that bug and it fixed the issue for me.

Depends on: 1643204
Regressed by: 1620679
Severity: -- → S3
Priority: -- → P3

(In reply to Timothy Nikkel (:tnikkel) from comment #9)

For me I don't get a hang but the video just doesn't start. And it does seem linked to webrender (I haven't been able to reproduce without webrender). It does seem that changing tabs helps to get the video to start when I'm using webrender.

This seems to be a different bug then. I just tried with the latest nightly (81.0a1; 2020-08-08) and Firefox still freezes the whole system. I don't think the freezing/hanging and the video playback start are the same thing.

Yes, I still have this issue with the build from your link

Flags: needinfo?(markus)

Okay, since I can't reproduce your problem, would you be willing to use mozregression

https://mozilla.github.io/mozregression/

to figure out when the problem started happening? Set the pref gfx.webrender.all to true when doing your testing as we recently flipped that pref and don't want it to confound things.

Flags: needinfo?(markus)

Just checked this again, as the problem didn't seem to occur for a few weeks. And it looks like I can no longer reproduce the issue. I guess we can close this ticket as far as I am concerned.

Flags: needinfo?(markus)
Status: UNCONFIRMED → RESOLVED
Closed: 8 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.