Skip to content

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

@mccullerlp

Description

@mccullerlp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions