-
Notifications
You must be signed in to change notification settings - Fork 503
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
build.rs panics with debug assertions in the standard library enabled #422
Comments
|
The panic is interesting, but not very actionable unless there's a consistent repro. It doesn't look familiar. You'll have a hard time linking on Linux due to the lack of libs, until we have support for DLL imports in Rust. We have someone looking into that. |
This is probably not worth looking into then. The bit about DLL imports looks very cool, I didn't realize that was possible :) |
I found why this only panicked locally, that's a |
windows-rs/crates/winmd/src/parsed/blob.rs Lines 80 to 89 in 4a29151
This is UB. |
The issue is that |
Yes, and it can also be null. |
If either |
I'd have to check the ECMA spec, but if it is null then it probably just means it should be an empty string. I'm not sure whether it is guaranteed to be aligned, but we can always harden it to deal with that case. Is there a reliable repro for this? |
@kennykerr you'd have to compile a custom rustc, by default these assertions are disabled. There are instructions at https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html, or @rylev already has a local compiler built. |
Alternatively you can copy the assertion into your code: https://github.com/rust-lang/rust/blob/84864bfea9c00fb90a1fa6e3af1d8ad52ce8f9ec/library/core/src/intrinsics.rs#L1742 |
There is a bug in the source metadata where many constants are missing values. microsoft/win32metadata#88 This may be what is causing the null case. I'm not sure what would be causing the unaligned case. The ECMA spec says that all data must be stored with proper alignment. It's possible this is not being preserved when the PE file (winmd) is copied into a |
Field constants are the only place where UTF16 values are stored within the winmd file. For the most part, strings are always UTF8. |
And thanks @jyn514 - Ryan said he'll take a look at fixing this. |
This is with an incremental build with a newly built compiler, so there's a small possibility it could be rust-lang/rust#76720. But I'm reporting it just in case it's a bug in the build script itself.
The command I ran was
where
+stage1
is rust-lang/rust@5f74ab4.The text was updated successfully, but these errors were encountered: