-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
BUG: import scipy.stats fails under valgrind #17368
Comments
Thanks for the report @PhilMiller. How did you install SciPy and Python? @seberg I think you're running NumPy under Valgrind regularly - are you aware of 1.23.4 not working? |
Nah, I run things regularly (as in before any release except bug-fix releases). I patched Python, to show what should be the real error (it would be nice to chain the error, but I think I may need to ask for permission to just make a PR to C-Python):
which in turn points to |
Maybe valgrind causes an incorrect FPE to be set, but not sure? |
Ah, the error originates from this boost policy: https://github.com/scipy/scipy/blob/main/scipy/stats/_boost/include/func_defs.hpp#L41 Would probably be best if someone looks at it with boost/C++ glasses about stats/special. |
In case it's still material, Python is as packaged in Ubuntu 20.04, and SciPy and everything else are from |
If you need C++ expertise in following through on debugging, let me know and we can set a time. |
@PhilMiller not sure if that is necessary. I would suggest by continuing to patch (or just setting a breakpoint) up that EDIT: Btw. clearly reproducing the issue "just works" for me, that was on debian with a python3.9 (and a python3.9 or 3.10 dev I had still flying around; I also used the |
This is the result of an uncaught exception in the Boost code. We have Cython code (generated during the build) that wraps a bunch of the methods of Boost's beta distribution as ufuncs. Some of those Boost methods depend on
result in the call @mckib2, any ideas? |
I just noticed this a few lines down in the Boost file
So perhaps Boost's attempt to work around valgrind's behavior with |
... and it looks like this has already been fixed in Boost: boostorg/math#809 So the issue should be fixed when we update our vendored version of Boost to 1.80+. |
I immediately thought of some weird compiler issues we've seen with Boost, but I think that's the case. I think you're right @WarrenWeckesser, once gh-17207 goes in this will be fixed or we can add the upstream patch. I think that's currently blocking on me doing a refactor to get Boost.Math as a standalone project |
valgrind doesn't support longdouble. Those constants are too big for longdouble. So, the error is not unexpected, in NumPy testing, these are usually just warnings (and quite a few tests fail due to it), but I guess here it happening at import time already is a problem. (Some people report such issue with NumPy as well, they usually have stranger environments like embedded Python setup.) |
On the branch from gh-17432, the
@PhilMiller Please checkout gh-17432 to make sure it resolves the issue on your system |
Describe your issue.
When running under
valgrind
, importingscipy.stats
fails, preventing use of valgrind to debug any subsequent errors in application code.The latest version of NumPy at the time of my report, 1.23.4, also exhibits this failure. I'm using 1.22.4 due to compatibility constraints with Numba
Reproducing Code Example
Error message
SciPy/NumPy/Python version information
The text was updated successfully, but these errors were encountered: