smarco / WFA2-lib

WFA-lib: Wavefront alignment algorithm library v2
Other
162 stars 36 forks source link

Fix uninitialized memory issues in valgrind #77

Closed ctsa closed 1 year ago

ctsa commented 1 year ago

This is one fix for the issue described in https://github.com/smarco/WFA2-lib/issues/76, where I further detail the problem.

smarco commented 1 year ago

Sorry for the delay. I have been a few days out.

I was not initializing the padding and, thus, the Valgrind error. Although the centinels in between the padding guarantee that the algorithm is correct, I agree that a clean Valgrind report is the way to go. Moreover, I got to reproduce the error on a CentOS7+gcc10.

Glad to merge the PR (thank you). Later, I will push another patch to restrict the initialization to the padding and avoid a potentially costly call to calloc(.).

Thank you so much,