-
Notifications
You must be signed in to change notification settings - Fork 13.5k
x86_64/uftrace segmentation fault #42971
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
Comments
Still crashing as of post-17 trunk: https://godbolt.org/z/7beb6xYrh void print_diff_percent() {
__pr_out("%s%+7.2f%s%%", "", 999.99, "");
} |
@llvm/issue-subscribers-backend-x86 |
CC @phoebewang |
I think so. GCC will still generate SSE2 instruction even though SSE2 is disabled. I think we just need a better diagnosis instead of crash directly. |
Oh this is neat. https://godbolt.org/z/hTK96nWaT Not asserting: So I think the issue is that the implicit function declaration is a K&R C function, so when we allow the definition to be implicitly declared, we trigger the backend assertion. I wonder if the best approach here is to make it an error to attempt to disable sse2 (or any target features) that are required for ABI purposes for any given target? CC @MaskRay for opinions |
This is likely a duplicate of #29774. I have a reply at #29774 (comment) |
I think people misusing the options is exactly why we should start to diagnose it (we've already gotten multiple reports from users about crashing, so this is something people are hitting repeatedly). Is there a way we can do a gentle introduction (like warn "this combination of options will be a hard error in Clang N") so that we can start moving the needle in the correct direction? Could @nickdesaulniers or @nathanchance help us with the Linux kernel side of things? |
I could help facilitate discussion with the x86 maintainers around this but without an equivalent way to ensure no FP code gets generated for the kernel, I suspect they won't be too receptive to killing this combination of options. I had to dig quite a bit to find out what change added |
The kernel's intent is to avoid having the compiler generate code using SIMD or FP registers. The Linux kernel generally does not use FP/SIMD as doing so adds overhead to pre-emption of kernel threads (and generally doesn't need FP support). There are a few exceptions. So if clang were to reject
If the user specifies every -mno- flag in the book, then tries to use floating point on x86, clang should diagnose that. That is the correct fix here IMO. // $ clang -mno-sse2
void print_diff_percent() {
__pr_out("%s%+7.2f%s%%", "", 999.99, "");
^ error: calling convention requires sse2 for argument of type double, but -mno-sse2 set.
} |
I agree, but I don't think Clang has the information it needs to be able to diagnose this in general. Making it a backend diagnostic would perhaps be a good option if we had reasonable source location fidelity, but AFAIK, that's still an unsolved issue in LLVM. The part I keep running around in my head is that |
The use case is to capture FP/SIMD register values when it traces functions. Basically For FP/SIMD arguments, it needs to read the register value when it records the trace data. It may save all register values (including FP/SIMD) at the beginning of |
Extended Description
attached sample makes clang crash
The text was updated successfully, but these errors were encountered: