-
Notifications
You must be signed in to change notification settings - Fork 444
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
Fix out-of-bounds in xORBDB2 and xORBDB3 #551
Fix out-of-bounds in xORBDB2 and xORBDB3 #551
Conversation
The strategy was:
SLARFGP( 1, ALPHA, OUTOFBOUNDS_V, LDV, TAU ) by TAU = 1 - SIGN( 1, ALPHA )
ALPHA = ABS( ALPHA )
|
Codecov Report
@@ Coverage Diff @@
## master #551 +/- ##
==========================================
- Coverage 82.37% 82.36% -0.01%
==========================================
Files 1894 1894
Lines 190677 190729 +52
==========================================
+ Hits 157063 157099 +36
- Misses 33614 33630 +16
Continue to review full report at Codecov.
|
Not related to this specific PR. But this reminds me that there is a bug in xLARFGP that I think we never managed to fix, and we initially inserted xLARFGP everywhere, and then removed it. It worries me that some routines in LAPACK are using xLARFGP. I do not know what to do about it since I do not know whether the code relies on the |
The computed beta values are used as
There are no out-of-bounds accesses. Given an array
Add to that:
|
I see... If one wants to fix all of them, we would need to rewrite a number of algorithms with no real improvement in practice. I couldn't think of a good way to continue using * I updated the description of this PR. |
Valgrind and address sanitizers work well for me. They also avoid issue #339 when calling LAPACK code from C with the function prototypes in Valgrind can be used with any executable: |
Just found in Lines 177 to 182 in 2dafa3d
|
9b9443b
to
9cd55e4
Compare
Thanks, @christoph-conrads! That was easy to implement. I followed your suggestions and created a new commit. I am now applying the fixes to xORBDB1, and then I will look at the complex cases. |
Done! I hope I didn't miss anything. |
This was not a suggestion, I just responded to your request for ideas, and I think this is a bad idea. These changes trade readability for PS: I gave up on |
I will drop this PR. I don't think this is a good idea anymore. I agree with the sentence:
I think it would be good to have a routine in the CI to run the tests under Valgrind. Thanks @christoph-conrads! |
Fix #549.
Description
In #549, we verified xORBDB2 and xORBDB3 use subarrays of size 0 starting at
X(N+1)
, where N is the size of X. These arrays are passed as arguments to other subroutines that never reference the arrays. Therefore, this is a false positive case of out-of-bounds. The code provokes no errors in practice, but some compilers (like gfortran) identify and return anout-of-bounds error
. This PR tries to rewrite the code while keeping the check of bounds. [edited]Checklist