You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has been seen with a bug in KMC2. The problem is a "funnel shift" operation which shifts by the number of bits in a word. Conceptually, the code shifts the value out of the word entirely. However, the actual behavior is undefined for the language. An implementation may shift by the log2(wordsize) least significant bits of the shift-by value, which means no shift at all, and thus a value which should be shifted out under certain cases in the KMC2 code actually remains unshifted. This unshifted value is added to the return value in their API and corrupts the k-mer value. There is a workaround in io.hpp which can be uncommented..
The text was updated successfully, but these errors were encountered:
I am a co-author of KMC software and I just noticed the problem you reported here. to_long is not an official part of our API, yet I have fixed (I hope) the problem you reported in the last commit.
Thanks for using KMC.
If you find some other bugs/problems with KMC please create issue in KMC repository.
mbargull
pushed a commit
to mbargull/KMC
that referenced
this issue
Dec 16, 2017
This has been seen with a bug in KMC2. The problem is a "funnel shift" operation which shifts by the number of bits in a word. Conceptually, the code shifts the value out of the word entirely. However, the actual behavior is undefined for the language. An implementation may shift by the log2(wordsize) least significant bits of the shift-by value, which means no shift at all, and thus a value which should be shifted out under certain cases in the KMC2 code actually remains unshifted. This unshifted value is added to the return value in their API and corrupts the k-mer value. There is a workaround in io.hpp which can be uncommented..
The text was updated successfully, but these errors were encountered: