-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Segfault in rustc while cross-compiling core #53099
Comments
As an aside, I'd gladly help debug and potentially even fix this issue if someone can help me figure out my build system problems. Currently, I've tried to build the MSVC version of rust, and it fails with this error message:
I have no idea what to do about that. I've also tried building the MINGW variant, but that fails with a different error message about an unknown argument to |
I was able to build rustc on my Linux machine and try it there. The development version gives this error:
LLVM assertions are disabled in release builds of rustc, so that would make sense. |
I was able to collect a stack-trace from
|
Still working on debugging this. I've never worked with LLVM before (let alone the internals of instruction selection) so I only have a vague idea of how this code works. I'd appreciate it if someone more familiar could comment on this. The segfault happens in
Specifically, it segfaults inside the
This makes it seem like it's expected that the call site can be zero. However, the code above has no guard, so when it reaches this code it dereferences a NULL pointer and segfaults. |
Did you disable LLVM assertions in order to get the stacktrace? I'm facing failed assertion earlier:
Looks like some edge case of
|
I did disable LLVM assertions, but I didn't see that particular assertion, only the one mentioned above relating to incompatible data layouts. In that case, I figured out that adding |
@denzp reports (#38789 (comment)) that setting the |
To be honest, I don't understand why Currently, there are two main issues you might face when you are trying to produce PTX assembly for a whole
I tried to implement a solution for this last year, but even personally I'm not satisfied with it. I abandoned the changes because I focused on In the best case, when LLVM wouldn't complain about I'm going to give another try to implement a proper solution for the undefined intrinsics and hopefully we will get rid of the compilation errors! |
Thanks for looking into this. Now that the ptx-linker is available, this issue no longer is no longer blocking me. I'd be happy to test out changes if needed, though. I'm not sure I understand this part:
I wasn't running that command (unless cargo-xbuild uses it behind the scenes), so I'm not sure how that's relevant. |
Heya ! Is this still a problem or were you able to fix it ? thank you :) |
I was never able to fix it. I haven't tried recently, so it may have been fixed by someone else. |
Is this issue relevant after |
I'm trying to compile the kernel code from japaric/nvptx to PTX. This requires cross-compiling the
core
crate. When I run the command to do this,rustc
crashes with a segfault. I'm usingcargo-xbuild
becausexargo
doesn't seem to work anymore.cargo xbuild --target nvptx64-nvidia-cuda.json --verbose
Output:
The important bit is:
(signal: 11, SIGSEGV: invalid memory reference)
. I've tried this under Windows, WSL and MINGW (as well as a second machine running Arch Linux), it's completely consistent.Version:
cargo 1.29.0-nightly (15433e8cc 2018-08-02)
(I have also seen a similar crash with 2018-04-04).I've tried to build a version of rustc with debug symbols so that I could collect more information, but have been unable to get a working build.
The text was updated successfully, but these errors were encountered: