psi-plus / main

Main repository with patches and required resources
https://psi-plus.com/
GNU Lesser General Public License v2.1
69 stars 20 forks source link

Crashes with an enchnat:Exception #777

Closed ghost closed 4 years ago

ghost commented 4 years ago

I have build the last snapshot using a Slackware's SBo SlackBuild

When entering text in a MUC window, crashes with:

[20200223 21:38:28] W:"Enchant error: " (unknown:0, unknown)
[20200223 21:38:29] unexpected version response (unknown:0, unknown)
terminate called after throwing an instance of 'enchant::Exception'
  what():  std::exception
Aborted

The version of Enchant is 1.6.1. (the last enchant 1 version)

Tried building it with Enchant2 (2.2.7), but the configure script seems not be able to find it.

Vitozz commented 4 years ago

Could you run psi in a debugger to show backtrace? And tell us the version of psi.

ghost commented 4 years ago

I catchpointed SIGABRT.

Thread 1 "psi" received signal SIGABRT, Aborted.
0x00007ffff5af1d6b in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x00007ffff5af1d6b in raise () at /lib64/libc.so.6
#1  0x00007ffff5ad2548 in abort () at /lib64/libc.so.6
#2  0x00007ffff5e97643 in  () at /usr/lib64/libstdc++.so.6
#3  0x00007ffff5ea3066 in  () at /usr/lib64/libstdc++.so.6
#4  0x00007ffff5ea30b1 in  () at /usr/lib64/libstdc++.so.6
#5  0x00007ffff5ea32e4 in  () at /usr/lib64/libstdc++.so.6
#6  0x00000000004f4050 in enchant::Dict::check(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (this=0x1b629c0, utf8word="ntc")
    at /usr/include/enchant/enchant++.h:85
#7  0x00000000004f2e55 in EnchantChecker::isCorrect(QString const&) (this=0x16a7630, word=...)
    at libpsi/tools/spellchecker/enchantchecker.cpp:64
#8  0x00000000004f2960 in SpellHighlighter::highlightBlock(QString const&)
    (this=0x162a5b0, text=...) at libpsi/tools/spellchecker/spellhighlighter.cpp:28
#9  0x00007ffff6c33231 in  () at /usr/lib64/libQt5Gui.so.5
#10 0x00007ffff6c333df in  () at /usr/lib64/libQt5Gui.so.5
#11 0x00007ffff646f77d in QMetaObject::activate(QObject*, int, int, void**) ()
    at /usr/lib64/libQt5Core.so.5
#12 0x00007ffff6e74c53 in QTextDocument::contentsChange(int, int, int) ()
    at /usr/lib64/libQt5Gui.so.5
--Type <RET> for more, q to quit, c to continue without paging--c
#13 0x00007ffff6bef599 in QTextDocumentPrivate::finishEdit() () at /usr/lib64/libQt5Gui.so.5
#14 0x00007ffff6bef6ad in QTextDocumentPrivate::insert(int, int, int, int) () at /usr/lib64/libQt5Gui.so.5
#15 0x00007ffff6c1ef22 in QTextCursor::insertText(QString const&, QTextCharFormat const&) () at /usr/lib64/libQt5Gui.so.5
#16 0x00007ffff6c1f088 in QTextCursor::insertText(QString const&) () at /usr/lib64/libQt5Gui.so.5
#17 0x00007ffff74372a8 in  () at /usr/lib64/libQt5Widgets.so.5
#18 0x00007ffff743bec7 in QWidgetTextControl::processEvent(QEvent*, QMatrix const&, QWidget*) () at /usr/lib64/libQt5Widgets.so.5
#19 0x00007ffff7432caa in QWidgetTextControl::processEvent(QEvent*, QPointF const&, QWidget*) () at /usr/lib64/libQt5Widgets.so.5
#20 0x00007ffff74179d3 in QTextEdit::keyPressEvent(QKeyEvent*) () at /usr/lib64/libQt5Widgets.so.5
#21 0x0000000000632056 in ChatEdit::keyPressEvent(QKeyEvent*) (this=0x198e510, e=0x7fffffffd6b0) at msgmle.cpp:309
#22 0x00007ffff729b9c2 in QWidget::event(QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#23 0x00007ffff7345fce in QFrame::event(QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#24 0x00007ffff7348a49 in QAbstractScrollArea::event(QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#25 0x00007ffff74173ad in QTextEdit::event(QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#26 0x0000000000631fa7 in ChatEdit::event(QEvent*) (this=0x198e510, event=0x7fffffffd6b0) at msgmle.cpp:276
#27 0x00007ffff725b5f2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#28 0x00007ffff7264dae in QApplication::notify(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#29 0x00007ffff6445be2 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#30 0x00007ffff72b9036 in  () at /usr/lib64/libQt5Widgets.so.5
#31 0x00007ffff725b5f2 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#32 0x00007ffff72646a0 in QApplication::notify(QObject*, QEvent*) () at /usr/lib64/libQt5Widgets.so.5
#33 0x00007ffff6445be2 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib64/libQt5Core.so.5
#34 0x00007ffff6ad1093 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () at /usr/lib64/libQt5Gui.so.5
#35 0x00007ffff6ad6188 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib64/libQt5Gui.so.5
#36 0x00007ffff6ab258b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Gui.so.5
#37 0x00007ffff190b2ba in  () at /usr/lib64/libQt5XcbQpa.so.5
#38 0x00007ffff59c9b3d in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0
#39 0x00007ffff59c9d90 in  () at /usr/lib64/libglib-2.0.so.0
#40 0x00007ffff59c9e1f in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0
#41 0x00007ffff6499301 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#42 0x00007ffff64448ab in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib64/libQt5Core.so.5
#43 0x00007ffff644c07e in QCoreApplication::exec() () at /usr/lib64/libQt5Core.so.5
#44 0x000000000094785c in main(int, char**) (argc=1, argv=0x7fffffffdbc8) at main.cpp:583
(gdb) 

Psi 1.4.1022 (2020-02-22, Psi:93f5c5bd, Psi+:2170e90) Qt 5.13.2 Compiled with Qt 5.13.2

Vitozz commented 4 years ago

As a fast solution try again enchant-2.2.7 with 1025 version of psi+. I've fixed library detection by cmake.

ghost commented 4 years ago

Is the version 1.4.1025 a strict requirement, or 1026 should also work?

Psi build script still picks up enchant1, not enchant2 for its build, although I have both installed in parallel.

Enchant2's package contents are:

FILE LIST:
./
install/
install/doinst.sh
install/slack-desc
usr/
usr/bin/
usr/bin/enchant-2
usr/bin/enchant-lsmod-2
usr/doc/
usr/doc/enchant2-2.2.7/
usr/doc/enchant2-2.2.7/AUTHORS
usr/doc/enchant2-2.2.7/COPYING.LIB
usr/doc/enchant2-2.2.7/ChangeLog
usr/doc/enchant2-2.2.7/HACKING
usr/doc/enchant2-2.2.7/NEWS
usr/doc/enchant2-2.2.7/README
usr/doc/enchant2-2.2.7/enchant2.SlackBuild
usr/include/
usr/include/enchant-2/
usr/include/enchant-2/enchant++.h
usr/include/enchant-2/enchant-provider.h
usr/include/enchant-2/enchant.h
usr/lib64/
usr/lib64/enchant-2/
usr/lib64/enchant-2/enchant_aspell.a
usr/lib64/enchant-2/enchant_aspell.la
usr/lib64/enchant-2/enchant_aspell.so
usr/lib64/enchant-2/enchant_hunspell.a
usr/lib64/enchant-2/enchant_hunspell.la
usr/lib64/enchant-2/enchant_hunspell.so
usr/lib64/libenchant-2.so.2.2.7
usr/lib64/pkgconfig/
usr/lib64/pkgconfig/enchant-2.pc
usr/man/
usr/man/man1/
usr/man/man1/enchant-2.1.gz
usr/man/man1/enchant-lsmod-2.1.gz

Do I need to tell ./configure something specific, like --with-enchant2?

Vitozz commented 4 years ago

Ah, you use a ./configure script ... Then versions 1025 or later will not help. For some reason I thought that you build psi+ using cmake

Vitozz commented 4 years ago

Try new version >=1027. With new fixes ./configure script should detect enchant-2 properly.

ghost commented 4 years ago

Well, that's just how it was used to be build in Slackware. I didn't know that cmake was the bless option. I'll try the new version.

ghost commented 4 years ago

At the moment, still crashes with

[20200227 8:50:29] W:"Enchant error: " (libpsi/tools/spellchecker/enchantchecker.cpp:120, EnchantChecker::setActiveLanguages)
[20200227 8:50:30] unexpected version response (unknown:0, unknown)
terminate called after throwing an instance of 'enchant::Exception'
  what():  std::exception

[1]+  Aborted                 psi

Although I feel that the script still didn't pick up the correct enchant.

UPD: Yes, as expected. If I remove the enchant-1 package, leaving only enchant-2, the ./configure doesn't pick it up.

I'll try to compile with cmake.

ghost commented 4 years ago

I seem to be doing something wrong with cmake:

My script is like:

mkdir  build && cd build
CFLAGS="$SLKCFLAGS" cmake  \
      -DCMAKE_INSTALL_PREFIX=/usr/ \
      -DPSI_LIBDIR=/usr/lib$LIBDIRSUFFIX/psi/ \
      -DPSI_DATADIR=/usr/share/psi/ \
      -DUSE_ENCHANT=ON \
      -DUSE_HUNSPELL=OFF \
      -DCHAT_TYPE=WEBKIT \
      -DCMAKE_BUILD_TYPE=Debug \
      -DUSE_KEYCHAIN=ON \
      -DINSTALL_EXTRA_FILES=ON \
      -DINSTALL_PLUGINS_SDK=ON \
      -DENABLE_PLUGINS=ON \
      -DBUILD_PLUGINS="-omemoplugin" \
      ..

QMAKE_CFLAGS="$SLKCFLAGS" \
QMAKE_CXXFLAGS="$SLKCFLAGS" \
make -j4
make install INSTALL_ROOT=$PKG

Fails to start with:

lockywolf@delllaptop:~/DevLinux/lwf-bugfixes-for-generalized-bugfixes-and-small-scripts/scripts$ psi-plus 
[20200227 11:10:26] W:QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-lockywolf' (unknown:0, unknown)
[20200227 11:10:26] using qt5ct plugin (unknown:0, unknown)
[20200227 11:10:27] D-Bus global menu: no (unknown:0, unknown)
[20200227 11:10:27] W:PsiIconset::Private::iconsetPath("roster/crystal-sms.jisp"): not found (/tmp/SBo/psi-plus-snapshots-1.4.1027/src/psiiconset.cpp:117, PsiIconset::Private::iconsetPath)
[20200227 11:10:27] W:PsiIconset::Private::iconsetPath("roster/crystal-icq.jisp"): not found (/tmp/SBo/psi-plus-snapshots-1.4.1027/src/psiiconset.cpp:117, PsiIconset::Private::iconsetPath)
[20200227 11:10:27] W:PsiIconset::Private::iconsetPath("roster/crystal-yahoo.jisp"): not found (/tmp/SBo/psi-plus-snapshots-1.4.1027/src/psiiconset.cpp:117, PsiIconset::Private::iconsetPath)
[20200227 11:10:27] W:PsiIconset::Private::iconsetPath("roster/crystal-service.jisp"): not found (/tmp/SBo/psi-plus-snapshots-1.4.1027/src/psiiconset.cpp:117, PsiIconset::Private::iconsetPath)
[20200227 11:10:27] W:PsiIconset::Private::iconsetPath("roster/crystal-gadu.jisp"): not found (/tmp/SBo/psi-plus-snapshots-1.4.1027/src/psiiconset.cpp:117, PsiIconset::Private::iconsetPath)
[20200227 11:10:27] W:Failed to read client_icons.txt. Clients detection won't work (/tmp/SBo/psi-plus-snapshots-1.4.1027/src/psiiconset.cpp:536, PsiIconset::loadClients)
[20200227 11:10:27] W:PsiThemeManager::Private::themePath("chatview/psi/classic"): not found (/tmp/SBo/psi-plus-snapshots-1.4.1027/src/psithemeprovider.cpp:46, PsiThemeProvider::themePath)
[20200227 11:10:27] Classic theme failed to load. No fallback.. (/tmp/SBo/psi-plus-snapshots-1.4.1027/src/chatviewthemeprovider.cpp:108, ChatViewThemeProvider::loadCurrent)
[20200227 11:10:31] D-Bus system tray: no (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  794 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  794 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  794 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  794 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  794 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
[20200227 11:10:31] Unknown signature value:  795 (unknown:0, unknown)
ghost commented 4 years ago
#       -DPSI_LIBDIR=/usr/lib$LIBDIRSUFFIX/psi/ \
#       -DBUILD_PSIMEDIA=ON \
#      -DPSI_DATADIR=/usr/share/psi/ \

Don't seem to work.

Otherwise, psi doesn't crash any more with spellchecking, thank you. This issue can be closed.

Vitozz commented 4 years ago

BUILD_PSIMEDIA works only if psimedia sources are present at the source code directory. You need to copy psimedia manually. Also there could be a possible trouble with setting extra / to the prefix path. It can lead to path like this /usr//share/psi-plus and could be errors on installation.

ghost commented 4 years ago

Let's say "fixed".