Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

longcat and rotating-rust display all sorts of random graphics artifacts during animation #3084

Closed
larsbergstrom opened this issue Aug 13, 2014 · 7 comments

Comments

@larsbergstrom
Copy link
Contributor

@larsbergstrom larsbergstrom commented Aug 13, 2014

I suspect that we are reusing graphics buffers in a very interesting way:
summit2

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?

@mrobinson
Copy link
Member

@mrobinson mrobinson commented Aug 14, 2014

This looks a lot like the issue I'm bisecting. Hoping to have something concrete today.

@mrobinson
Copy link
Member

@mrobinson mrobinson commented Aug 14, 2014

Pretty sure this originates with the rust upgrade. @larsbergstrom, do you also see this failure with servo -c?

@larsbergstrom
Copy link
Contributor Author

@larsbergstrom larsbergstrom commented Aug 14, 2014

@mrobinson No, this bug only occurs with GPU rendering.

@mrobinson
Copy link
Member

@mrobinson mrobinson commented Aug 15, 2014

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:

diff --git a/azure_hl.rs b/azure_hl.rs
index 69c0670..f48f379 100644
--- a/azure_hl.rs
+++ b/azure_hl.rs
@@ -488,6 +488,7 @@ impl DrawTarget {
             let draw_options = match draw_options {
                 None => ptr::mut_null(),
                 Some(mut draw_options) => {
+                    println!("This shouldn't fix anything, but it does...");
                     let draw_options: *mut AzDrawOptions = &mut draw_options;
                     draw_options
                 }

The issue seems to be that the alpha value of AzDrawOptions is set to 0 and the compositor operator is not passed properly either.

@zwarich
Copy link

@zwarich zwarich commented Aug 15, 2014

@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.

@mrobinson
Copy link
Member

@mrobinson mrobinson commented Aug 15, 2014

Configuring with --disable-optimize also seems to fix this issue.

@metajack
Copy link
Contributor

@metajack metajack commented Aug 15, 2014

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.

dotdash added a commit to dotdash/rust-azure that referenced this issue Aug 16, 2014
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.
dotdash added a commit to dotdash/servo that referenced this issue Aug 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants
You can’t perform that action at this time.