Skip to content
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

Crash when using AB09ND with bfsqrt, issue is incorrect dimension for iwork #245

Open
mccullerlp opened this issue Dec 29, 2024 · 2 comments

Comments

@mccullerlp
Copy link

I've had consistent crashing when trying to use the bfsqrt method with AB09ND. I switched on debug mode, -fcheck=all and such. I was able to track it down after also poking around using valgrind. For future reference, it is nice to run test suites that fail with memory checking and gdb to poke around inside the stack traces. This is much better than just what -fcheck=all does.

PYTHONMALLOC=malloc valgrind --vgdb-error=1 python3 -m pytest <args>

see https://developers.redhat.com/articles/2021/11/01/debug-memory-errors-valgrind-and-gdb#discover_uninitialized_values for more details.

Anyway, for the bug fix. In the wrapper for AB09ND,

    integer intent(hide,cache),dimension(MAX(m,p)) :: iwork

should become

    integer intent(hide,cache),dimension(MAX(1,2*n)),depend(n) :: iwork

which makes it consistent with the requirements in the slicot source file, and also appears to fix the issue.

@roryyorke
Copy link
Collaborator

Hi - thanks for that.

See gh-243 , linked from gh-242 that you filed last week. This has the same expression for iwork, but doesn't have depend(n). From https://numpy.org/doc/stable/f2py/signature-file.html#signature-files-syntax, f2py infers dependence, and depend() is used to override its inference.

Do you get crashes without depend(n) ?

@mccullerlp
Copy link
Author

I will check this soon. My work on this is really sporadic right now. Will clean up that pull request and have a couple more wrapped functions (SB08CD and SB08DD) hopefully within a month or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants