Skip to content

Buffer overflow in k-mer prefilter with highly conserved sequences #1092

Closed

Description

@mzueva

mmseqs easy-search fails at prefilter step with segfault when running an antibody query against a multi-million antibody database (e.g. 10M clonotype sequences). Any dataset where conserved k-mers match a large fraction of targets will trigger it.

Problem is caused by underestimation of output size when checking for buffer overflow in CacheFriendlyOperations::findDuplicates. The check uses std::min(elementCount, currBinSize/2), assuming at most half of bin entries are duplicates. This assumption breaks when query k-mers are shared across a large fraction of the target database — as it happens with antibody variable region sequences, where conserved framework k-mers match ~70% of targets on consistent diagonals.

Here is a suggested fix for the issue: #1091

Activity

  1. jackscanlan commented on Mar 30, 2026

    @jackscanlan

    This would be amazing to have fixed, I think I'm having a similar issue with a database that contains millions of DNA barcodes, which contain both variable and conserved regions.

  2. dleopold commented on Apr 10, 2026

    @dleopold

    I am having this same issue. Nucleotide database search of CO1 amplicons (~100k) against a reference database (~1 million) results in a segfault during prefiltering.

  3. dleopold commented on Apr 15, 2026

    @dleopold

    FYI - I compiled from source with the fix from @mzueva and was able to run my queries. Not sure if there are efficiency concerns from using the max upper bound on duplicates.

  4. martin-steinegger commented on Jun 21, 2026

    @martin-steinegger
    Member

    Thanks all — this looks resolved (fixed in a recent release or answered in the thread), so I'm closing it. If you're still running into this, please reopen with your MMseqs2 version, the exact command, and the full output and we'll take another look. Thanks for using MMseqs2!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions