-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rust miscompiles Servo after upgrading to new revision of Rust #16366
Comments
There is a Servo branch that preserves this behavior at: |
@brson Can you help us find an owner for this? We landed a Rust upgrade by changing our code to avoid this compilation issue, so it's not blocking immediately, but still a scary bug. |
Nominating. |
Assigning P-high, not 1.0. (Niko has volunteered to look into it further, which hopefully will yield more data for us to work with.) |
It's possible we just hit this again tracking down random graphics stack failures. See the Servo issue linked above. |
So I can certainly reproduce the failure. Investigating more. |
Reading this patch more clearly, I think the real problem is that the old code was just wrong and abusing transmute. I'm sure the crash is due to the new code that reuses stack space more aggressively. Take a look at what's going on here (original code, variables renamed for clarity):
Here a block is created and then a variable |
(FWIW, that suggests that the bug (in Servo) may've been triggered by #15863, since that presumably allowed LLVM to start reusing the stack space of |
I'm not sure if this is related, but @zwarich and @mrobinson have been tracking down more bugs caused by the Rust upgrade and found this: |
Yep, similar bug there creating a dangling |
Why does the println! affect it? Why does optimization affect it? |
Rust is now making use of stack coloring, so stack slots may get reused
|
@huonw yes, thanks for the link. That's the patch I was thinking of when I said "new code that reuses stack space more aggressively". |
It seems like this isn't a rust bug so in that case can this be closed? |
@luqmana Yes. |
@metajack This kind of bug argues for servo not using the general purpose transmute, but rather more specific varieties. For example,a version that goes from |
It seems like the second example could have been caught by the compiler, but I guess it stops all checking once you've cast to a raw pointer. |
internal: Make data queries transparent over their diagnostics variant And a few other QoL things
PR rust-lang#16366 moved layout information to a separate line, so the leading whitespace is no longer necessary.
minor: Fix unwanted leading whitespace in hover text PR rust-lang#16366 moved layout information to a separate line, so the leading whitespace is no longer necessary.
In the current Servo Rust upgrade branch (rustup-20140804-debug-segfault 4f40685a), Servo currently dies with a double borrow error loading essentially any page:
Moving a single line of code out of an
unsafe
block makes this problem go away, which points to a miscompilation in at least one version of this code:The text was updated successfully, but these errors were encountered: