-
Notifications
You must be signed in to change notification settings - Fork 36
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
incomplete error handling #19
Comments
This is a good suggestion. The Looking over the htslib code, it looks like -1 is returned by I can make the adjustment and check in. I think I still have a pending PR on Freebayes from November, so can add to that. I can re-ping Erik and see if he wants to incorporate. |
I think you're right that -1 is EOF and other negative values are errors. That would be great to get this into SeqLib and then freebayes. We're using it in places where network failures can remove drive access and we need to know this happened. |
Hi Brent, I fixed this in the latest SeqLib commit. I didn't update my FreeBayes PR, since there are already a number of adjustments and it was getting to be too much in one pass. If you want, you can just update the SeqLib sub-repos to the latest SeqLib commit in your freebayes directory, and rebuild to have this issue fixed. After my latest freebayes PR goes through, I can issue another one to update the official freebayes version. Testing after force-ejecting a volume, confirms an exit code of 134 with the updated SeqLib [E::bgzf_read] bgzf_read_block error -1 after 0 of 4 bytes
status -2
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: sam_read1 return status: -2 file: /Volumes/jwala/tmptmp.bam
Abort trap: 6
wmbb0-9c3:freebayes jwala$ echo $?
134 |
sweet! thanks for the quick fix. |
Is the pending change to freebayes this one: freebayes/freebayes#338 If so, once that PR is up-to-date, we should ping that issue as this is fairly critical. |
hi, I'm using SeqLib via freebayes. I just unmounted the file system holding the bams that freebayes was accessing. but the program still had a 0 exit status.
I see this message:
[E::bgzf_read] bgzf_read_block error -1 after 1115 of 1202 bytes
which is correctly propagated by htslib (AFAICT).
My C++ is rusty/non-existent, but it looks like
_Bam::load_read(BamRecord& r)
in SeqLib is just using a non-zero return from sam_read1 as an indicator to end iteration without actually propagating the error.So it appears that the iterator just stops after getting the -1 return value from sam_read1 and can never error. Am I mistaken?
Here is the code in question:
SeqLib/src/BamReader.cpp
Lines 305 to 355 in 770cd10
The text was updated successfully, but these errors were encountered: