manuskript icon indicating copy to clipboard operation
manuskript copied to clipboard

Crashes in editor

Open tyhawk opened this issue 6 years ago • 15 comments

While in the editor, even when not editing text (basically doing nothing), Manuskript crashes.

Debug: Web rendering engine used: QWebView
Running manuskript version 0.8.0.
Note: No translator found or loaded for locale en_US.
Icon theme "NumixMsk" not found.
Loading: /home/overlord/Boeken/VictoriaJones/de_Ontvoering_van_Victoria_Jansen.msk
Detected file format version: 1. Zip: False.
Project /home/overlord/Boeken/VictoriaJones/de_Ontvoering_van_Victoria_Jansen.msk loaded.
qt.qpa.xcb: QXcbConnection: XCB error: 5 (BadAtom), sequence: 666, resource id: 0, major code: 19 (DeleteProperty), minor code: 0
Fatal Python error: Segmentation fault

Current thread 0x00007f06c5642600 (most recent call first):
  File "/opt/manuskript/bin/../manuskript/main.py", line 89 in launch
  File "/opt/manuskript/bin/../manuskript/main.py", line 102 in run
  File "/bin/manuskript", line 13 in <module>
Segmentation fault (core dumped)

Running Manuskript version 0.8.0 on Manjaro linux, with most recent packages installed. Software Versions in Use: Python 3.7.1 PyQt 5.11.3 Qt 5.11.2

If you require any additional information to troubleshoot this issue, or if you would like me to run any tests, feel free to let me know.

tyhawk avatar Dec 27 '18 20:12 tyhawk

I had the same Issue in Fedora 29. I noticed, however, that the sample project (book-of-acts) did not crash, so I messed around and got a created project to not crash. Here's what I did:

  • Created a project titled 'new-project.msk' saved at '~/Documents/manuskript-projects/'
  • Extracted 'new-project.msk' into the same folder, which made a file called 'new-project'
  • Replaced the 'settings.txt' file that was created in 'new-project' with the 'settings.txt' file found in '/manuskript-0.8.0/sample-project/book-of-acts/' (it was the only file that varied widely from the one created in 'new-project')
  • Copied the 'book-of-acts.msk' file from '/manuskript-0.8.0/sample-project/' into '/Documents/manuskript-projects/' and renamed it 'new-project.msk'

This is obviously not a solution, but hopefully someone who knows more than I do can use it to find the real issue.

Obsurdity avatar Dec 30 '18 09:12 Obsurdity

@tyhawk and @Obsurdity how did you install Manuskript?

In a new Fedora 29 x86-64 Virtual Machine I installed Manuskript with:

sudo su -c "dnf install manuskript-0.8.0-1.noarch.rpm"

To create a new project I ran manuskript from the command line so that I could capture the console output. I chose to create a new project using the Novel template and the project created and saved properly.

Following is the log output from running manuskript:

[fedora@localhost ~]$ manuskript
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Debug: Web rendering engine used: QWebView
Running manuskript version 0.8.0.
Note: No translator found or loaded for locale en_CA.
Project test-manuskript.msk saved.
Project test-manuskript.msk saved.
[fedora@localhost ~]$

Software Versions in Use: Python 3.7.0 PyQt 5.11.2 Qt 5.11.1

EDIT: Note that I did not observe the following line that @tyhawk experienced.

Icon theme "NumixMsk" not found.

This suggests that something is wrong with the manuskript installation.

gedakc avatar Jan 01 '19 19:01 gedakc

I'm running Manjaro, which is Arch based, and Manuskript is in de AUR (Arch User Repository). The "install script" is the PKGBUILD file (https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=manuskript-git).

The project that keeps crashing is a new project, started with version 0.8.0 using the empty template. I am saving the project as multiple (uncompressed) files because I put everything in a private Gitlab repo and I don't want my material to be held hostage by a single piece of software, saving everything in some obscure file format. One of the reasons I love Manuskript is because it allows me to do just that.

I doubt the missing icon theme is the reason for the crash as it only happens on the editor tab.

I haven't had time to troubleshoot further, so I haven't checked my already existing projects yet nor the workaround proposed by @Obsurdity

tyhawk avatar Jan 02 '19 12:01 tyhawk

To investigate further you might consider Running Manuskript from Source Code on Linux to see if the segmentation fault still occurs.

If the problem persists then you might run the GNU Debugger to capture a stack trace of the crash.

To do this, change into the source code directory for Manuskipt and run the make debug command. When the GNU Debugger starts with prompt (gdb) type run and then try to reproduce the crash. The debugging output should hopefully point to where the segmentation fault occurs.

gedakc avatar Jan 02 '19 20:01 gedakc

@Obsurdity I tried your workaround by copying the settings.txt file from the example project, but the crash still occurs. The workaround doesn't seem to work for me. I did change a few settings though, so I will try to figure out if that causes the issue today.

tyhawk avatar Feb 08 '19 10:02 tyhawk

@gedakc, I installed using the same method as you from the Manuskript website. I still haven't had any more issues, and can create new projects without issue.

Obsurdity avatar Feb 08 '19 14:02 Obsurdity

Thank you for your responses.

@Obsurdity thank you for reporting back that Manuskript is working well for you now that you Run Manuskript from Source Code on Linux.

I'm beginning to suspect a problem with the ArchLinux AUR Package. The reason is because the problem disappeared after @Obsurdity chose to Run from Source Code. Additionally another user of the AUR package also experiences problems and has reported the same console log message Icon theme "NumixMsk" not found. See issue #472. The missing icon them is a symptom of at least one issue with the ArchLinux AUR package.

@tyhawk would you be able to try to Run Manuskript from Source Code on Linux?

If this fixes the problem then perhaps one of you could report the issue to the ArchLinux AUR Package maintainers.

gedakc avatar Feb 09 '19 20:02 gedakc

I'm trying to determine what entry in the settings file causes the crash, if only to be able to point the package maintainer to a possible solution. I'm also contemplating the possibility that this could be a bug that may hit other platforms in the future if not resolved, as Arch-based systems use very new packages. I know the issue doesn't seem to occur on OpenSUSE, but is that Leap 15 only or Tumbleweed (which is on par with Arch) as well? I haven't had time to test this on a fresh Tumbleweed install (yet).

tyhawk avatar Feb 13 '19 15:02 tyhawk

The ArchLinux AUR Package is old (0.7.0.r0.g97e4679-1). The most recent Manuskript release is 0.8.0 and the develop branch in git includes many more improvements.

I suggest running from source code with the develop branch. If you can reproduce the error then create a new Manuskript issue here, describe the steps you take to recreate the crash, and include the console log (the text from the terminal window when you invoke manuskript until the time of the crash).

gedakc avatar Feb 14 '19 17:02 gedakc

@gedakc It installs from the current git master branch, so installing it with the PKGBUILD will install version 0.8.0. That's also the version I am running currently.

tyhawk avatar Feb 15 '19 12:02 tyhawk

Thank you for the info about the ArchLinux AUR Package pulling from the current git master branch.

If this is the case then it appears that there is still something different between Running from Source code with the git master branch, and running from the ArchLinux AUR Package. Specifically the ArchLinux AUR Package console log shows "Icon theme "NumixMsk" not found" on start up, and this indicates at least one thing is different, and we don't know how many other things are different.

Note that I have been unable to reproduce the issue on Kubuntu, Fedora, or Windows. That is why I ask you to try Running from Source Code.

gedakc avatar Feb 15 '19 17:02 gedakc

I have a problem with an identical description though I don't know if it's the same issue. I am on Fedora 29 with GNOME. I believe the problem does not appear if you use the default (for me) theme - I was using Adwaita-Dark, and here is the backtrace from gdb (running make debug on develop branch)

#0  0x00007fffea0a0dc4 in QWidget::mapFromParent(QPoint const&) const () at /lib64/libQt5Widgets.so.5
#1  0x00007fffea0a0e2b in QWidget::mapFrom(QWidget const*, QPoint const&) const () at /lib64/libQt5Widgets.so.5
#2  0x00007fffdd9c83f0 in Adwaita::Style::eventFilterScrollArea(QWidget*, QEvent*) ()
    at /usr/lib64/qt5/plugins/styles/adwaita.so
#3  0x00007fffdd9c9133 in Adwaita::Style::eventFilter(QObject*, QEvent*) ()
    at /usr/lib64/qt5/plugins/styles/adwaita.so
#4  0x00007fffe6850d0e in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) ()
    at /lib64/libQt5Core.so.5
#5  0x00007fffea07a275 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#6  0x00007fffea081be8 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#7  0x00007fffe0f1c23e in  () at /usr/lib64/python3.7/site-packages/PyQt5/QtWidgets.so
#8  0x00007fffe6850ec6 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#9  0x00007fffea080edd in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () at /lib64/libQt5Widgets.so.5
#10 0x00007fffea0d4118 in  () at /lib64/libQt5Widgets.so.5
#11 0x00007fffea0d6cbe in  () at /lib64/libQt5Widgets.so.5
#12 0x00007fffea07a285 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#13 0x00007fffea0819a0 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#14 0x00007fffe0f1c23e in  () at /usr/lib64/python3.7/site-packages/PyQt5/QtWidgets.so
#15 0x00007fffe6850ec6 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#16 0x00007fffe6d9d4d3 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)
    () at /lib64/libQt5Gui.so.5
#17 0x00007fffe6d9f5d5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /lib64/libQt5Gui.so.5
#18 0x00007fffe6d7a70b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)
    () at /lib64/libQt5Gui.so.5
#19 0x00007fffe0a0685f in  () at /lib64/libQt5XcbQpa.so.5
#20 0x00007fffe684fe0b in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#21 0x00007fffe6857ed6 in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#22 0x00007fffe0f1ac7f in  () at /usr/lib64/python3.7/site-packages/PyQt5/QtWidgets.so
#23 0x00007ffff7d64bd7 in _PyMethodDef_RawFastCallKeywords () at /lib64/libpython3.7m.so.1.0
#24 0x00007ffff7d64e70 in _PyCFunction_FastCallKeywords () at /lib64/libpython3.7m.so.1.0
#25 0x00007ffff7ddaa60 in _PyEval_EvalFrameDefault () at /lib64/libpython3.7m.so.1.0
[further cpython lines removed]

It also occurs with Adwaita, and Breeze themes (the backtrace is similar but the frames with Adwaita stuff above are a single frame in breeze.so). I don't think this will be a theme bug since it occurs in two different theme engines.

This bug doesn't just happen when I'm doing nothing though - it happens due to focus events of some kind. Basically I can trigger it by opening a piece of text in the editor (with an affected theme selected) and waving the mouse around (within the window and out of the window - I have focus follows mouse - and also to the window titlebar.)

I hope this helps track things down. It's a bit annoying though because I use a dark GNOME them and cannot get Qt themes to follow it without explicitly selecting a similar dark one. I have a qt5ct-style which IIRC is supposed to use the GTK style, but it crashes the application when I select it.

fish-face avatar Mar 15 '19 02:03 fish-face

Sorry for the late respons, but between real life stuff and switching from Manjaro to OpenSUSE, I've not had time to further test this issue. On Manjaro, I came to the conclusion that the likely suspect were these settings in the settings.txt:

+        "marginsLR": 5,
+        "marginsTB": 5,

Whenever I changed these from 0 (default?) to anything else, Manuskript crashed within a few minutes.

On OpenSUSE, I've not encountered the issue yet, even though I use the same source files. I can only assume the issue is caused by something in the code combined with the Manjaro packages that Manuskript requires to run.

On a side note, I created an RPM for Manuskript, which is available through OBS. Feel free to link to it on your site if you like: https://build.opensuse.org/repositories/home:tyrannishawk. It hosts builds for Tumbleweed, Leap 15.0, Leap 15.1 and ARM.

tyhawk avatar Apr 23 '19 21:04 tyhawk

Sounds like it is related to Qt which handles the margins and most visual properties.

TheJackiMonster avatar Feb 22 '21 15:02 TheJackiMonster

so, today I have same issue, On Manjaro, but package was from repository (community or extra as I remember). I searched here more about it and reproduce problem with make debug, logs were interesting in one place...

Starting program: /usr/bin/python3 bin/manuskript
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[Detaching after vfork from child process 12095]
[New Thread 0x7fffeb044640 (LWP 12096)]
[New Thread 0x7fffe8dfd640 (LWP 12097)]
[New Thread 0x7fffdbaf4640 (LWP 12098)]
[New Thread 0x7fffdb2f3640 (LWP 12099)]
[New Thread 0x7fffdaaf2640 (LWP 12100)]
[New Thread 0x7fffda2f1640 (LWP 12101)]
[New Thread 0x7fffd9af0640 (LWP 12102)]
[New Thread 0x7fffd92ef640 (LWP 12103)]
[New Thread 0x7fffd8aee640 (LWP 12104)]
[New Thread 0x7fffbbfff640 (LWP 12105)]
[New Thread 0x7fffbb7fe640 (LWP 12106)]
[New Thread 0x7fffbaffd640 (LWP 12107)]
[New Thread 0x7fffba7fc640 (LWP 12108)]
[New Thread 0x7fffb9ffb640 (LWP 12109)]
[New Thread 0x7fffb97fa640 (LWP 12110)]
[Detaching after vfork from child process 12111]
[New Thread 0x7fff85fca640 (LWP 12112)]
[New Thread 0x7fff857c9640 (LWP 12113)]
[New Thread 0x7fff84fc8640 (LWP 12114)]
[New Thread 0x7fff7ffff640 (LWP 12115)]
[New Thread 0x7fff7f7fe640 (LWP 12116)]
[New Thread 0x7fff7effd640 (LWP 12117)]
[New Thread 0x7fff7e7fc640 (LWP 12118)]
[New Thread 0x7fff7dffb640 (LWP 12119)]
[New Thread 0x7fff7d7fa640 (LWP 12120)]
WARNING> There are some items with overlapping IDs: ['2', '2'] # not a problem, another manuskript works good with this warning

# opened editor tab:
Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
0x00007ffff252f754 in QWidget::mapFromParent(QPoint const&) const () from /usr/lib/libQt5Widgets.so.5 # this is interesting, probably this is where the bug is, but I'm not so good in debugging
(gdb) continue
Continuing.
Fatal Python error: Segmentation fault

Current thread 0x00007ffff7899740 (most recent call first):
  File "/home/sergey/manuskript/bin/../manuskript/main.py", line 243 in launch
  File "/home/sergey/manuskript/bin/../manuskript/main.py", line 309 in run
  File "/home/sergey/manuskript/bin/manuskript", line 13 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, [Thread 0x7fff7f7fe640 (LWP 12116) exited]
PyQt5.QtPrintSupport, PyQt5.QtQuick, [Thread 0x7fff7effd640 (LWP 12117) exited]
PyQt5.QtQuickWidgets[Thread 0x7fff7dffb640 (LWP 12119) exited]
, PyQt5.QtSensors[Thread 0x7fff7e7fc640 (LWP 12118) exited]
, PyQt5.QtSql[Thread 0x7fff7ffff640 (LWP 12115) exited]
, PyQt5.QtSvg[Thread 0x7fff84fc8640 (LWP 12114) exited]
, PyQt5.QtTest[Thread 0x7fff857c9640 (LWP 12113) exited]
, PyQt5.QtTextToSpeech[Thread 0x7fff85fca640 (LWP 12112) exited]
, PyQt5.QtWebChannel, PyQt5.QtWebKit, PyQt5.QtWebKitWidgets, PyQt5.QtX11Extras, PyQt5.QtXml, PyQt5.QtXmlPatterns, lxml._elementpath, lxml.etree (total: 29)

Thread 1 "python3" received signal SIGSEGV, Segmentation fault.
0x00007ffff7a4bd22 in raise () from /usr/lib/libc.so.6
(gdb) continue
# app crashed
Continuing.
Couldn't get registers: Нет такого процесса. # No such a process exists
Couldn't get registers: Нет такого процесса. # No such a process exists
(gdb) [Thread 0x7fff7d7fa640 (LWP 12120) exited]
[Thread 0x7fffb97fa640 (LWP 12110) exited]
[Thread 0x7fffb9ffb640 (LWP 12109) exited]
[Thread 0x7fffba7fc640 (LWP 12108) exited]
[Thread 0x7fffbaffd640 (LWP 12107) exited]
[Thread 0x7fffbb7fe640 (LWP 12106) exited]
[Thread 0x7fffbbfff640 (LWP 12105) exited]
[Thread 0x7fffd8aee640 (LWP 12104) exited]
[Thread 0x7fffd92ef640 (LWP 12103) exited]
[Thread 0x7fffd9af0640 (LWP 12102) exited]
[Thread 0x7fffda2f1640 (LWP 12101) exited]
[Thread 0x7fffdaaf2640 (LWP 12100) exited]
[Thread 0x7fffdb2f3640 (LWP 12099) exited]
[Thread 0x7fffdbaf4640 (LWP 12098) exited]
[Thread 0x7fffe8dfd640 (LWP 12097) exited]
[Thread 0x7fffeb044640 (LWP 12096) exited]

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.

this log seems to point to where the bug is (QWidget::mapFromParent), If I really know how to work with gdb, I should start fixing, but I don't know, so, I need some time or more help.

SergSel2006 avatar Jan 19 '22 16:01 SergSel2006