Mentions légales du service

Skip to content
Snippets Groups Projects

Check return value of mallocs in check_zmatrices() and prevent overflows

Merged Philippe SWARTVAGHER requested to merge pswartva/chameleon:fix-check-testing into master
All threads resolved!

In the same vein of !330 (merged), an overflow in the mallocs in the function to check the result of computations was leading to a negative value and malloc returning NULL.

This MR adds a check of returned values by mallocs (not sure if returning CHAMELEON_ERR_OUT_OF_RESOURCES is the best solution in case of error) and use longs instead of ints for variables used to compute the memory malloc has to allocate.

I found this bug with the following command:

./testing/chameleon_stesting -o lacpy --n 3200:60000:6400 -H -c --nowarmup

The execution is very long for the matrix size 48000 and actually ends with a segfault (in the BLAS library!) when performing the check.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 5 commits

    • 6a680006...903ad11c - 4 commits from branch solverstack:master
    • 9a3b84d9 - Check return value of mallocs in check_zmatrices() and prevent overflows

    Compare with previous version

  • Mathieu Faverge resolved all threads

    resolved all threads

  • Mathieu Faverge approved this merge request

    approved this merge request

  • Mathieu Faverge mentioned in commit ccc74c05

    mentioned in commit ccc74c05

  • Please register or sign in to reply
    Loading