+
Skip to content

Fix for this error: "Failed to allocate 0 bytes at bntseq.c line 303" #54

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

Closed
wants to merge 1 commit into from
Closed

Conversation

khervold-twist
Copy link

when m_pac is < 4, we attempt to allocate 0 bytes and fail, so instead we allocate a 1 byte minimum.

this fixes this error:

[bwa_index] Pack FASTA... [bns_fasta2bntseq] Failed to allocate 0 bytes at bntseq.c line 303: Success

@Osiris1975
Copy link

I have encountered this error using bwa version 0.7.15.

@toddknutson
Copy link

I got this error with version 0.7.15 when I tried to run bwa index ref.fa with an empty fasta file (that is, my ref.fa file contained no actual fasta sequences). Providing a file with data, bwa worked. This is a silly error on my part, but it might help someone realize their file is empty.

@drchriscole
Copy link

Also as info, even when the fasta file has data, but no defline beginning with a ">" character, will give this error.

jmarshall added a commit to jmarshall/bwa that referenced this pull request Jun 28, 2017
Similarly to the realloc(pac,...) within add1(), only bother to call
realloc() if appending the reverse complemented sequence requires more
space than is currently in the pac/m_pac buffer.

Avoids realloc(pac,0) (and a "Failed to allocate 0 bytes at bntseq.c"
message from wrap_realloc()) in the corner case of an empty reference
FASTA file.  Fixes lh3#54.
@lh3 lh3 closed this in #139 Jul 30, 2017
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.

4 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载