kvirc / KVIrc

The KVIrc IRC Client
http://www.kvirc.net/
GNU General Public License v2.0
240 stars 75 forks source link

Crash in KVIRC #2645

Closed Mort-03 closed 3 months ago

Mort-03 commented 4 months ago

Hi, KVIrc closes unexpectedly, after some time of inactivity, it happens to me when I try to write something, when I press any key on the keyboard, it closes.

It is the same thing that happens to this other user: https://github.com/kvirc/KVIrc/issues/2596

KVIrc version 5.2.4 Manjaro Linux OS

the “where” command of “coredumpctl gdb kvirc” gives me the following:

0 g_log_structured_array (log_level=log_level@entry=G_LOG_LEVEL_ERROR, fields=fields@entry=0x7ffdd5dc9fd0, n_fields=4) at ../glib/glib/gmessages.c:426

1 0x00007fc824719dd7 in g_log_default_handler

(log_domain=log_domain@entry=0x7fc8245c4015 "GLib-GObject", log_level=log_level@entry=6, message=message@entry=0x56030e430be0 "cannot create new instance of invalid (non-instantiatable) type '<invalid>'", unused_data=unused_data@entry=0x0) at ../glib/glib/gmessages.c:3357

2 0x00007fc82471a05c in g_logv

(log_domain=0x7fc8245c4015 "GLib-GObject", log_level=G_LOG_LEVEL_ERROR, format=<optimized out>, args=args@entry=0x7ffdd5dca120)
at ../glib/glib/gmessages.c:1246

3 0x00007fc82471a3d4 in g_log

(log_domain=log_domain@entry=0x7fc8245c4015 "GLib-GObject", log_level=log_level@entry=G_LOG_LEVEL_ERROR, format=format@entry=0x7fc8245cd018 "cannot create new instance of invalid (non-instantiatable) type '%s'") at ../glib/glib/gmessages.c:1315

4 0x00007fc8245bf09b in g_type_create_instance (type=0x0) at ../glib/gobject/gtype.c:1881

5 0x00007fc8080082da in enchant_provider_construct (object_type=) at /usr/src/debug/enchant/enchant-2.7.3/lib/provider.vala:85

6 0x00007fc808008388 in enchant_provider_new () at /usr/src/debug/enchant/enchant-2.7.3/lib/provider.vala:85

7 0x00007fc80806260e in init_enchant_provider () at /usr/src/debug/enchant/enchant-2.7.3/providers/enchant_aspell.c:198

8 0x00007fc808008853 in enchant_broker_load_providers_in_dir (self=0x56030e056b00, dir_name=0x56030e4b31d0 "/usr/lib/enchant-2")

at /usr/src/debug/enchant/enchant-2.7.3/lib/broker.vala:148

9 enchant_broker_load_providers (self=0x56030e056b00) at /usr/src/debug/enchant/enchant-2.7.3/lib/broker.vala:121

10 enchant_broker_init () at /usr/src/debug/enchant/enchant-2.7.3/lib/broker.vala:87

11 0x00007fc80806a889 in ??? () at /usr/lib/kvirc/5.2/modules/libkvispellchecker.so

12 0x000056030a985fff in KviModuleManager::loadModule(QString const&) ()

13 0x000056030a986b8b in KviModuleManager::getModule(QString const&) ()

14 0x000056030aa27054 in KviKvsTreeNodeModuleFunctionCall::evaluateReadOnly(KviKvsRunTimeContext, KviKvsVariant) ()

15 0x000056030aa1e99b in KviKvsTreeNodeDataList::evaluate(KviKvsRunTimeContext, KviKvsVariantList) ()

16 0x000056030aa3084a in KviKvsTreeNodeParameterReturn::execute(KviKvsRunTimeContext*) ()

17 0x000056030a9d89cd in KviKvsScript::executeInternal(KviKvsRunTimeContext*) ()

18 0x000056030a9d8b04 in KviKvsScript::execute(KviWindow, KviKvsVariantList, KviKvsVariant, int, KviKvsExtendedRunTimeData) ()

19 0x000056030a9d8f40 in KviKvsScript::evaluate(QString const&, KviWindow, KviKvsVariantList, KviKvsVariant*) ()

20 0x000056030a8c95df in KviInputEditor::checkWordSpelling(QString const&) ()

21 0x000056030a8cbd06 in KviInputEditor::splitTextIntoSpellCheckerBlocks(QString const&, std::vector<KviInputEditorSpellCheckerBlock, std::allocator >&) ()

22 0x000056030a8cc77c in KviInputEditor::rebuildTextBlocks() ()

23 0x000056030a8cd5b5 in KviInputEditor::xPositionFromCharIndex(int) ()

24 0x000056030a8cd63c in KviInputEditor::ensureCursorVisible() ()

25 0x000056030a8cd776 in KviInputEditor::moveCursorTo(int, bool) ()

26 0x000056030a8d35eb in KviInputEditor::insertText(QString const&) ()

27 0x000056030a8d51c9 in KviInputEditor::keyPressEvent(QKeyEvent*) ()

28 0x00007fc82658f5f0 in QWidget::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5

29 0x00007fc826556331 in QApplicationPrivate::notify_helper(QObject, QEvent) () at /usr/lib/libQt5Widgets.so.5

30 0x00007fc82655b898 in QApplication::notify(QObject, QEvent) () at /usr/lib/libQt5Widgets.so.5

31 0x00007fc8258ab968 in QCoreApplication::notifyInternal2(QObject, QEvent) () at /usr/lib/libQt5Core.so.5

32 0x00007fc8265aacfb in ??? () at /usr/lib/libQt5Widgets.so.5

33 0x00007fc826556331 in QApplicationPrivate::notify_helper(QObject, QEvent) () at /usr/lib/libQt5Widgets.so.5

--Type for more, q to quit, c to continue without paging--c

34 0x00007fc8258ab968 in QCoreApplication::notifyInternal2(QObject, QEvent) () at /usr/lib/libQt5Core.so.5

35 0x00007fc825d37e16 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () at /usr/lib/libQt5Gui.so.5

36 0x00007fc825d1cddd in QWindowSystemInterface::sendWindowSystemEvents(QFlags) () at /usr/lib/libQt5Gui.so.5

37 0x00007fc8217302f8 in ??? () at /usr/lib/libQt5XcbQpa.so.5

38 0x00007fc824714a89 in g_main_dispatch (context=0x7fc81c000ed0) at ../glib/glib/gmain.c:3344

39 0x00007fc8247769b7 in g_main_context_dispatch_unlocked (context=0x7fc81c000ed0) at ../glib/glib/gmain.c:4152

40 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7fc81c000ed0, block=block@entry=1, dispatch=dispatch@entry=1, self=)

at ../glib/glib/gmain.c:4217

41 0x00007fc824713f95 in g_main_context_iteration (context=0x7fc81c000ed0, may_block=1) at ../glib/glib/gmain.c:4282

42 0x00007fc8258fa27f in QEventDispatcherGlib::processEvents(QFlags) () at /usr/lib/libQt5Core.so.5

43 0x00007fc8258a372c in QEventLoop::exec(QFlags) () at /usr/lib/libQt5Core.so.5

44 0x00007fc8258afafd in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5

45 0x000056030a8791f2 in main ()

ctrlaltca commented 4 months ago

The crash is coming from the spellchecker functionality. You wrote something so KVIrc loaded the spellchecker module; the module called the initialization routine of libenchant, that failed to load the aspell provider. I've raised a bug at libenchant: https://github.com/AbiWord/enchant/issues/385 , hopefully they'll be able to give us hints on why this is happening.

ctrlaltca commented 4 months ago

So, even the enchant guys are not sure how this can happen. They are suspecting some installation problem, eg. mixed modules from different enchant versions. Can you please confirm that KVIrc behaves normally at startup, and that the spellchecker works? I suspect that the spellchecker module gets unloaded after some idle time; writing something is causing it to be reloaded this it is causing the crash.

Mort-03 commented 3 months ago

It is curious the failure, because when I start it I can use it without any problem. The failure originates “I could not specify the exact time” but after being without writing anything for about five minutes, it is then when I try to write something again, it closes. Another curious thing, which I will try to confirm tonight, is that it lets me write numbers without failure, but not letters.

ctrlaltca commented 3 months ago

@Mort-03 If you want to make another test, can you please try to disable the "Automatically unload unused modules" option in Settings Menu -> Configure KVIrc -> General Options -> Scripting Engine? The spellchecker is a module, it gets loaded the first time it's needed and unloaded after some time. Since you are experiencing a crash when the spellchecker module is reloaded after some time, this could workaround the issue (and give us some hints on how to fix it)

Mort-03 commented 3 months ago

I've been using it for about 12 hours without closing it and since I deactivated ‘Scripting Engine’ it hasn't crashed again.

ctrlaltca commented 3 months ago

A workaround has been added in #2649 that should avoid the need of disabling that option.