Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

linalg: fix typo in least-squares complex space allocation #830

Merged
merged 4 commits into from
May 28, 2024

Conversation

perazz
Copy link
Member

@perazz perazz commented May 27, 2024

Fix #823: typo setting complex storage space in the lstsq solver.

Thank you @jalvesz @loiseaujc for reporting. cc: @jvdp1 @fortran-lang/stdlib

@jalvesz
Copy link
Contributor

jalvesz commented May 28, 2024

I tested it with a WSL, it still segfaults with the change you proposed.

@perazz
Copy link
Member Author

perazz commented May 28, 2024

I believe I've found the issue (passing real space nrs instead of complex space ncs for the complex case). I apologize as for some reason this error was never triggered in my macOS development environment (no bounds checking due to (*) in LAPACK + macOS overprovisions allocations, I guess?)

@perazz perazz marked this pull request as ready for review May 28, 2024 05:34
@jalvesz
Copy link
Contributor

jalvesz commented May 28, 2024

Yes, that solved the segfault!!

@perazz
Copy link
Member Author

perazz commented May 28, 2024

Awesome! Thank you @loiseaujc and @jalvesz for reporting.

Copy link
Member

@awvwgk awvwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing

Copy link
Member

@jvdp1 jvdp1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you

@perazz
Copy link
Member Author

perazz commented May 28, 2024

Thank you for the two approvals, merging now.

@perazz perazz merged commit dc707f8 into fortran-lang:master May 28, 2024
17 checks passed
@perazz perazz deleted the fix_lstsq branch May 28, 2024 12:06
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in the complex least-squares solver
4 participants