![]() |
Repeated crash
Good morning, I know how you guys are about Sigil crashing, and I admire your attitude. I have been working on a series of books from the same author, and I have discovered a consistent action that causes this dreaded occurrence. Unfortunately, I don't think you'll be able to reproduce it--I've experimented, and it appears to be a unique occurrence based on the cumulative actions up to that point.
Here's what is going on. I'm working on the book, and finally arrive at the point where I am ready to create the Table of Contents. I create the internal TOC, then I go to the TOC I already have in the file, and make a copy of it. (There's some formatting inside it that I want to retain.) I then go to create an HTML TOC, and every time, Sigil crashes. I reopen the same file, create the HTML TOC with no problems, and go about my business. With the most recent one, I saved it beforehand, then made a copy of the entire file by copying/pasting in my file manager, then tried to create the HTML TOC, and got the expected crash. So I do have a copy of the file exactly as it was before the crash. But unfortunately, opening that copy (actually a COPY of that COPY--so I can leave the original copy unmolested) and performing the same action doesn't cause a crash. Not wanting to get in trouble with the copyright police, I'm not attaching it, of course. If there's anything else I can do to help you to track down this pesky little error, please let me know. Now, on a completely unrelated topic, I'm wondering if there's any way the user can modify one of Sigil's INI files to add "Add Link" to the right-click context menu? Thanks for all you folks do. If I were to say that I totally love Sigil, I'd only be making an understatement. |
2 Attachment(s)
Quote:
It seems like it only occurs after I have worked on the book for a while, and it always works perfectly fine after I reload the EPUB and recreate the TOC. I've just gotten in the habit of saving the EPUB at all "major" revisions, so I usually lose zero work when the crash happens. Windows 10 64-bit (although I think I recall this happening back in Windows 7 as well). And it has been happening for quite a while, so it isn't something that was introduced very recently. I'll definitely try to pay much closer attention to this the next time I run across it. Quote:
Did you know that there is an Insert Link button: Attachment 159846 Or you could go into Edit > Preferences > Keyboard Shortcut, and search for "Link": Attachment 159847 Or you could also create a Clip: Code:
<a href="\1">\1</a>Code:
http://sample.comCode:
<a href="http://sample.com">http://sample.com</a> |
I would focus on the central tabs that are open when the crash occurs. Especially the tab with the current focus. Is it an xhtml/css file or an opf/ncx file? Does the crash ever occur if only xhtml/css tabs are open when Generate HTML Table of Contents is run?
Or perhaps it only happens right after a resource has been added/removed. |
Also, before starting Create HTML TOC, please open the opf tab and make sure you do not have a guide item that already has the toc semantic set. If so, try unsetting it.
One way to make Sigil crash when creating an html toc, it to have the guide have a toc item that points to the one of the main chapters in the book and not a true separate html table of contents file. This causes Sigil to think the same file it is reading to look for h1, h2 tags is actually the one it is trying to rebuild since it thinks that file is already an html toc and that causes the crash. There were earlier reports of this but I was never able to easily find the difference between a true separate html toc file with proper guide entry and one with a bad guide entry that points to a normal (not a true html toc) file. ps. If you are willing to share the material via a private link, please pm either DiapDealer or me with a link. I would be happy to test with it and then delete it when the bug has been found and fixed. There are also plugins that replace the text with gibberish that you could use if you so desire. |
Quote:
Quote:
Quote:
In the meantime, on the next book, I'll give that first suggestion a whirl. Muchos thankses. |
Quote:
|
Okay, I can definitely recreate the bug and it is a nasty one that happens due to the sequence that closing an existing html toc flow tab uses.
The good news, is that there are easy workarounds: 1. Manually close the html toc file CodeView Tab (assuming it is the one that is properly marked in the guide via the "toc" semantics) before firing up Tools->Table Of Contents ->Create HTML Table of Contents or 2. Disable the guide semantics for "toc" on the html toc file by right clicking on it in the browser and use Add Semantics and reselecting the "Table of Contents" which should toggle it off (or manually edit the guide section of the opf to do the same). This will force Sigil to create a completely new file to house the created html toc. Here is the backtrace which shows what is going on: Code:
lldb back trace of crashI have no idea why the QSyntaxHighlighter would write to QTextDocument in its DESTRUCTOR! This seems like a real Qt bug. I will try to figure out how to temporarily stop the signal for contents changing when in the destructor. What a mess! Nice test case in that it clearly showed the issue as long as I had the previous html toc open in a CodeView Tab when I tried to rebuild it. |
I thought this had been fixed a long time ago. It has not hit me recently.
If I generate the HTML TOC right upon start of the session, usually there was no issue If I did work, then tried: Crash near the end of the Generate. Note: I got into the habit of Saving before ANY TOC generation. (that did not prevent the crash, just prevented other losses ;) ) As I said... not seen in quite a while |
Wow! I don't want to say that that was quick....but that was quick!
I can change my "workflow" so that I don't set the semantics before creating the TOC, instead doing it afterward. I might add, this issue has only come up with this author, because he has the Table Of Contents From Hell. Thank you a bunch! |
The following change just commited to Sigil master seems to fix this issue on my dev machine (a Mac). Hopefully the same fix will work for all platforms.
Code:
diff --git a/src/Tabs/FlowTab.cpp b/src/Tabs/FlowTab.cppThanks for the test case and bug report. I will delete the test case once we confirm the issue is fixed on all platforms. |
Quote:
|
And yes theducks, this bug was "fixed" once before (the comments in the FlowTab destructor are clear on this) but for some reason the simple disconnect that used to fix the problem is now not working or returns before it completes and an explicit disconnect seems to be needed to prevent the flow tab that is being destroyed from being reentered.
Thus the quick patch as I had seen this same bug earlier and thought I had nipped it in the bud, so I am are trying again. The second disconnect may just cause a long enough delay so that the first attempt at full disconnection works but it certainly can not hurt and seems to "fix the problem" on my machine. |
Quote:
Thanks, Kevin |
Are there some concrete steps to recreate the crash before I test the patch?
EDIT: nevermind I just noticed this: Quote:
|
Then it probably only impacts Windows and Mac? Or perhaps is Qt version specific? Does your Windows box show this bug? What Qt version is your Linux build using? My build is using Qt 5.6.2 with official old Qt Webkit added back.
|
| All times are GMT -4. The time now is 10:49 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.