Skip to content

Conversation

@jmarshall
Copy link
Contributor

@tillea's issue #108 appears to be caused by there being no sufficiently good pairs when calculating avg and std, leading to avg=NAN std=NAN and a later malloc failure when asked to malloc an insane amount of memory.

This suggested patch returns from bsw2_stat() with r.failed = 1 in this case, as in other cases of insufficient read pairs. I am not familiar enough with the implications of “failure to infer insert size distribution” to judge whether this is the best approach.

Just as we set r.failed and return early if there are no high-quality
read pairs at all, also do so if there are none within the calculated
boundaries.  This avoids returning avg=NAN std=NAN, which leads to
malloc(INFINITY) and a crash; fixes lh3#108.
@lh3 lh3 merged commit 87ed015 into lh3:master Jul 30, 2017
@jmarshall jmarshall deleted the bwasw-nan branch July 31, 2017 08:25
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 this pull request may close these issues.

2 participants