-
Notifications
You must be signed in to change notification settings - Fork 700
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
SIGSEV invalid memory reference on Alpine musl with libclang-static and g++ 11.2 #2333
Comments
It seems cargo is what's crashing? That's not a very useful stack either, it'd be nice if there were debug symbols. |
I don't know why the symbols are not shipped for musl target, they should be as per rust-lang/rust#90733 |
Could you re-try after doing $ export RUSTFLAGS=-Ctarget-feature=-crt-static ? |
This does work but I would get lot of poisoned instance on my tests (even with
|
My "solution" to this is to replace the symlink from #include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv)
{
static char *rustc = "rustc";
static char *fix_linking = "-Ctarget-feature=-crt-static";
char **args = calloc(sizeof(char *), argc + 1);
if (!args) {
puts("calloc() failed");
return EXIT_FAILURE;
}
args[0] = rustc;
args[1] = fix_linking;
int pos = 1;
while (argv[pos] != NULL) {
args[pos + 1] = argv[pos];
pos++;
}
int retval = execv("/usr/bin/rustup-init", args);
printf("execv() failed with: %d\n", retval);
return EXIT_FAILURE;
} |
I have the same issue and the above I guess at worst I can invoke it instead of using the library directly... EDIT: |
When building bindgen with clang static and gcc 11.2, it will fail with sigsev invalid memory reference, this is a conflict with clang-sys likely and newer gcc.
Error
What was run
Note : I had to remove the default-features because features are not exclusive in that setup so adding static will conflict with runtime
Setup
How to reproduce
Install alpine 3.16 64bits (you can also use docker:
docker run -it --rm alpine:3.16 sh
)Then follow the previous paragraph (What was run)
Other information
commit tested : 9c32b46
Tested back until ^0.50, confirmed still a bug and related to new g++
GDB
The text was updated successfully, but these errors were encountered: