![]() |
#1 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Crash in Sigil while using Create HTML TOC
![]() The HTML TOC crash always felt like it was a race condition. You could actually see the repaint start (existing TOC), but it would not always 100% crash, even if it was a some-editing-used session |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Crash in Sigil while using Create HTML TOC
Hi Ducks,
The bug I fixed would not prevent a crash, just an empty css file or empty html file. If you are seeing a crash related to Create TOC, I would really like to know how to recreate it so I can track that one down too. So if you can come up with a simple sequence of events (similar to what I posted for the disappearing css file), I would be happy to try and track down that bug and get it fixed as well. Any input as to under what conditions the crash happens would be greatly appreciated. Thanks, KevinH |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Crashes were almost 100% if I tried to Create a new HTML TOC after doing structure edits (Splits/Deletes) of a Validated (FC) EPUB in the same session on Windows. I saved, then tried reloading the book. No Joy. (some buffer is corrupted?) I had to fully exit Sigil and start fresh. If the (identified in guide) HTML TOC exists , it was intermittent ( ![]() NOTE, I have not recently made a HTML TOC, so I do not know if the issue is still in 8.2 and up so I will try later And Thanks for looking into these kinds of issues |
|
![]() |
![]() |
![]() |
#4 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
MS Crash report
I made a couple of CSS edits,Cleaned the CSS, Moved the existing HTML TOC to the end of the list. (The TOC Browser list looked good)
Tools:Table of Contents: Create HTML TOC The new TOC painted: then DR Watson appeared ![]() Repeated: No fail ![]() ![]() ![]() Last edited by theducks; 03-26-2015 at 02:02 PM. Reason: attachment failed |
![]() |
![]() |
![]() |
#5 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
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 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. Last edited by KevinH; 03-26-2015 at 04:43 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi DiapDealer,
If you see this and get a free moment and can replicate the Create HTML TOC crash as above, then please see if the following will fix it in Sigil 0.8.4. It fixes it in my git Sigil master but it happens differently according to the tracebacks, so this may not be the same bug (but I hope so). Code:
--- src/Sigil/Tabs/FlowTab.cpp.orig 2015-03-26 17:11:32.000000000 -0400 +++ src/Sigil/Tabs/FlowTab.cpp 2015-03-26 17:15:50.000000000 -0400 @@ -109,7 +109,14 @@ // Explicitly disconnect signals because Modified is causing the ResourceModified // function to be called after we delete BV and PV later in this destructor. // No idea how that's possible but this prevents a segfault... - disconnect(); + disconnect(&m_HTMLResource, 0, 0, 0); + disconnect(this, 0, 0, 0); + if (m_wBookView) { + disconnect(m_wBookView, 0, 0, 0); + } + if (m_wCodeView) { + disconnect(m_wCodeView, 0, 0, 0); + } m_WellFormedCheckComponent.deleteLater(); if (m_wBookView) { Hope this does the trick! KevinH |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,352
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,352
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I can't get 0.8.4 (Windows Vista 32-bit) to crash with those steps. Does the html toc NEED to be named toc.html?
There's likely to be some other variables in play. Are the tabs open in Book View or Code View? Widget placement/visibility? |
![]() |
![]() |
![]() |
#9 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi DiapDealer,
The test book I used had the file named toc.html and had lots of chapters. I was only in CodeView (never BookView) and the toc.html file must be open in the FRONT tab when you invoke the Create HTML Table of Contents after deleting a bunch of the early chapters. No Preview window open (the right pane was showing the Table of Contents). When I get home I will try to see which if any of these impacts the problem. If you can not recreate it then perhaps the Sigil master bug is different enough from the Sigil 0.8.4 bug to cause an issue. And I should keep looking. Thanks, Kevin |
![]() |
![]() |
![]() |
#10 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
The TOC bug has been around before 8.x
I like my HTML TOC at the end since I use the device built-in, NCX navigation ![]() I just dragged a few to the end of 150 files. that is a lot of scrolling (wait) ![]() |
![]() |
![]() |
![]() |
#11 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi theducks,
Yes, the bug I fixed has been around a long time. There is an earlier attempt at fixing it already in the Sigil 0.8.4 code so someone knew about it. The fix was a bit incomplete and I think I have now fixed that but there may be no way to know if DiapDealer (or anyone else) can't get it to fail first in a reliable way. If you follow the steps I wrote to recreate it above (which were based on what you said you were doing at the time), will it crash for you? If so, then I could give you a new build to try to see if the crash goes away. KevinH Last edited by KevinH; 03-27-2015 at 03:26 PM. |
![]() |
![]() |
![]() |
#12 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi,
We can close this report as I checked out Sigil 0.8.4 source and added in the patch and the problem has completely gone away. This fix should appear in a forthcoming Sigil 0.8.5 bugfix release along with the disappearing css fix. Thanks so much for the bug report! KevinH |
![]() |
![]() |
![]() |
#13 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() ![]() |
|
![]() |
![]() |
![]() |
#14 |
Connoisseur
![]() Posts: 72
Karma: 10
Join Date: Nov 2012
Device: none
|
Html TOC bug in 8.5
Was the TOC fix implemented in 8.5, because if it was, I think it created another problem.
If I create the TOC first, then make structure changes such as file deletes and splits, then recreate the TOC, the new headers I've added are sometimes shown at the end of the TOC, regardless of the file sequence number in the book browser. The out of sequence toc entries don't work when Sigil is closed, and upon reopening Sigil, I find that the files that these TOC entries referred to have been deleted. This has happened 3 or 4 times since 8.5 was released. None of this occurs If I initially create the TOC as my last workflow item. I need more time to test all this, but is anyone else seeing this, or something like this? |
![]() |
![]() |
![]() |
#15 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi,
Yes the fix for this crash and a fix for disappearing css are the only changes in Sigil 0.8.5. I don't think this fix is directly causing your problems but this change did make a merge crash much easier to occur (and track down and fix). But I could be wrong and that full disconnect when a file is deleted (and its tab is closed) may be doing some harm that I can't detect on my builds and testing. I do have an alternative more focused way to fix that Create TOC crash that I will put into Sigil 0.8.6 that should be ready for release in a week or so along with the merge crash fix, and hopefully a fix for using audio and video on Windows if I can figure that out as well in time. So if this bug is hitting you and the exact same sequence of events does not cause a problem in Sigil 0.8.4, then you might want to revert to 0.8.4 until 0.8.6 comes out. If on the other hand you can recreate this in Sigil 0.8.4, then it must be a new bug that needs to be tracked down. If so the sooner the better. Take care, Kevin Quote:
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Creating an html TOC in Sigil | holdit | Sigil | 3 | 11-13-2014 11:17 PM |
Multiple HTML files w/ TOC to MOBI, not added in order listed in TOC | dysfunction | Conversion | 3 | 01-03-2014 12:40 AM |
Ho do I create a TOC for ePub which does convert to an active TOC in Kindle Previewer | K-Thom | Calibre | 1 | 09-24-2013 06:32 PM |
Kindler previewer not recognizing toc.ncx file, my html toc, or the start point... | petercrowell | Kindle Formats | 2 | 05-01-2012 08:14 AM |
Any way to create a "toc" guide item when converting HTML to MOBI? | DMSmillie | Calibre | 2 | 12-16-2010 06:47 PM |