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

LAGraph: Re-run failing tests with more verbose output and continue. #459

Merged
merged 1 commit into from
Oct 23, 2023

Conversation

mmuetzel
Copy link
Contributor

Re-run failing tests with --rerun-failed --output-on-failure to get more verbose output that might help in tracking down the issue on 32-bit platforms.

Also continue even if ctest fails to make it behave more similar to the other projects.

@DrTimothyAldenDavis DrTimothyAldenDavis merged commit dbfd570 into DrTimothyAldenDavis:dev2 Oct 23, 2023
15 of 17 checks passed
@DrTimothyAldenDavis
Copy link
Owner

I see the bug. LAGraph_Malloc has a test that tries to avoid calling malloc when the request is too large:

size_t size ;
bool ok = LG_Multiply_size_t (&size, nitems, size_of_item) ;
if (!ok || nitems > GrB_INDEX_MAX || size_of_item > GrB_INDEX_MAX)
{
// overflow
return (GrB_OUT_OF_MEMORY) ;
}

but GrB_INDEX_MAX is always 2^60 on all platforms. On a 32-bit platform, size_t is 4 bytes, however, and the test_Malloc script does this on line 39-40, which is supposed to trigger that test and return p = NULL.

LAGraph_Malloc ((void **) &p, GrB_INDEX_MAX + 1, sizeof (char), msg) ;
TEST_CHECK (p == NULL) ;

That input parameter, GrB_INDEX_MAX+1, gets typecasted from uint64_t to size_t, which truncates it, probably to the value 1. So the call to LAGraph_Malloc succeeds, when it is supposed to fail.

I will need to look through all of LAGraph to make sure there's no other broken typecasting like this with size_t.

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

Successfully merging this pull request may close these issues.

2 participants