vgteam / vg

tools for working with genome variation graphs
https://biostars.org/tag/vg/
Other
1.08k stars 191 forks source link

VG Augment fails to run (Signal 6) #4210

Open greggedman opened 5 months ago

greggedman commented 5 months ago

1. What were you trying to do? I generated a small pangenome graph (n = 3) following the Minigraph-Cactus approach, and wanted to augment it with short-read data from a different species.

2. What did you want to happen? I wanted to create an augmented .vg file from my GAM alignments from giraffe.

3. What actually happened? When using the whole GAM file (~500Gb), I encountered a segmentation fault, suggesting I didn't have enough resources to run the job. I then isolated just the first aln from the GAM file (see below), and while this did not produce a seg fault, it did cause VG to crash (report attached)

vg view -a total_aln.gam | head -1 | vg view -JaG - > first_aln.gam
vg augment genome.vg first_aln.gam -p -v -t 60 -Q 30 > genome.aug.vg

4. If you got a line like Stack trace path: /somewhere/on/your/computer/stacktrace.txt, please copy-paste the contents of that file here:

Crash report for vg v1.53.0-11-g3566725b7 "Valmontone"
Stack trace (most recent call last) in thread 9844:
#12   Object "", at 0xffffffffffffffff, in 
#11   Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7f27fa32684f, in 
#10   Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7f27fa294ac2, in 
#9    Object "/usr/lib/x86_64-linux-gnu/libgomp.so.1.0.0", at 0x7f27fa9b1c0d, in 
#8    Object "/home/ggedman/programs/vg/bin/vg", at 0x564028895523, in void vg::io::for_each_parallel_impl<vg::Alignment>(std::istream&, std::function<void (vg::Alignment&, vg::Alignment&)> const&, std::function<void (vg::Alignment&)> const&, std::function<bool ()> const&, unsigned long) [clone ._omp_fn.0]
    | Source "/home/ggedman/programs/vg/include/vg/io/stream.hpp", line 276, in operator()
    |   274:                 if (i == batch->size()-1) { // odd last object
    |   275:                     handle(ProtobufIterator<T>::parse_from_string(obj1, batch->at(i)));
    | > 276:                     lambda1(obj1);
    |   277:                 }
    |   278:             }
      Source "/usr/include/c++/11/bits/std_function.h", line 590, in _ZN2vg2io22for_each_parallel_implINS_9AlignmentEEEvRSiRKSt8functionIFvRT_S6_EERKS4_IFvS6_EERKS4_IFbvEEm._omp_fn.0 [0x564028895523]
        587:       {
        588:    if (_M_empty())
        589:      __throw_bad_function_call();
      > 590:    return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
        591:       }
        592: 
        593: #if __cpp_rtti
#7    Object "/home/ggedman/programs/vg/bin/vg", at 0x564028a8ac9b, in vg::augment_impl(handlegraph::MutablePathMutableHandleGraph*, std::function<void (std::function<void (vg::Alignment&)>, bool, bool)>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<vg::Translation, std::allocator<vg::Translation> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool, bool, bool, bool, double, double, vg::Packer*, unsigned long, double, bool)::{lambda(vg::Alignment&)#1}::operator()(vg::Alignment&) const
      Source "src/augment.cpp", line 233, in operator() [0x564028a8ac9b]
#6    Object "/home/ggedman/programs/vg/bin/vg", at 0x564028a8a969, in vg::find_packed_breakpoints(vg::Path const&, vg::Packer&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, double, double)
      Source "src/augment.cpp", line 534, in find_packed_breakpoints [0x564028a8a969]
#5    Object "/home/ggedman/programs/vg/bin/vg", at 0x564028a83c76, in vg::forwardize_breakpoints(handlegraph::HandleGraph const*, std::unordered_map<long long, std::set<std::tuple<long long, bool, unsigned long>, std::less<std::tuple<long long, bool, unsigned long> >, std::allocator<std::tuple<long long, bool, unsigned long> > >, std::hash<long long>, std::equal_to<long long>, std::allocator<std::pair<long long const, std::set<std::tuple<long long, bool, unsigned long>, std::less<std::tuple<long long, bool, unsigned long> >, std::allocator<std::tuple<long long, bool, unsigned long> > > > > > const&)
      Source "src/augment.cpp", line 514, in forwardize_breakpoints [0x564028a83c76]
#4    Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7f27fa239e95, in __assert_fail
#3    Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7f27fa22871a, in 
#2    Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7f27fa2287f2, in abort
#1    Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7f27fa242475, in raise
#0    Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7f27fa2969fc, in pthread_kill
ERROR: Signal 6 occurred. VG has crashed. Visit https://github.com/vgteam/vg/issues/new/choose to report a bug.
Please include this entire error log in your bug report!

5. What data and command can the vg dev team use to make the problem happen? While these data are currently not publicly available, the following commands were used to generate the error.

vg giraffe -Z genome.d2.gbz -d genome.d2.dist -m genome.d2.min -t 48 -p -f trim.R1.fastq.gz -f ftrim.R2.fastq.gz -N aug_species > total_aln.gam
vg augment genome.vg first_aln.gam -p -v -t 60 -Q 30 > genome.aug.vg ##results in seg fault
vg view -a total_aln.gam | head -1 | vg view -JaG - > first_aln.gam
vg augment genome.vg first_aln.gam -p -v -t 60 -Q 30 > genome.aug.vg ##results in signal 6 error

6. What does running vg version say?

vg version v1.53.0-11-g3566725b7 "Valmontone"
Compiled with g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 on Linux
Linked against libstd++ 20230528