-
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
error: could not compile gkrust
since Rust 1.43 on SPARC Solaris
#74551
Comments
@ecstatic-morse any idea what can be wrong with it on SPARC (64 bits big endian system)? There is also core file generated:
|
This is concerning. To confirm, this occurs with recent nightlies as well? The commit you bisected to (part of #69676) re-enabled the optimization around drop elaboration in #68528, which could have plausibly caused this kind of issue. There's nothing target-dependent about that PR, so while it's possible that #68528 triggered a SPARC-only LLVM bug, it's very possible that there's a latent miscompilation on other platforms as well that manifests as a segmentation fault due to some detail of SPARC. However, it's surprising that we didn't see any issues from users on Intel machines. The innermost frame points to this implementation detail of Nominating for @rust-lang/compiler discussion to put this on their radar, since it could affect tier 1 platforms as well. |
Latest version I have tested is Rust 1.44.1. I can revert the commit and I can use it to build Firefox. I will try latest nightly build as well. But I will need to build Rust 1.45 first (there are no bootstrap archives for Solaris).
Unfortunately my knowledge of Rust and its internals are very limited. Plus I believe ASan is not available for SPARC. |
I'm not able to build it now because of #74628 . |
This kind of issues are often caught by LLVM assertions, so as a starting step |
Assigning |
Oof. This is gonna be a tough one to figure out.
CI builds and tests |
self-assigning to investigate whether its reasonable to replicate this atop GCC build farm or not |
Here's a datapoint for you: I have exactly the same issue on Linux/PPC64 (big endian) with rust 1.44.1. Reverting e82ec23 fixes the problem for me as well. |
@zeldin when you say "exactly the same problem", are you also attempting to build firefox and seeing this failure on the Or do you have a smaller example test case to illustrate the problem on Linux/PPC64? |
@pnkfelix Yes, I'm attempting to build firefox, and getting the SIGSEGV building |
@zeldin okay, thanks. While I was hoping you'd have a smaller test case, the info you have given is nonetheless very helpful, since I think I'll have an easier time investigating this on PPC64, which is (I believe) a higher tier platform than SPARC Solaris. (At the very least, PPC64 has |
Just for record. Since there is no ASan for SPARC I have tried to run problematic rustc command with enabled ADISTACK and ADIHEAP (https://docs.oracle.com/cd/E37838_01/html/E61021/sysauth-adistack.html). There is no difference with enabling or disabling them:
|
Same issue with Rust 1.45.2 on ArchPOWER (ppc64le) with Firefox 79.0 (both from release tarballs) . |
Also hit this on gentoo/ppc64le. I stumbled across this fedora bug which led me to this LLVM patch. After applying the patch to llvm and rebuilding rust, firefox and gkrust build successfully for me. |
@shawnanastasio is this patch committed in LLVM 11? |
@shawnanastasio This patch does not fix the issue for me on big endian PPC64 (and is of course unlikely to fix the OP:s problem on Solaris/SPARC). Still, it's probably a good idea to apply it if using PPC64 as a platform to look for the issue, so as not to go down the wrong rabbit hole. :-) |
Its purpose is to assist in debugging rust-lang#77382 and rust-lang#74551.
An update for anyone following this: #77382 was recently filed in which a similar optimization to #68528 caused a miscompilation on z/Architecture systems. I opened #77423 to help a compiler team member with access to that hardware collect more information. As a result, nightly users can disable the optimization identified by the bisection via However, we soon learned that this family of optimizations was not the root cause of the issue. In fact, a recent change had caused it to manifest regardless of whether #68528 was disabled. We're (well mostly "they're" 😄) still working to diagnose the exact cause. It's possible that something similar is occurring on SPARC and PowerPC architectures. I'm not sure how hard it is to compile Firefox with custom |
@ecstatic-morse Tested on ppc64 with I configured with
However, the build broke on something unrelated:
Not sure what is the best way to proceed here... Also, it seems that firefox-80.0.1 can be built with rust-1.45.2 without any patches. Whether this is due to changes in rust or in firefox I do not know. |
(This is the error message I get if I add
|
@zeldin: That looks like an issue caused by one of the recent fixes in the proc-macro system ( |
So, in order to sort out what is what, I tried downloading binaries of 1.44.1 and 1.45.2 from https://static.rust-lang.org/dist/ and using them to build the same firefox 79.0 tree.
😞 |
Ha, that annoying error actually seems to have been a clue:
So |
Bisecting 1.45 shows that this is the commit that fixed the issue:
So, an LLVM bug then. |
This comment has been minimized.
This comment has been minimized.
I'm seeing this bug when building firefox 1.43.0 from source on ubuntu focal (20.04) for amd64, so agreeing that this is not target-dependent. |
"Latest version I have tested is Rust 1.44.1. I can revert the commit and I can use it to build Firefox." So psumbera, are you saying you have successfully built a Firefox using Rust for Solaris SPARC? I would dearly love to know how to do this. Or a copy of your binary (pretty please). Any Firefox > 52.0 would be an improvement. [Does this board have a mechanism to send pm's?] |
Yes. Latest Solaris 11.4 SRU contains Firefox 78. Following link shows ho we build it: https://github.com/oracle/solaris-userland/tree/master/components/desktop/firefox |
"Yes. Latest Solaris 11.4 SRU contains Firefox 78." Does the solaris-userland archive require that you already have Rust? Because I've also been unable to build Rust for Solaris 11.4 SPARC, since you apprently have to have Rust before you can build Rust. Meanwhile, I've been pulling my hair out trying to cross compile a Firefox for SPARC on a Ubuntu x64 host and that's not working either. |
Actually, looking at that link I'm afraid I still don't know how to proceed. Just download everything and type gmake? And this is going to work even if Rust (which doesn't exist for Solaris SPARC AFAIK) is not on my machine? |
Can you contact me offline via email (first name . surname @ company . com ) ? I can try to help you to bootstrap Rust for Firefox build. |
Email sent. |
I confirm this issue with OpenBSD 7.0, I tried 2 different ports: firefox-esr and firefox-i18n |
When I build Firefox on Solaris SPARC it fails with:
This worked well till Rust 1.42. Since Rust 1.43 it fails. There is no problem on X86 Solaris.
I was able to bisect this to following change:
e82ec23
The text was updated successfully, but these errors were encountered: