Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 12-06-2014, 12:38 PM   #16
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
Hi,

This is actually impossible to do on a Mac build. On a Mac, when you open a File you are simply opening a new window in the same Sigil.app while not closing anything. You can have multiple open ebooks on a Mac with a single instance of the Sigil.app. Think of the Microsoft Word with multiple open docx files at the same time.

Both Linux and Windows are different in that way. We could of course easily make Windows and Linux work the same way as Mac does but just have not bothered.


So I simply get a new copy of the ebook in another window which I can easily close with no problems.

Sorry, but perhaps DiapDealer can help that bug down as I won't be able to recreate it on a Mac.

Thanks,

KevinH

Quote:
Originally Posted by Doitsu View Post
@KevinH: I was able to crash Sigil by deleting images with the 64bit 0.8.2 Linux and Windows versions.

Here are the steps to reproduce the crash with the Linux version:

1. Start Sigil by double-clicking this epub that crutledge posted today.

2. Enable Preview by pressing F10. (Activate Book View mode, if you haven't already done so.)

3. Select all images and delete them.

4. Open the same file via the File menu (click Discard).

Sigil will crash while re-opening the eub. (Sigil won't crash if Code View mode is activated.)

The official 64bit Windows version crashes in the same way, but I had to repeat the procedure. I.e. I loaded crutledge's epub, activated Book View and the Preview window, deleted all images (without a crash), re-opened the same file and deleted again all images. When I tried to re-open the same file one more time Sigil crashed.
(The Windows version won't crash either, if Code View mode is enabled.)
KevinH is online now   Reply With Quote
Old 12-06-2014, 12:46 PM   #17
rosshalde
Zealot
rosshalde began at the beginning.
 
Posts: 142
Karma: 10
Join Date: Jun 2014
Device: nook
Kevin,

I appreciate your help. If all I have to do it turn off preview, I can live with it.
Let me know if you find anything else.
rosshalde is offline   Reply With Quote
Old 12-06-2014, 12:52 PM   #18
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,062
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
8.2 on XP does not crash doing a bulk delete of images as outlined with no Preview, with floating Preview, with Docked Preview

Get a PC
theducks is offline   Reply With Quote
Old 12-06-2014, 01:01 PM   #19
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 697
Karma: 150000
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by theducks View Post
Get a PC
Or stay out of book view
st_albert is offline   Reply With Quote
Old 12-06-2014, 01:11 PM   #20
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,572
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by rosshalde View Post
Preview was stationary, not floating. I now got it to float and can't get it back. It was sharing the far right column with the TOC and now it wants me to toggle back/forth between TOC/Preview. How do I get it to share the column again?
Need to nail down exactly what "stationary" means in your case. If the Preview Widget is docked (not floating), then there are actually two different ways in which a widget can "share" a pane with another widget. They can be "split" (where both are visible and each claims a certain percentage of the shared pane) and they can be "tabbed/stacked" (where each widget claims the entire pane and tabs become visible that allow you to switch between the widgets occupying the same space).

Which of those two docked scenarios did you mean by; "It was sharing the far right column"? In other words, when Sigil is crashing, is the Preview widget "splitting" the right pane with the ToC, or is it "tabbed/stacked" with the Toc in the right pane?

I only ask because there was a weird bug back in 0.6.x that was only happening when widgets were "tabbed/stacked" (and only on Windows, to boot).

As for your "floating now and I can't get it stationary again" issue, you should be able to double-click on the title bar (of the widget) and it will go back to its last docked position.

Last edited by DiapDealer; 12-06-2014 at 01:22 PM.
DiapDealer is online now   Reply With Quote
Old 12-06-2014, 01:22 PM   #21
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
Hi rosshalde,

Will you please try one thing for me? Open Preview and your test document, but make sure Preview is showing a page with NO image on it. Then try deleting all of the images and let me know if it still crashes for you.

After about 50 attempts with your second book, I was able to get it to crash once and luckily it was running inside the lldb debugger but unluckily neither Sigil nor Qt was a "debug" build so all I could do was assembler level debugging.

The problem appears to be a multi-thread race of some sort. There are a number of sleep timers being used and Events being processed after varying delay times. That is why I can rarely if ever recreate it. It simply needs a random set of conditions where something is deleted before something else can be properly updated to happen.

This might take quite some time to debug, so your best bet is not to delete multiple tabs or files at the same time when Preview is open. I don't think it matters if it is docked or not. You can have Preview open and use it, just not when trying to delete multiple files.

I will try my best to track this down and get either a workaround or a bug fix out before the next release if I can.

Obviously, when deleting multiple image files, we should be updating the xhtml files loaded in Preview first to point to a placeholder empty image, and then actually deleting said image file. I will double check to make sure that sequence of events is correctly being done (or some other form of proper sequencing).

So please try with Preview open to an xhtml file without any image in it first and see if the mass delete still crashes. That will help me to narrow down where in the Sigil code this may be happening and under what conditions.

Thanks again for your bug report!

Take care,

KevinH

Quote:
Originally Posted by rosshalde View Post
Kevin,

I appreciate your help. If all I have to do it turn off preview, I can live with it.
Let me know if you find anything else.

Last edited by KevinH; 12-06-2014 at 01:30 PM.
KevinH is online now   Reply With Quote
Old 12-06-2014, 02:03 PM   #22
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,572
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Doitsu View Post
@KevinH:The official 64bit Windows version crashes in the same way, but I had to repeat the procedure. I.e. I loaded crutledge's epub, activated Book View and the Preview window, deleted all images (without a crash), re-opened the same file and deleted again all images. When I tried to re-open the same file one more time Sigil crashed.
(The Windows version won't crash either, if Code View mode is enabled.)
I was able to get this to happen with the 32 bit version on Windows Vista, too (with crutledge's epub). But, it crashes every time as soon as I confirm the second "delete all images." I don't need to reopen Sigil a third time to get the crash.

EDIT: actually, it only needs to be multiple images if the cover page is the file that's rendering in preview (with crutledge's epub). And even then, you only need to highlight the cover image and one other (any other) image file to make the crash happen. Doesn't need to be all images

If you have any other page open (not the one with the cover semantic) in book view (and preview) that contains an image, you only need to delete THAT ONE image file to make the crash happen (provided you make sure that page is open in book view and preview on the subsequent re-open/delete)

EDIT2: I can do the same thing with rosshalde's epub on Windows, too. But not with other epubs I try.

EDIT3: Believe it or not, the difference is PNG. The crashes seem to be happening when PNGs are being rendered in Book View (with preview widget open) at the same time they're being deleted. It doesn't happen with JPEGs. Sigil seems to be doing something different with that cover-page (the one with the cover semantic) because it alone, doesn't trigger the crash.

Not sure why it takes the "reopen" on Linux/Windows," but this all appears to all be very-much connected to rosshalde's OS X issue ... at least in my mind.

1) epub with PNGs
2) Have a page that contains a PNG (other than the cover page) open in Book View (with Preview Widget open)
3) Delete that PNG (that's in the page being rendered in Book View) in Book Browser.

The crash may happen right there on MAC or you may need to reopen the same epub from the file menu (discard changes) and repeat steps 2 & 3 on Windows/Linux.

EDIT4: I get immediate segfaults/closure on Linux 64-bit immediately upon confirming the file delete when launching Sigil via the *.desktop file. I need to restart Sigil and repeat steps 2&3 to get the segfault when launching from the command-line.

EDIT5: Man ... I'm spent.

TL;DR -- PNG, Book View, Preview, Delete PNG that's rendering (in any other page than the cover-page) = bad

Last edited by DiapDealer; 12-06-2014 at 02:47 PM.
DiapDealer is online now   Reply With Quote
Old 12-06-2014, 02:47 PM   #23
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
Hi DiapDealer,

Nice detective work indeed. They may be the same bug or they may be just related. We seem to be doing a whole lot of things asynchronously when deleting resources and updating the screen.

So for you, you need to have both BookView and Preview open at the same time? Could you ever get it to crash with just CodeView and Preview open?

Thanks!

KevinH
KevinH is online now   Reply With Quote
Old 12-06-2014, 03:07 PM   #24
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,572
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
So for you, you need to have both BookView and Preview open at the same time? Could you ever get it to crash with just CodeView and Preview open?
On Linux and Windows, it takes Book View and Preview being open to trigger it (when deleting a PNG that's in the displayed page). If I'm in Code View it never crashes--regardless of whether Preview is open or not.
DiapDealer is online now   Reply With Quote
Old 12-06-2014, 03:15 PM   #25
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
Hi DiapDealer,

Quote:
Originally Posted by DiapDealer View Post
On Linux and Windows, it takes Book View and Preview being open to trigger it (when deleting a PNG that's in the displayed page). If I'm in Code View it never crashes--regardless of whether Preview is open or not.
Wow that is interesting. So it must be some sort of race or interference between BookView and Preview. I simply can't understand why it is only with png files and not jpegs as well.

Since QtWebKit supports both, I wonder if this is actually a long-standing bug in QtWebkit when it comes to handling PNG files. As for Sigil, as far as I know, we really make no internal distinction treating all Image files the same, and simply load the file as a resource in the QtWebKit widget.

Hmm ... until we can understand exactly what is going on here, we might want to auto-hide Preview if BookView is opened, and Un-auto-hide it if you return to CodeView?

Another alternative if this bug is internal to Qt is to turn off Preview automatically when deleting files until the delete is completely done and then re-opening it.



This is one strange bug.

KevinH
KevinH is online now   Reply With Quote
Old 12-06-2014, 04:20 PM   #26
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,572
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Yeah, it's a weird one. I almost never have Book View (or Preview) open when using Sigil, so some of these bugs are ones that I probably never would have encountered.

I'm just not grasping the PNG connection even though the evidence is right in front of me.
DiapDealer is online now   Reply With Quote
Old 12-06-2014, 05:18 PM   #27
rosshalde
Zealot
rosshalde began at the beginning.
 
Posts: 142
Karma: 10
Join Date: Jun 2014
Device: nook
Thanks for the question. The split screen was not tabbed. It was top/bottom view. Stacked.
rosshalde is offline   Reply With Quote
Old 12-06-2014, 05:28 PM   #28
rosshalde
Zealot
rosshalde began at the beginning.
 
Posts: 142
Karma: 10
Join Date: Jun 2014
Device: nook
Screen shots of Sigil to help diagnosis

I confirm that I did not crash while in <code view> I only crashed in book view.

I took two screen shots of Sigil just as I am about to click "delete" so everyone can see what is open and on the screen and what type of files.

The screen shots are of the the same file. The only difference between the screen shots is code view vs book view.
Hopefully this is helpful.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2014-12-06 at 5.29.15 PM.jpg
Views:	340
Size:	415.7 KB
ID:	132126   Click image for larger version

Name:	Screen Shot 2014-12-06 at 5.30.56 PM.png
Views:	344
Size:	927.3 KB
ID:	132127  
rosshalde is offline   Reply With Quote
Old 12-06-2014, 05:34 PM   #29
rosshalde
Zealot
rosshalde began at the beginning.
 
Posts: 142
Karma: 10
Join Date: Jun 2014
Device: nook
Kevin,

I added another chapter to the book and left it totally blank.
When that is being displayed in Preview and I delete all the images (even in book view), it deletes without crashing. Hope that helps diagnosis
rosshalde is offline   Reply With Quote
Old 12-07-2014, 12:09 AM   #30
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,764
Karma: 6000000
Join Date: Nov 2009
Device: many
Hi,
It seems to be a longtime Qt internal bug as far as I can tell. So I have a tentative patch to prevent this crash, that I have tested on Mac OS X, that seems to work.

See below, in case anyone else builds their own, and would like to try the patch. I would appreciate hearing if it works on other platforms.

Thanks,

KevinH


Code:
--- src/Sigil/MainUI/MainWindow.cpp.current	2014-12-06 14:37:02.000000000 -0500
+++ src/Sigil/MainUI/MainWindow.cpp	2014-12-06 22:07:27.000000000 -0500
@@ -2058,13 +2058,21 @@
 
 void MainWindow::RemoveResources(QList<Resource *> resources)
 {
+    // work around Qt bug when deleting png images on page shown by both
+    // BookView and Preview by temporarily hiding the PreviewWindow
+    bool pw_showing = m_PreviewWindow->IsVisible();
+    if ((pw_showing) && (m_ViewState == MainWindow::ViewState_BookView)) {
+        m_PreviewWindow->hide();
+    }
     // Provide the open tab list to ensure one tab stays open
     if (resources.count() > 0) {
         m_BookBrowser->RemoveResources(m_TabManager.GetTabResources(), resources);
     } else {
         m_BookBrowser->RemoveSelection(m_TabManager.GetTabResources());
     }
-
+    if ((pw_showing) && !m_PreviewWindow->IsVisible()) {
+        m_PreviewWindow->show();
+    }
     ShowMessageOnStatusBar(tr("File(s) deleted."));
 }
KevinH is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sigil on Nook vs Sigil on Kobo vs Sigil on iBook rosshalde Sigil 12 11-13-2014 09:34 AM
sigil 7.4 and maverick crashing crashing crashing Carrigboy Sigil 103 09-04-2014 11:47 AM
Sigil keeps crashing kksdragons Sigil 18 11-14-2013 06:20 AM
Sigil is crashing in Windows lindaw2396 Sigil 4 04-22-2013 05:42 PM
Keeps crashing - any ideas? grimo1re PocketBook 13 10-15-2010 06:02 AM


All times are GMT -4. The time now is 07:06 PM.


MobileRead.com is a privately owned, operated and funded community.