Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vpa1977 opened this issue Jul 9, 2024 · 0 comments

Comments

@vpa1977
Copy link
Contributor

vpa1977 commented Jul 9, 2024

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)"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant