olivierkes / manuskript

A open-source tool for writers
http://www.theologeek.ch/manuskript
GNU General Public License v3.0
1.71k stars 226 forks source link

Crashing when I'm trying to create the 1st project #1035

Closed IvanDobysh closed 2 years ago

IvanDobysh commented 2 years ago

OS: Arch Linux x86_64 Host: MS-7C90 1.0 Kernel: 5.17.5-zen1-1-zen Shell: bash 5.1.16 Resolution: 3440x1440 DE: Plasma 5.24.4 WM: kwin WM Theme: Breeze Theme: Nordic [Plasma], Breeze [GTK2/3] Icons: [Plasma], Papirus-Dark [GTK2/3] Terminal: konsole CPU: AMD Ryzen 5 3600 (12) @ 3.600GHz GPU: AMD ATI Radeon RX 470/480/570/570X/580/ Memory: 6750MiB / 32087MiB

Hello! I'm trying to use Manuskript on my Arch machine on KDE + Wayland. I've tried to install the community package and the git package as well, but the crash is still here.

I'm starting the Manuskript, it offers me to create and save a new document and when I'm trying to save it at any place at my PC - Manuskript is crashing.

Here's the console output:

$ manuskript

** (process:233263): WARNING **: 13:25:44.284: Error loading plugin: libhspell.so.0: cannot open shared object file: No such file or directory

** (process:233263): WARNING **: 13:25:44.285: Error loading plugin: libnuspell.so.5: cannot open shared object file: No such file or directory

** (process:233263): WARNING **: 13:25:44.285: Error loading plugin: libvoikko.so.1: cannot open shared object file: No such file or directory

CRITICAL> An unhandled exception has occurred!
Traceback (most recent call last):
  File "/usr/share/manuskript/manuskript/logging.py", line 221, in qtMessageHandler
    log_level = [logging.DEBUG,
IndexError: list index out of range
double free or corruption (out)
Fatal Python error: Aborted

Current thread 0x00007fba5637d740 (most recent call first):
  File "/usr/share/manuskript/manuskript/ui/welcome.py", line 196 in createFile
  File "/usr/share/manuskript/manuskript/main.py", line 243 in launch
  File "/usr/share/manuskript/manuskript/main.py", line 309 in run
  File "/usr/bin/manuskript", line 30 in <module>

Extension modules: PyQt5.QtCore, PyQt5.QtGui, PyQt5.QtWidgets, PyQt5.QtNetwork, PyQt5.QtQml, PyQt5.QtDBus, PyQt5.QtDesigner, PyQt5.QtHelp, PyQt5.QtMultimedia, PyQt5.QtMultimediaWidgets, PyQt5.QtOpenGL, PyQt5.QtPositioning, PyQt5.QtLocation, PyQt5.QtPrintSupport, PyQt5.QtQuick, PyQt5.QtQuickWidgets, PyQt5.QtSensors, PyQt5.QtSql, PyQt5.QtSvg, PyQt5.QtTest, PyQt5.QtTextToSpeech, PyQt5.QtWebChannel, PyQt5.QtWebKit, PyQt5.QtWebKitWidgets, PyQt5.QtWebSockets, PyQt5.QtX11Extras, PyQt5.QtXml, PyQt5.QtXmlPatterns, lxml._elementpath, lxml.etree (total: 30)
Aborted (core dumped)

Thank you in advance, have a nice day!

TheJackiMonster commented 2 years ago

It seems like Qt is throwing a message to our logging handler of an unknown type. I assume we should catch such instances and treat it as unknown or some other kind of logging level instead. So we would at least see what's causing this.

Do you know a bit of Python? If so you could try catching the issue by putting an if branch before assigning the log_level in function qtMessageHandler (line 221 of "/usr/share/manuskript/manuskript/logging.py").

It should work like this for example:

def qtMessageHandler(msg_type, msg_log_context, msg_string):
    """Forwards Qt messages to Python logging system."""
    # Convert Qt msg type to logging level
    if (int(msg_type) >= 0) and (int(msg_type) < 4):
        log_level = [logging.DEBUG, logging.WARNING, logging.ERROR, logging.FATAL] [ int(msg_type) ]
    else:
        log_level = logging.ERROR

I will probably apply a similar patch upstream as well because we do an unsafe conversion there with the msg_type, I assume. But if you can apply it to the code on your system, you could already get the more interesting part in what's causing the issue. ^^

Otherwise you have to wait until the patch makes it to you (I don't know which package you use currently).

TheJackiMonster commented 2 years ago

I've commited (https://github.com/olivierkes/manuskript/commit/e45314ba2d3c58287255c44cf9fd1db7bf697c49) a proper way, I think. The log level for INFO was also missing. So you could try to check what you are getting with running manuskript from head of the repository.

IvanDobysh commented 2 years ago

Yay, now it's starting, thank you! The only error in console now is: CRITICAL> The recently-used.xbel is not an XBEL file, overwriting.

TheJackiMonster commented 2 years ago

Okay but I guess that would be a system dependent issue. Good, I will close this then.