Page 1 of 1

Sigil messes up QTreeView then crashes

PostPosted: Oct 7th, '18, 21:21
by banjo
Running Sigil, the eBook editor, when I attempt to reorder the files in the Book Browser, the QTreeView of the file hierarchy gets messed up.

The reordering of the files in Sigil is done by drag and drop in the Book Browser, which is a QTreeView. When I do that, it leaves ghost images and blank spaces. Then, when I right click in the blank space, Sigil crashes with a seg fault.

In the example document, the Chapter 2 file comes after the Index file. When I drag the Chapter 2 file above the Index file, the error occurs.

Here is the screen before dragging the Chapter 2 file up one. The Book Browser is on the left side. It shows TOC, Chapter 1, Index, Chapter 2.

crash001.png
The Book Browser before dragging the file (on the left)
crash001.png (102.39 KiB) Viewed 847 times


Here is the screen after dragging the Chapter 2 file up one. The QTreeView should show TOC, Chapter 1, Chapter 2, Index.

crash003.png
The Book Browser after dragging the file.
crash003.png (103.76 KiB) Viewed 847 times


It is actually showing TOC, Chapter 1, a ghost Chapter 2, a blank space, Index, and another Chapter 2. At this point, the QTreeView, or its contained tree, appear to be corrupted. Trying to do any action in the view after this point crashes Sigil.

The Sigil forum says that this problem has only been reported on Mageia and PCLOS; it runs fine on other Plasma platforms.

Has anybody seen this problem in Qt before?

Here is one last curious datapoint. If I run Sigil through ssh, the problem disappears. If I run

Code: Select all
ssh -X localhost sigil


on the same Mageia system it works OK. The icons look different, but the program works. I also ran sigil remotely from my Mint computer and it ran OK.... slow... but it didn't crash. Curioser and curioser.

Thanks for reading
Banjo
(_)=='=~

Re: Sigil messes up QTreeView then crashes

PostPosted: Oct 7th, '18, 21:36
by doktor5000
banjo wrote:The Sigil forum says that this problem has only been reported on Mageia and PCLOS; it runs fine on other Plasma platforms.

Has anybody seen this problem in Qt before?

Here is one last curious datapoint. If I run Sigil through ssh, the problem disappears. If I run

Code: Select all
ssh -X localhost sigil


on the same Mageia system it works OK. The icons look different, but the program works. I also ran sigil remotely from my Mint computer and it ran OK.... slow... but it didn't crash. Curioser and curioser.


You may want to report this to our bugzilla, maybe that information may help already to at least diagnose that issue.

Re: Sigil messes up QTreeView then crashes

PostPosted: Oct 7th, '18, 23:47
by banjo
OK. Thanks. I posted a bug report.

Banjo
(_)=='=~

Bugzilla-link:
https://bugs.mageia.org/show_bug.cgi?id=23649

isadora

Re: Sigil messes up QTreeView then crashes

PostPosted: Oct 8th, '18, 19:35
by banjo
I have been trouble shooting this issue, and while I have not found a way to fix the bug in Qt, I have found another workaround.

If I lie to Sigil about what desktop I am using, the program works normally.

I tell it that I am using XFCE instead of KDE and the crash is gone. I simply add XDG_CURRENT_DESKTOP=XFCE to the sigil startup script and it works. As far as I can tell, all of the Sigil features still work, but I have not run a complete test.

If I lie to it and tell it that I am using GTK, some of the menu bars stop working, so I am using XFCE.

Here is the new sigil script.

Code: Select all
#!/bin/sh

# Entry point for Sigil on Unix systems.
# Adds linked Qt's lib directory to the LD_LIBRARY_PATH

QTLIB_DIR="/usr/lib64"
SIGIL_BIN_DIR="/usr/local/lib/sigil"
XDG_CURRENT_DESKTOP=XFCE

if [ -z "$LD_LIBRARY_PATH" ]; then
  LD_LIBRARY_PATH="$SIGIL_BIN_DIR:$QTLIB_DIR"
else
  LD_LIBRARY_PATH="$SIGIL_BIN_DIR:$QTLIB_DIR:$LD_LIBRARY_PATH"
fi

# Create an environment var for the Sigil share directory location.
if [ -z "$SIGIL_SHARE_PREFIX" ]; then
  SIGIL_SHARE_PREFIX="/usr/local"
  export SIGIL_SHARE_PREFIX
fi

# Not really needed anymore but left in for fringe cases
#if [ -z "$SIGIL_EXTRA_ROOT" ]; then
#  SIGIL_EXTRA_ROOT="/usr/local/share/sigil"
#  export SIGIL_EXTRA_ROOT
#fi

export LD_LIBRARY_PATH

exec /usr/local/lib/sigil/sigil "$@"


To do this, just edit the sigil startup script and add the line

XDG_CURRENT_DESKTOP=XFCE

The startup script is /usr/bin/sigil for the 0.9.8 version installed from the repos, or in /usr/local/bin/sigil for the 0.9.10 that I built from source.

Banjo
(_)=='=~