Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign uplongcat and rotating-rust display all sorts of random graphics artifacts during animation #3084
Comments
|
This looks a lot like the issue I'm bisecting. Hoping to have something concrete today. |
|
Pretty sure this originates with the rust upgrade. @larsbergstrom, do you also see this failure with servo -c? |
|
@mrobinson No, this bug only occurs with GPU rendering. |
|
This does seem like a Rust bug of some kind. I'm seeing Rust structures corrupted as they pass the FFI barrier. For instance, this patch to rust-azure fixes the corruption for me:
The issue seems to be that the alpha value of AzDrawOptions is set to 0 and the compositor operator is not passed properly either. |
|
@mrobinson Can you easily detect this on the Azure C side? If so then we should be able to make a reduced test case by calling a C function with the same signature. |
|
Configuring with --disable-optimize also seems to fix this issue. |
|
This sounds exactly like rust-lang/rust#16366, but the workaround is even more bizarre. I wonder if a println! would fix the example in the Rust issue. |
The `draw_options` variable within the match expression is only valid for the duration of the match expression, but by using an unsafe pointer the code manages to violate the lifetime rules and creates a pointer to it that's outlives the match expression. Instead of creating a copy of the AzDrawOptions in the match, we can get a ref to the one contained in the Option and hand out of pointer to that one, which lives long enough. Refs servo/servo#3084.
I suspect that we are reusing graphics buffers in a very interesting way:

To repro, just ./servo ../src/test/html/summit-two.html
note that longcat has similar issues: ./servo ../src/test/html/summit-one.html
@mrobinson @zwarich ideas?