Repository navigation
Closed
Labels
O-PowerPCTarget: PowerPC processorsTarget: PowerPC processorsT-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.Relevant to the infrastructure team, which will review and decide on the PR/issue.
Description
hello, cargo >nightly-2018-09-30 shipped through rustup crashes on startup on ppc64le.
cargo binary compiled on my machine from sources on master or branch rust-1.32.0 runs fine
crash log
Program received signal SIGILL, Illegal instruction.
0x0000000100000004 in ?? ()
(gdb) bt
#0 0x0000000100000004 in ?? ()
#1 0x00000001008a9650 in rand_pool_acquire_entropy ()
#2 0x00000001008a8e48 in rand_drbg_get_entropy ()
#3 0x00000001008a6618 in RAND_DRBG_instantiate ()
#4 0x00000001008a7868 in drbg_setup ()
#5 0x00000001008a7988 in do_rand_drbg_init_ossl_ ()
#6 0x00007ffff7ef4e08 in __pthread_once_slow (once_control=0x100cfa6f8 <rand_drbg_init>, init_routine=0x1008a78e0 <do_rand_drbg_init_ossl_>)
at pthread_once.c:116
#7 0x00000001008cc2d8 in CRYPTO_THREAD_run_once ()
#8 0x00000001008a7e30 in RAND_DRBG_get0_public ()
#9 0x00000001008a7f18 in drbg_bytes ()
#10 0x00000001008a9230 in RAND_bytes ()
#11 0x00000001007f0330 in SSL_CTX_new ()
#12 0x0000000100708ec8 in git_openssl_stream_global_init ()
#13 0x00000001006bc1d4 in init_once ()
#14 0x00007ffff7ef4e08 in __pthread_once_slow (once_control=0x100cf830c <_once_init>, init_routine=0x1006bc100 <init_once>) at pthread_once.c:116
#15 0x00000001006bc344 in git_libgit2_init ()
#16 0x0000000100695fd0 in std::sync::once::Once::call_once::{{closure}} ()
#17 0x00000001009f0df4 in std::sync::once::Once::call_inner () at src/libstd/sync/once.rs:387
#18 0x0000000100695f78 in libgit2_sys::init ()
#19 0x0000000100686c90 in git2::config::Config::open_default ()
#20 0x0000000100452de0 in cargo::ops::registry::http_proxy ()
#21 0x000000010045145c in cargo::ops::registry::needs_custom_http_transport ()
#22 0x00000001000c9e78 in cargo::main ()
#23 0x00000001000bf084 in std::rt::lang_start::{{closure}} ()
#24 0x00000001009f2a34 in std::rt::lang_start_internal::{{closure}}::{{closure}} () at src/libstd/rt.rs:49
#25 std::sys_common::backtrace::__rust_begin_short_backtrace () at src/libstd/sys_common/backtrace.rs:135
#26 0x00000001009f501c in std::rt::lang_start_internal::{{closure}} () at src/libstd/rt.rs:49
#27 std::panicking::try::do_call () at src/libstd/panicking.rs:297
#28 0x0000000100a03b94 in __rust_maybe_catch_panic () at src/libpanic_unwind/lib.rs:92
#29 0x00000001009f5ea8 in std::panicking::try () at src/libstd/panicking.rs:276
#30 std::panic::catch_unwind () at src/libstd/panic.rs:388
#31 std::rt::lang_start_internal () at src/libstd/rt.rs:48
#32 0x00000001000cc4d8 in main ()
My machine is a RaptorCS Talos II, it has an IBM POWER9 processor, my system is Fedora 29 with latest updates.
I would guess this is a build environment issue on your end; please indicate how I can help, thanks a lot for your time!
Metadata
Metadata
Assignees
Labels
O-PowerPCTarget: PowerPC processorsTarget: PowerPC processorsT-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.Relevant to the infrastructure team, which will review and decide on the PR/issue.
Activity
nagisa commentedon Jan 4, 2019
Thanks for the report. Seems very similar rust-lang/cargo#6320 that occurs on big endian...
llebout commentedon Jan 4, 2019
I saw that other issue before; the backtrace is largely different, and recompiling just works so. I am confused as to how it could not build correctly, I built mine with stable 1.30.1 and it's OK. I had to modify the source a little to allow use of experimental clippy features.
nagisa commentedon Jan 4, 2019
And so it does for the big endian. Why I think these are similar issues is because just like in the other report the pc is somewhere around
0x100000000or some similar very-round number. Basically it feels to me that we simply embed a bad openssl for either PPC. It could be caused by an older toolchain, older openssl source or some other reason. I do agree that it is likely an infrastructure issue.mpe commentedon Jan 18, 2019
The SIGIILL is happening because the program has branched somewhere that's not code. In fact it branches to 0 (relocated) which is the start of the ELF.
It seems to be coming from here:
Which is also what we see in the obdump:
So for some reason we have a branch to address 0, but there's nothing at address 0 and in fact there isn't even code there. Which looks like some sort of toolchain screwup.
If I build openssl and look at the objdump of
./crypto/rand/libcrypto-lib-rand_unix.oI think this matches up with this code (code-gen is not identical):So it's the call to
getentropythat's resulted in the bad branch. And interestinglygetentropyis a weak symbol:And:
That leads us to this issue:
openssl/openssl#6591
Which suggests the
getentropycall requires GLIBC 2.25 or newer to work.I don't actually know where or how the rust ppc64le binaries are built. But it looks like they are built against glibc 2.17:
Presumably building on a system with GLIBC 2.25 or newer would fix the issue.
llebout commentedon Jan 20, 2019
I have GLIBC 2.28 over here, so that's probably it, thanks for the detailed investigation
infinity0 commentedon Feb 10, 2019
cc @jrtc27
nagisa commentedon Feb 10, 2019
cc @rust-lang/infra
Updating the docker images should be fairly easy, I think.
Mark-Simulacrum commentedon Feb 18, 2019
cc @alexcrichton
I'm not sure if it's as easy as just updating our images since I suspect that'll break other use cases in practice (we're on them for a reason after all).
mati865 commentedon Feb 18, 2019
Upgrading only the binutils usually doesn't break compatibility with older systems but without running it on older PPC distro you can't really know.
mpe commentedon Feb 19, 2019
Where/how are the builds done currently?
alexcrichton commentedon Feb 19, 2019
If it's just a binutils upgrade that's fine to land at any time, and they're located in
src/ci/docker/*files which configures all our distribution builds.dist-powerpc64le-linux: Update binutils version
10 remaining items
cuviper commentedon Mar 21, 2019
The official builds are only updated as part of the release process. I'll nominate my PR for beta and stable, but I'm not aware of any plans for a 1.33.z point release.
llebout commentedon Mar 21, 2019
Well the builds don't work at all, it's not a new release, rather a build system update? Don't change the version? I don't know if that's OK with rustup.
emilyalbini commentedon Mar 21, 2019
Our build system fetches its configuration from the source code it's building, so to get @cuviper's patch in we'd have to make an actual point release.
llebout commentedon Mar 21, 2019
@pietroalbini Okay then, when (approximate) should I expect the next stable release?
cuviper commentedon Mar 21, 2019
You can see projected release dates on this page: https://forge.rust-lang.org/
llebout commentedon Mar 21, 2019
Thank you @cuviper
PowerPC will not have working stable releases from rustup until the 11th of April 2019, unless you make a point release. I'd appreciate if you did make one, if the same thing happened on x86, you'd make one.
Thanks for all the great work.
cuviper commentedon Mar 21, 2019
Certainly, but x86 bootstraps everything else -- it cannot be left broken. There is also a notion of tiered support, where i686 and x86_64 are tier 1, and other arches are tier 2, "not guaranteed to produce a working build." (but also "patches are always welcome!" as I have provided in this case.)
Since you're on Fedora, is there a reason you can't just use its rust packages?
(I'm also the package maintainer there.)
llebout commentedon Mar 21, 2019
@cuviper
There's no platform with tier1 support that can run without proprietary firmware, or else, old computers.
Fedora packages are not nightly and installing both rustup and Fedora packages is not supported. I often have to switch between stable and nightly for diverse projects with different requirements.
mati865 commentedon Mar 21, 2019
@Leo-LB it's not officially supported but you can point
rustupto your system toolchain as explained here: https://github.com/rust-lang/rustup.rs#working-with-distribution-rust-packagesThis way you can make
systemtoolchain the default on and usecargo +nightly build.llebout commentedon Mar 21, 2019
@mati865 Oh cool! Thank you, that will come in handy. I had previously been looking for such a thing and did not find it.
llebout commentedon Mar 21, 2019
Now there's another problem, it's that IntelliJ IDEA with Rust support wont install additional components automatically because the "system" toolchain does not support that.
But it's OK, I can code with nightly and compile with stable or nightly as needed.
kgardas commentedon Apr 11, 2019
Unfortunately it looks like 1.34 also exhibits this issue.
cuviper commentedon Apr 11, 2019
Correct, the infrastructure team declined the backport: #58986 (comment)
The current beta 1.35 and forward should be fine.
llebout commentedon Apr 11, 2019
It should have been fixed for 1.34.
It's not like a binutils update requires any kind of stabilization, especially in front of something that does not work.
emilyalbini commentedon Apr 11, 2019
Explained the reason why the backport to 1.34 was rejected in a comment in another PR.