Hi Ducks,
I now have a 100% reproducible way to cause a crash in Sigil 0.8.4 (but I am not sure it is what is causing your crash).
1. run Sigil
2. File->Open
- Select any epub with lots of chapters and already has an HTMl toc.
3. In the Book Browser pane - drag the toc.html and move it to be the very last xhtml file
4. double-click on the toc.html in the BookBrowser pane to launch a fresh tab with the toc.html in it
5. Near the top of the Book Browser Pane highlight a random selection of two or more chapters
6. Right click on those highlighted chapters and invoke Delete
7. Confirm the Delete in the pop up item menu
8. After the delete is finished create a new HTML Table of Cotnets as follows:
Tools->Table of Contents -> Create HTML Table Of Contents
I get an instant crash ...
Code:
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 org.qt-project.QtGui 0x0000000105520818 QTextCursor::QTextCursor(QTextCursor const&) + 24
1 org.qt-project.QtWidgets 0x00000001030e806a QWidgetTextControl::textCursor() const + 26
2 org.qt-project.QtWidgets 0x0000000103102d09 QPlainTextEdit::textCursor() const + 25
3 com.sigil-ebook.Sigil.app 0x0000000101fd1369 CodeViewEditor::ExecuteCaretUpdate(bool) + 57
4 com.sigil-ebook.Sigil.app 0x0000000101d4b52c FlowTab::ResourceModified() + 44
5 com.sigil-ebook.Sigil.app 0x000000010206cd86 FlowTab::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 2438
6 org.qt-project.QtCore 0x0000000105b8a9db QMetaObject::activate(QObject*, int, int, void**) + 2987
7 com.sigil-ebook.Sigil.app 0x000000010206b0fa Resource::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 538
8 org.qt-project.QtCore 0x0000000105b8a9db QMetaObject::activate(QObject*, int, int, void**) + 2987
9 org.qt-project.QtGui 0x00000001054f703b QTextDocument::allFormats() const + 25035
10 org.qt-project.QtGui 0x000000010552b496 QTextCursor::endEditBlock() + 486
11 org.qt-project.QtGui 0x000000010553bc61 QSyntaxHighlighter::setDocument(QTextDocument*) + 257
12 org.qt-project.QtGui 0x000000010553be0a QSyntaxHighlighter::~QSyntaxHighlighter() + 26
13 com.sigil-ebook.Sigil.app 0x0000000101f07f3a XHTMLHighlighter::~XHTMLHighlighter() + 122
14 org.qt-project.QtCore 0x0000000105b82c05 QObjectPrivate::deleteChildren() + 245
15 org.qt-project.QtWidgets 0x0000000102f5f97b QWidget::~QWidget() + 1467
16 com.sigil-ebook.Sigil.app 0x0000000102076ea3 CodeViewEditor::~CodeViewEditor() + 307
17 com.sigil-ebook.Sigil.app 0x0000000101d4aa5c FlowTab::~FlowTab() + 124
18 com.sigil-ebook.Sigil.app 0x0000000101d4ab5e FlowTab::~FlowTab() + 14
19 org.qt-project.QtCore 0x0000000105b83628 QObject::event(QEvent*) + 856
It appears to be crashing while trying to close a CodeView FlowTab window (in this case I think this is the one showing the HTML toc that was opened in step 4).
So if anyone has a free moment would you see if you can recreate this crash and let me know. If it can be recreated and is not simply just a problem with my system, I will try and track it down and get it fixed as well.
Thanks,
KevinH
FWIW: my git master fails on the same sequence of events but in a completely different place. So it appears that after deleting a file from a book, there are many many concurrent threads which are updating each of the remaining xhtml files for any links into the files that were deleted, as well as another thread updating the NCX code that the html toc is based on.
So the code is probably missing a mutex lock of some sort to serialize things properly.