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

Silent error when running extractHAIRS #7

Open
nh13 opened this issue Oct 5, 2016 · 3 comments
Open

Silent error when running extractHAIRS #7

nh13 opened this issue Oct 5, 2016 · 3 comments

Comments

@nh13
Copy link
Contributor

nh13 commented Oct 5, 2016

I am encountering a silent error in extractHAIRS. I run extractHAIRS and see that it stops output fragments part way through the input file. The exit code returned by extractHAIRS is 0!

I ran it through gdb and found the following:

#0  0x00007fff9c2d4002 in __pthread_kill () from /usr/lib/system/libsystem_kernel.dylib
#1  0x00007fff969c15c5 in pthread_kill () from /usr/lib/system/libsystem_pthread.dylib
#2  0x00007fff965446e7 in abort () from /usr/lib/system/libsystem_c.dylib
#3  0x00007fff9ab17e66 in szone_error () from /usr/lib/system/libsystem_malloc.dylib
#4  0x00007fff9ab0e0f9 in small_malloc_from_free_list () from /usr/lib/system/libsystem_malloc.dylib
#5  0x00007fff9ab0ab74 in szone_malloc_should_clear () from /usr/lib/system/libsystem_malloc.dylib
#6  0x00007fff9ab0a5b1 in malloc_zone_malloc () from /usr/lib/system/libsystem_malloc.dylib
#7  0x00007fff9ab090dc in malloc () from /usr/lib/system/libsystem_malloc.dylib
#8  0x00007fff9159b224 in _objc_opt_rw_data () from /usr/lib/libz.1.dylib
#9  0x00007fff5fbfe520 in ?? ()
#10 0x00000000fffffff1 in ?? ()
#11 0x00007fff5fbfe4f0 in ?? ()
#12 0x00007fff91596f05 in _objc_opt_rw_data () from /usr/lib/libz.1.dylib
#13 0x00000001c3d02c00 in ?? ()
#14 0x00000001c3d12c12 in ?? ()
#15 0x0000000102d5b4a0 in ?? ()
#16 0x0000000000000b02 in ?? ()
#17 0x00007fff5fbfe5e0 in ?? ()
#18 0x000000010000d4b8 in inflate_block (fp=0x7fff7c4a1000, block_length=<optimized out>) at bgzf.c:300
#19 bgzf_read_block (fp=0x7fff7c4a1000) at bgzf.c:534
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

I updated both the samtools and htslib submodules to master and re-ran extractHAIRS and got:

reading sorted bamfile ../../path/to/BAM
[E::bgzf_read] bgzf_read_block error -1 after 27499 of 107505 bytes

The reads in the SAM file are very long so my suspicion would be with the underlying htslib/samtools code, but I would be happy to share my test case privately.

@nh13
Copy link
Contributor Author

nh13 commented Oct 5, 2016

I wrote a little tool in samtools to read the input BAM and it completed successfully. My guess is there is a memory leak or something is overwriting memory in extractHairs.

@nh13
Copy link
Contributor Author

nh13 commented Oct 5, 2016

It looks like if I increase this from 1000 to 10000 in extracthairs.c like in fosmidbam_hairs.c the problem goes away.

Ideally, the # of alleles per-read shouldn't be fixed, but instead be increased (use realloc) when more space is needed. @pjedge could you take a shot at this?

@nh13
Copy link
Contributor Author

nh13 commented Oct 5, 2016

@vibansal I am not sure if this is a problem on HapCut(1) but I thought I'd make you aware.

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

No branches or pull requests

1 participant