Skip to content

infinite loop in const std::string FilterTool::FilterToolPrivate::GetScriptContents() on s390x, arm, ppc64el #237

@vpa1977

Description

@vpa1977

const std::string FilterTool::FilterToolPrivate::GetScriptContents() loops indefinitely due to fgets() not setting eof flag if the call returns data on those platforms.

The fgetc/ungetc calls then set/clear eof flag indefinitely.

This can be reproduced with bamtools filter -script filter_script -in ./tests/data/sam_spec_example.bam -out out.bam

filter_script

{
  "filters" : 
    [
      { "id" : "inAnyErrorReadGroup",
        "tag" : "RG:ERR*"
      },
      { "id" : "highMapQuality",
        "mapQuality" : ">=75"
      },
      { "id" : "bothMatesMapped",
        "isMapped" : "true",
        "isMateMapped" : "true"
      }
    ],
  "rule" : "!inAnyErrorReadGroup & (highMapQuality | bothMatesMapped)"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions