-
Notifications
You must be signed in to change notification settings - Fork 27
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
Error while running tests (ldlt_app.cpp) #140
Comments
I can confirm this. The problem is that A simple fix would be to use the Should we do that for the few cases flagged by |
Thank you @bharswami for reporting and @mjacobse for confirming. I'd be tempted for now to just fix the cases flagged up by @mjacobse would you be happy to make a PR that fixes the |
In several places, the std::vector subscript operator[] is used together with the addressof operator to obtain a pointer into the vector. In some cases, this is intended to yield a pointer past the end of the vector. In such cases, the pointer is not actually used to read from or write to. Thus it causes no actual problems in practice and even address sanitizer and valgrind are happy with it. However, operator[] is still called with an out of bounds index, which is undefined behaviour. This is correctly detected by Microsofts standard library debug checks and also by GNU's library once compiling with -D_GLIBCXX_DEBUG. As a fix, we use .data() and pointer arithmetic to get to the intended pointer without any out of bound access. Fixes ralna#140
In several places, the std::vector subscript operator[] is used together with the addressof operator to obtain a pointer into the vector. In some cases, this is intended to yield a pointer past the end of the vector. In such cases, the pointer is not actually used to read from or write to. Thus it causes no actual problems in practice and even address sanitizer and valgrind are happy with it. However, operator[] is still called with an out of bounds index, which is undefined behaviour. This is correctly detected by Microsofts standard library debug checks and also by GNU's library once compiling with -D_GLIBCXX_DEBUG. As a fix, we use .data() and pointer arithmetic to get to the intended pointer without any out of bound access. Fixes #140
Fixed in #145 |
I am getting the following index error
Unhandled exception at 0x00007FFBB78B829C (ucrtbased.dll) in spraltestfull.exe: An invalid parameter was passed to a function that considers invalid parameters fatal.
#if _CONTAINER_DEBUG_LEVEL > 0
_STL_VERIFY(
_Pos < static_cast<size_type>(_My_data._Mylast - _My_data._Myfirst), "vector subscript out of range");
#endif // _CONTAINER_DEBUG_LEVEL > 0
The higher level functions are (in order, last call first)
get_nrow(nblk - 1, m, block_size), get_ncol(jblk, n, block_size),
get_ncol(nblk - 1, n, block_size), cdata[jblk],
&failed_rect[jfail * (m - n) + (nblk - 1) * block_size - n], m - n,
&a[jblk * block_size * lda + (nblk - 1) * block_size], lda
);
<T, INNER_BLOCK_SIZE, CopyBackup, use_tasks, debug>
::factor(
m, n, perm, l, lda, d, backup, options, options.pivot_method,
outer_block_size, 0.0, nullptr, 0, work
);
ldlt_test<double, 2, false, false>(0.01, 1e-20, true, false, false, 4, 2)
));
temp = run_ldlt_app_tests();
Please clarify.
The text was updated successfully, but these errors were encountered: