Closed Bug 2004199 Opened 11 months ago Closed 11 months ago

[GFX1-]: (mate) Wayland protocol error: wp_viewport#16096: error 2: source rectangle out of buffer bounds

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 147
defect

Tracking

()

RESOLVED FIXED
148 Branch
Tracking Status
firefox148 --- fixed

People

(Reporter: s.zharkoff, Assigned: stransky)

References

(Blocks 2 open bugs)

Details

Attachments

(5 files, 2 external files, 1 obsolete file)

Attached file all_output.log.gz —

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

Steps to reproduce:

Linux, Mate, wayfire. Open youtube, start video, scroll up-down several times while video playnig

Actual results:

Crash, wayland widget log attached

Expected results:

No crash

This issue was gone for a while and 1992198 was looking like a solution, but now it is back again. The most strange thing that it is pretty unstable - it can happen at very first scroll attempt or may take a while to happen. So I am noy sure if 1992198 actually fixed that or it was a kind of coinsidence and it simply was not happening after the bugfix landed. Now managed to repeat it again and capture all logs.

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

Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Attached file gdb backtrace —

one more thing I found out - the scrolling crash 720p videos like this one

https://www.youtube.com/watch?v=JQArf1e5yDM&list=RDJQArf1e5yDM&start_radio=1

But 1080 FDH ones are OK. this one I can scroll back and forth may times no issues.

https://www.youtube.com/watch?v=p_IwFRtc5g4&list=RDp_IwFRtc5g4&start_radio=1

But as soon as I switch the reolution to 720 - I get crash almost immediately while scrolling.

not exactly the size of video matters but relations between viewport ratio where the video is shown and the video resolution. Changed window size and now appily crashing on 1920х1080.

1840х1035 viewport - videos 1080 fine, 480 fine
720 crash, 360 crash.

Looks like some rounding issue.

Is that HDR mode enabled?

Blocks: wayland
Flags: needinfo?(s.zharkoff)

So here we are:

[3892804.162] {Default Queue}  -> zwp_linux_buffer_params_v1#88.create_immed(new id wl_buffer#108, 1280, 720, 842094158, 0)

[Parent 1458754: Renderer]: D/WidgetWayland [7f5cbda69300]: WaylandSurface::SetViewPortSourceRectLocked(): [0.000000, 666.251953] -> [1279.440308 x 53.748047]
[3897773.282] {Default Queue}  -> wp_viewport#507.set_source(0.00000000, 666.25390625, 1279.44140625, 53.75000000)

coords are [1279.44140625 x 720.00390625]. I wonder if we should round that somehow.

Flags: needinfo?(s.zharkoff) → needinfo?(stransky)
Priority: -- → P3

in fact it does not matter if I enable HDR or not. Crashes anyway.
Also I've tried with labwc to exclude possible issue at wayfire side - no difference.

Also I've tried to change fractional scaling on/off in about:config - does not matter.

So looks like mismatch is between 1279.440308 and 1279.44140625. about 1/1000 of a pixel - does it really worth to calculate something that can not be displayed anyway? The minimal quant of of the screen is 1/3 of a pixel with sub-pixel rendering, but that's it. So rounding seems to be a good idea, not in the intermediate calculation as it can play a bad joke in calculation formulas, but after the calculation is done and pushing the data to gtk engine or compositor - dont know whoever is calling the wayland client call with mismatched numbers...

Attached patch round_try1.patch (obsolete) — — Splinter Review

applied this quick/dirty POC patch over autoland. Did not manage to crash while scrolling both 720 and 1080 videos. Not optimal for sure - using double math , while wl_fixed_from_double implements just some simple operations like adding and shifting.

still crashing - less but sometmes.

chanfed this *100, /100 to simple integer round(). Looks better. Tried to set 1.1 fracctional scaling on my display - no issue too. So weems that those decimals are not important for wp_viewport_set_sorce.

Attached patch round_try2.patch — — Splinter Review
Attachment #9532094 - Attachment is obsolete: true

We need to round x+width <= buffer_width here, so we'd need to round x or width or both somehow.

So far I've rounded all coords up to integer - x,y, width, height. Seems to be OK so far.

Flags: needinfo?(stransky)
Assignee: nobody → stransky
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Severity: -- → S3
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 148 Branch
See Also: → 2001219
QA Whiteboard: [qa-triage-done-c149/b148]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: