Bug 23649 - Sigil Book Browser gets corrupted when reordering files with drag and drop
Summary: Sigil Book Browser gets corrupted when reordering files with drag and drop
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 6
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: David GEIGER
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-07 23:42 CEST by Brian Kimerer
Modified: 2020-08-17 02:03 CEST (History)
2 users (show)

See Also:
Source RPM: sigil-0.9.8-1.mga6
CVE:
Status comment:


Attachments

Description Brian Kimerer 2018-10-07 23:42:59 CEST
Description of problem:

Running Sigil, when I attempt to reorder files in the Sigil Book Browser, the file hierarchy gets corrupted.  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 grayed out file names and blank spaces. Then, when I right click in the blank space, Sigil crashes with a seg fault.

This has been discussed in Mageia forum topic https://forums.mageia.org/en/viewtopic.php?f=7&t=12511&p=73545#p73545 with screen captures.

In my example document, there are four XHTML files, TOC, Chapter 1, Chapter 2 and Index. When I open the book in Sigil, the order of the files in the Book Browser is TOC, Chapter 1, Index, Chapter 2. The Chapter 2 file comes after the Index file. When I drag the Chapter 2 file above the Index file, the error occurs.


After dragging the Chapter 2 file to a position above the Index file, the QTreeView should show TOC, Chapter 1, Chapter 2, Index. It it actually shows TOC, Chapter 1, a grayed out 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 post a context menu 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.

Here is one last curious datapoint.

If I run Sigil through ssh, the problem disappears. If I run

ssh -X localhost sigil

on the same Mageia system it works OK. The icons look different, but the program works. 

System:    Host: mageia6 Kernel: 4.14.70-desktop-2.mga6 x86_64 (64 bit) Desktop: KDE Plasma 5.12.2                        
           Distro: Mageia 6 mga6                                                                                          

Version-Release number of selected component (if applicable):

Sigil 0.9.8
Qt 5.9.4

How reproducible:

I can reproduce this every time.


Steps to Reproduce:

1. Run Sigil, which creates a blank epub book with one XHTML file.
2. In the Book Browser right click on the Text label and select "Add Blank HTML File"
2. In the Book Browser, drag the bottom XHTML file to above the first XHTML file. The tree gets corrupted.
3. If I right click on the blank space in the Book Browser Sigil crashes with a segmentation fault.
Comment 1 Brian Kimerer 2018-10-08 19:34:02 CEST
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.

=============================================
#!/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.
Comment 2 Marja Van Waes 2018-10-09 09:13:56 CEST
Assigning to the registered maintainer.

CC: (none) => marja11
Assignee: bugsquad => geiger.david68210

Comment 3 David GEIGER 2018-10-09 14:44:11 CEST
I'm the maintainer yes but this is not something that I can help to find the issue, for me it's more an upstream issue.
Comment 4 Brian Kimerer 2018-10-09 15:18:45 CEST
The folks on the Sigil forum suspect that it is in a KDE plugin related to customizing Qt to fit a Mageia theme. I don't understand that technology, so I am just passing on the suggestion. I don't really know how the Qt application ties into Plasma.

I filed this under Sigil because that is the program in which the problem presented itself. It looks as though the problem is not caused by the Sigil code. The Sigil code sets up the QTreeView, and then Qt takes it from there. So it looks like a Qt problem, but I have not been able to track it down to that level yet, and I did not know where else to file the problem report.

Please feel free to pass this on to whomever might be interested.

As far as I can tell, the workaround expressed above resolves the issue for Sigil. Further investigation might be warrented to avoid the same problem arising in other tools.
Comment 5 Brian Kimerer 2018-10-11 15:46:39 CEST
There is a small test program that displays this problem as well. You can find it here:

https://gitlab.com/bugpocs/WidgetListCrash

I have compiled this on Mageia 6, and it crashes with the drag and drop. It also crashes on other distros as well, but only on KDE. It is reported that it only happens on Qt5, not on Qt4.

So this is not a Sigil bug, and it is not a Mageia bug. It appears to be a Qt5 on Plasma bug. Is there a way to report this to the proper folks? I am still not sure who needs to get this.

Thanks.
Comment 6 Aurelien Oudelet 2020-08-16 20:47:42 CEST
Mageia 6 changed to end-of-life (EOL) status on 2019-09-30. It is no longer 
maintained, which means that it will not receive any further security or bug 
fix updates.

Package Maintainer: If you wish for this bug to remain open because you plan 
to fix it in a currently maintained version, simply change the 'version' to 
a later Mageia version.

Bug Reporter: Thank you for reporting this issue and we are sorry that we 
weren't able to fix it before Mageia 6's end of life. If you are able to 
reproduce it against a later version of Mageia, you are encouraged to click 
on "Version" and change it against that version of Mageia.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a more recent
Mageia release includes newer upstream software that fixes bugs or makes them
obsolete.

If you would like to help fixing bugs in the future, don't hesitate to join the
packager team via our mentoring program [1] or join the teams that fit you 
most [2].

[1] https://wiki.mageia.org/en/Becoming_a_Mageia_Packager
[2] http://www.mageia.org/contribute/

Best regards,
Aurélien
Bugsquad Team

Resolution: (none) => OLD
CC: (none) => ouaurelien
Status: NEW => RESOLVED

Comment 7 Brian Kimerer 2020-08-17 02:03:34 CEST
Wow. This is a really old bug.

I am running sigil on both Mageia 7 and Mageia 8 alpha, and I have not seen this problem for quite a while.

I am running a self-compiled version (1.2.1) on Mga7 (to get a later version than what is in the repository). The drag and drop feature works fine.

I am running the repository version (1.3.0) on Mga8alpha.

I think that we can close this.

Note You need to log in before you can comment on or make changes to this bug.