kitone / subtitleeditor

Subtitle Editor is a GTK+3 tool to create or edit subtitles for GNU/Linux/*BSD.
http://kitone.github.io/subtitleeditor/
GNU General Public License v3.0
103 stars 16 forks source link

SIGSEGV on spell checking problems #8

Open helllamer opened 6 years ago

helllamer commented 6 years ago

I'm trying to make a ~helloworld srt with non-english words. But i'm receiving segfault every time i'm typing any russian/cyrillic letter into text column. English letters are ok.

Backtrace

...
Reading symbols from subtitleeditor...done.
(gdb) run
Starting program: /usr/bin/subtitleeditor 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe7395700 (LWP 15924)]
[New Thread 0x7fffe6b94700 (LWP 15925)]
[New Thread 0x7fffcf1d2700 (LWP 15928)]
[New Thread 0x7fffce9d1700 (LWP 15929)]
[Thread 0x7fffce9d1700 (LWP 15929) exited]

Thread 1 "subtitleeditor" received signal SIGSEGV, Segmentation fault.
0x00007fffcd512bd6 in hspell_check_word () from /usr/lib/libhspell.so.0
(gdb) bt
#0  0x00007fffcd512bd6 in hspell_check_word () at /usr/lib/libhspell.so.0
#1  0x00007fffcd71ac86 in  () at /usr/lib/enchant/enchant_hspell.so
#2  0x00007ffff6f45377 in SEEnchantDict::check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (utf8="sadв", this=0x5555561e1600) at spellchecker.cc:101
#3  0x00007ffff6f45377 in SpellChecker::check(Glib::ustring const&) (this=<optimized out>, word=...) at spellchecker.cc:294
#4  0x00007ffff6f7b77b in AutomaticSpellChecker::check_word(Gtk::TextIter, Gtk::TextIter) (this=this@entry=0x555556194180, start=..., end=...) at gui/automaticspellchecker.cc:247
#5  0x00007ffff6f7bdfc in AutomaticSpellChecker::check_range(Gtk::TextIter, Gtk::TextIter, bool) (this=this@entry=0x555556194180, start=..., end=..., force_all=force_all@entry=false) at gui/automaticspellchecker.cc:339
#6  0x00007ffff6f7c0b1 in AutomaticSpellChecker::on_insert_text_after(Gtk::TextIter const&, Glib::ustring const&, int) (this=0x555556194180, pos=...) at gui/automaticspellchecker.cc:165
#7  0x00007ffff6ac1658 in  () at /usr/lib/libgtkmm-3.0.so.1
#8  0x00007ffff4d736f5 in g_closure_invoke () at /usr/lib/libgobject-2.0.so.0
#9  0x00007ffff4d86eff in  () at /usr/lib/libgobject-2.0.so.0
#10 0x00007ffff4d8b696 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#11 0x00007ffff4d8c920 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#12 0x00007ffff5a4cd7a in gtk_text_buffer_insert_interactive () at /usr/lib/libgtk-3.so.0
#13 0x00007ffff5a4ce45 in gtk_text_buffer_insert_interactive_at_cursor () at /usr/lib/libgtk-3.so.0
#14 0x00007ffff5a7923f in  () at /usr/lib/libgtk-3.so.0
#15 0x00007ffff4d726f5 in g_cclosure_marshal_VOID__STRINGv () at /usr/lib/libgobject-2.0.so.0
#16 0x00007ffff4d8bc01 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#17 0x00007ffff4d8c62c in g_signal_emit_by_name () at /usr/lib/libgobject-2.0.so.0
#18 0x00007ffff4d726f5 in g_cclosure_marshal_VOID__STRINGv () at /usr/lib/libgobject-2.0.so.0
#19 0x00007ffff4d8bc01 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#20 0x00007ffff4d8c62c in g_signal_emit_by_name () at /usr/lib/libgobject-2.0.so.0
#21 0x00007ffff595cf00 in  () at /usr/lib/libgtk-3.so.0
#22 0x00007ffff595dedb in  () at /usr/lib/libgtk-3.so.0
#23 0x00007ffff595fff4 in  () at /usr/lib/libgtk-3.so.0
#24 0x00007ffff5a7a3ca in  () at /usr/lib/libgtk-3.so.0
#25 0x00007ffff6ae6068 in Gtk::Widget::on_key_press_event(_GdkEventKey*) () at /usr/lib/libgtkmm-3.0.so.1
#26 0x00007ffff6ae8357 in Gtk::Widget_Class::key_press_event_callback(_GtkWidget*, _GdkEventKey*) () at /usr/lib/libgtkmm-3.0.so.1
#27 0x00007ffff5981488 in  () at /usr/lib/libgtk-3.so.0
#28 0x00007ffff4d8b2c2 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#29 0x00007ffff4d8c920 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#30 0x00007ffff5ad49e5 in  () at /usr/lib/libgtk-3.so.0
#31 0x00007ffff5af6214 in gtk_window_propagate_key_event () at /usr/lib/libgtk-3.so.0
#32 0x00007ffff5af9e5c in  () at /usr/lib/libgtk-3.so.0
#33 0x00007ffff6ae6068 in Gtk::Widget::on_key_press_event(_GdkEventKey*) () at /usr/lib/libgtkmm-3.0.so.1
#34 0x00007ffff6ae8357 in Gtk::Widget_Class::key_press_event_callback(_GtkWidget*, _GdkEventKey*) () at /usr/lib/libgtkmm-3.0.so.1
#35 0x00007ffff5981488 in  () at /usr/lib/libgtk-3.so.0
#36 0x00007ffff4d8bc01 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#37 0x00007ffff4d8c920 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#38 0x00007ffff5ad49e5 in  () at /usr/lib/libgtk-3.so.0
#39 0x00007ffff597e2c2 in  () at /usr/lib/libgtk-3.so.0
#40 0x00007ffff5980443 in gtk_main_do_event () at /usr/lib/libgtk-3.so.0
#41 0x00007ffff54889f6 in  () at /usr/lib/libgdk-3.so.0
#42 0x00007ffff54bb375 in  () at /usr/lib/libgdk-3.so.0
#43 0x00007ffff4aa3270 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#44 0x00007ffff4aa4f69 in  () at /usr/lib/libglib-2.0.so.0
#45 0x00007ffff4aa5f42 in g_main_loop_run () at /usr/lib/libglib-2.0.so.0
#46 0x00007ffff597f50f in gtk_main () at /usr/lib/libgtk-3.so.0
#47 0x00007ffff6a801a2 in Gtk::Main::run(Gtk::Window&) () at /usr/lib/libgtkmm-3.0.so.1
#48 0x000055555557a239 in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at main.cc:107

Look at line entry 2:

#2  0x00007ffff6f45377 in SEEnchantDict::check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (utf8="sadв", this=0x5555561e1600) at spellchecker.cc:101

I've successfully typed "sad", and then switched language to russian, and typed russian letter "в". And it crashes. Don't know why. I don't have any issues with spellchecking in other programs. Also, i don't have any programs, that depends on enchant or hspell.

Versions:

Steps to reproduce:

  1. Run subtitleeditor
  2. File -> Create
  3. Press insert
  4. Double click in "text" column
  5. Type russian letters.
helllamer commented 6 years ago

strace output:

$ staсe subtitleeditor
...
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=5, events=POLLIN}], 3, 382) = 1 ([{fd=3, revents=POLLIN}])
recvmsg(3, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="#\203\203\n\26\0\0\0\2\0\3\0s\240\204\0&\0\0\0\236\4\0\0\4\0\300\4\0\0\0\0"..., iov_len=4096}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 120
recvmsg(3, {msg_namelen=0}, 0)          = -1 EAGAIN (Resource temporarily unavailable)
stat("/home/user/.config/enchant/he.exc", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
stat("/home/user/.config/enchant/he.dic", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
+++ killed by SIGSEGV (core dumped) +++

Directory /home/user/.config/enchant/ contains two newly-created empty files:

$ ls -l 
-rw-r--r-- 1 user user 0 дек  7 10:45 he.dic
-rw-r--r-- 1 user user 0 дек  7 10:45 he.exc