vgteam / vg

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

vg construct crash #4109

Open yihangs opened 10 months ago

yihangs commented 10 months ago

1. What were you trying to do?

I am trying to reproduce the steps described in https://github.com/cgroza/personalized_genomes_gbio/issues/1, however, after I built the vcf file, and use vg construct -S -f -r hg38.fa -v file.vcf > graph.vg, an error occurs:

warning:[vg::Constructor] Lowercase characters found in chr1; coercing to uppercase.
warning:[vg::Constructor] Lowercase characters found in chr10; coercing to uppercase.
terminate called after throwing an instance of 'std::runtime_error'
  what():  io::MessageEmitter::write: message too large
━━━━━━━━━━━━━━━━━━━━
Crash report for vg v1.49.0-9-ge61a8a475 "Peschici"
Stack trace (most recent call last):
#19   Object "", at 0xffffffffffffffff, in 
#18   Object "/opt/local/stow/vg-1.49.0/bin/vg", at 0x561cf50f18f9, in _start
#17   Object "/lib/x86_64-linux-gnu/libc-2.27.so", at 0x7f2ed752db96, in __libc_start_main
      Source "../csu/libc-start.c", line 310, in __libc_start_main [0x7f2ed752db96]
#16   Object "/opt/local/stow/vg-1.49.0/bin/vg", at 0x561cf50c5bea, in main
      Source "src/main.cpp", line 88, in main [0x561cf50c5bea]
#15   Object "/opt/local/stow/vg-1.49.0/bin/vg", at 0x561cf5835c97, in vg::subcommand::Subcommand::operator()(int, char**) const
    | Source "src/subcommand/subcommand.cpp", line 75, in operator()
      Source "/usr/include/c++/9/bits/std_function.h", line 688, in operator() [0x561cf5835c97]
        685:     {
        686:       if (_M_empty())
        687:    __throw_bad_function_call();
      > 688:       return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
        689:     }
        690: 
        691: #if __cpp_rtti
#14   Object "/opt/local/stow/vg-1.49.0/bin/vg", at 0x561cf5878438, in main_construct(int, char**)
      Source "src/subcommand/construct_main.cpp", line 321, in main_construct [0x561cf5878438]
#13   Object "/opt/local/stow/vg-1.49.0/bin/vg", at 0x561cf595d281, in vg::Constructor::construct_graph(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::function<void (vg::Graph&)> const&)
      Source "src/constructor.cpp", line 2680, in construct_graph [0x561cf595d281]
#12   Object "/opt/local/stow/vg-1.49.0/bin/vg", at 0x561cf595c566, in vg::Constructor::construct_graph(std::vector<FastaReference*, std::allocator<FastaReference*> > const&, std::vector<vcflib::VariantCallFile*, std::allocator<vcflib::VariantCallFile*> > const&, std::vector<FastaReference*, std::allocator<FastaReference*> > const&, std::function<void (vg::Graph&)> const&)
      Source "src/constructor.cpp", line 2579, in construct_graph [0x561cf595c566]
#11   Object "/opt/local/stow/vg-1.49.0/bin/vg", at 0x561cf595b06a, in vg::Constructor::construct_graph(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, FastaReference&, vg::VcfBuffer&, std::vector<FastaReference*, std::allocator<FastaReference*> > const&, std::function<void (vg::Graph&)> const&)
      Source "src/constructor.cpp", line 2372, in construct_graph [0x561cf595b06a]
#10   Object "/opt/local/stow/vg-1.49.0/bin/vg", at 0x561cf5958a7a, in vg::Constructor::construct_graph(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, FastaReference&, vg::VcfBuffer&, std::vector<FastaReference*, std::allocator<FastaReference*> > const&, std::function<void (vg::Graph&)> const&)::{lambda(vg::ConstructedChunk&)#2}::operator()(vg::ConstructedChunk&) const
    | Source "src/constructor.cpp", line 2165, in operator()
      Source "/usr/include/c++/9/bits/std_function.h", line 688, in operator() [0x561cf5958a7a]
        685:     {
        686:       if (_M_empty())
        687:    __throw_bad_function_call();
      > 688:       return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
        689:     }
        690: 
        691: #if __cpp_rtti
#9    Object "/opt/local/stow/vg-1.49.0/bin/vg", at 0x561cf58791c6, in std::_Function_handler<void (vg::Graph&), main_construct(int, char**)::{lambda(vg::Graph&)#1}>::_M_invoke(std::_Any_data const&, vg::Graph&)
    | Source "/usr/include/c++/9/bits/std_function.h", line 300, in operator()
    |   298:       _M_invoke(const _Any_data& __functor, _ArgTypes&&... __args)
    |   299:       {
    | > 300:    (*_Base::_M_get_pointer(__functor))(
    |   301:        std::forward<_ArgTypes>(__args)...);
    |   302:       }
      Source "src/subcommand/construct_main.cpp", line 317, in _M_invoke [0x561cf58791c6]
#8    Object "/opt/local/stow/vg-1.49.0/bin/vg", at 0x561cf53ff48d, in vg::io::ProtobufEmitter<vg::Graph>::write_copy(vg::Graph const&)
    | Source "/mnt/disk04/gus/Downloads/vg/include/vg/io/protobuf_emitter.hpp", line 219, in ~basic_string
    |   217: auto ProtobufEmitter<T>::write_copy(const T& item) -> void {
    |   218:     // Encode it to a string
    | > 219:     string encoded;
    |   220:     handle(item.SerializeToString(&encoded));
    | Source "/usr/include/c++/9/bits/basic_string.h", line 662, in ~_Alloc_hider
    |   660:        */
    |   661:       ~basic_string()
    | > 662:       { _M_dispose(); }
    |   663: 
    |   664:       /**
    | Source "/usr/include/c++/9/bits/basic_string.h", line 154, in ~allocator
    |   153:       // Use empty-base optimization: http://www.cantrip.org/emptyopt.html
    | > 154:       struct _Alloc_hider : allocator_type // TODO check __is_final
    |   155:       {
    |   156: #if __cplusplus < 201103L
    | Source "/usr/include/c++/9/bits/allocator.h", line 152, in ~new_allocator
    |   150:    allocator(const allocator<_Tp1>&) _GLIBCXX_NOTHROW { }
    |   151: 
    | > 152:       ~allocator() _GLIBCXX_NOTHROW { }
    |   153: 
    |   154:       friend bool
      Source "/usr/include/c++/9/ext/new_allocator.h", line 89, in write_copy [0x561cf53ff48d]
         86:    _GLIBCXX20_CONSTEXPR
         87:    new_allocator(const new_allocator<_Tp1>&) _GLIBCXX_USE_NOEXCEPT { }
         88: 
      >  89:       ~new_allocator() _GLIBCXX_USE_NOEXCEPT { }
         90: 
         91:       pointer
         92:       address(reference __x) const _GLIBCXX_NOEXCEPT
#7    Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7f2ed790e135, in _Unwind_Resume
#6    Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7f2ed790d773, in 
#5    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29", at 0x7f2ed7dffc95, in __gxx_personality_v0
#4    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29", at 0x7f2ed7dff528, in 
#3    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29", at 0x7f2ed7e00505, in 
#2    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.29", at 0x7f2ed7df50a8, in 
#1    Object "/lib/x86_64-linux-gnu/libc-2.27.so", at 0x7f2ed754c800, in abort
      Source "/build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c", line 79, in abort [0x7f2ed754c800]
#0    Object "/lib/x86_64-linux-gnu/libc-2.27.so", at 0x7f2ed754ae97, in raise
      Source "../sysdeps/unix/sysv/linux/raise.c", line 51, in raise [0x7f2ed754ae97]
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!
━━━━━━━━━━━━━━━━━━━━

6. What does running vg version say?

vg version v1.49.0-9-ge61a8a475 "Peschici"
Compiled with g++-9 (Ubuntu 9.4.0-1ubuntu1~18.04) 9.4.0 on Linux
Linked against libstd++ 20210601

Thanks!

Ahahaha3 commented 9 months ago

Have you solved the problem?

yihangs commented 9 months ago

Part of. I used vg autoindex as suggested in https://github.com/human-pangenomics/hpp_pangenome_resources/issues/22. I got the error but autoindex captured this error, did the pruning step, and indexed the graph again. I think in my case it did the pruning twice and then finally finished the index.

Ahahaha3 commented 9 months ago

Thanks a lot for your reply!