tree-sitter / tree-sitter-haskell

Haskell grammar for tree-sitter.
MIT License
152 stars 36 forks source link

Typing a quasiquote causes tree-sitter-haskell (and by extension, neovim) to segfault #45

Closed ocharles closed 3 years ago

ocharles commented 3 years ago

Steps to reproduce:

  1. Open nvim
  2. :e Hmm.hs
  3. Type: [i|. The final | will cause a segfault

GDB tells us:

#0  0x00007ffff7bb73e9 in malloc () from /nix/store/9bh3986bpragfjmr32gay8p95k91q4gy-glibc-2.33-47/lib/libc.so.6                                                             
#1  0x00007fffe8fef8d5 in operator new(unsigned long) () from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                         
#2  0x00007fffe8fe6a87 in std::_Function_base::_Base_manager<state::mark(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)::$_1>::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) () from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so               
#3  0x00007fffe8feb8c4 in std::function<void (State&)>::function(std::function<void (State&)> const&) ()                                                                     
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#4  0x00007fffe8fdfc71 in parser::effect(std::function<void (State&)>) () from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so        
#5  0x00007fffe8fe0956 in parser::mark(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) ()                                                   
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#6  0x00007fffe8fea49a in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()                                                  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#7  0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()                                                  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#8  0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()                                                  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#9  0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()                                                  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#10 0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()                                                  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#11 0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()                                                  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#12 0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()                                                  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#13 0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()                                                  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#14 0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()                                                  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#15 0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()                                                  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#16 0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()                                                  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#17 0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()               utf-8       haskell  All    1:3  
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so                                                                               
#18 0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so
#19 0x00007fffe8fea7a0 in std::_Function_handler<Result (State&), logic::$_42>::_M_invoke(std::_Any_data const&, State&) ()
   from /home/ollie/.local/share/nvim/site/pack/packer/start/nvim-treesitter/parser/haskell.so
tek commented 3 years ago

indeed :scream: never encountered this cause I always write qqs with a snippet :sweat_smile:

ocharles commented 3 years ago

Yea, this is what unfortunately happens when you get users! :sweat_smile:

tek commented 3 years ago

:joy:

tek commented 3 years ago

thanks for the report!

ocharles commented 3 years ago

All good now!