-
-
Notifications
You must be signed in to change notification settings - Fork 30.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
Use of ffi_type_complex_double
is unguarded
#128156
Comments
I started taking a look at a patch for this, but it doesn't look trivial. The existing checks use
The ergonomic way to do this is beyond my knowledge, but I'm very happy to submit a patch if someone wants to provide some guidance. |
cc @skirpichev |
@picnixz you can also apply the Thank you for your quick triage :) |
Looks as a false positive to me. I don't understand why we need MacOS-specific workaround when nothing is broken. |
@skirpichev won't CPython segfault when this function is called on macOS older than 10.15? The typical pattern on macOS is to guard usage, e.g., in these similar situations:
This is also blocking adding a guard against future regressions, see #128155 (comment). cc @ned-deily |
Context: this is for cases where CPython is built to run on a range of macOS releases, like we do for the python.org macOS installer builds. This involves building on a newer (current) version of macOS (like |
How? If libffi has no proper support for complex types, then configure script will not define Edit:
I see. So, for such builds you want to revert compile-time decision on That will require substantial rewrite of complex numbers support in ctypes. |
I would suggest rather unset Py_FFI_SUPPORT_C_COMPLEX for such builds at compile time. |
Basically, yes.
That's a possibility, but weak symbols allow for portable builds which retain the functionality when available. This is common on macOS because there's robust support for it, but there's also interest in using weak symbols for Linux targets.
This is unfortunate. I'm not sure how to weigh the trade-offs here — but I'm curious if the idea that it's not macOS-specific changes your opinion? Anyway, I don't think it's a great outcome to need to rewrite this module. I think an "easy" path forward here is to bump the minimum supported macOS version to 10.15 — it's not a big bump and @ned-deily had previously suggested this. There's some data on usage here. We may need to revisit this module when adding weak symbols for Linux, but I have no clue how modern of library versions the functionality here depends on yet. |
So far it doesn't look relevant for Linux builds. Unfortunately, here we can't rely just on existence of libffi type at runtime. See #125206.
If this is an option - looks great. |
We've set the minimum in CI to 10.15 but formalizing that in a policy will be a separate task (see #128155 (comment)). I can't tell if it makes sense to leave this issue open since |
Bug report
Bug description:
e.g.
See #100384 for context and similar issues.
CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
The text was updated successfully, but these errors were encountered: