Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 04-25-2025, 01:59 PM   #1
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,368
Karma: 167205629
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Sigil running multiple instances

I'm not sure if this is an issue with Sigil or with my environment. At times, I will run 2 copies of Sigil (one on each monitor). After I compiled the latest GitHub code, the first instance of Sigil runs happily. When I open the second instance, I get the wait cursor (endless spinning circle) and end up having to force kill the second instance. I reverted back to 2.4.2 beta 4 (the one that reports itself as 2.5.0 compiled on 2025-Mar-05) since I still had the installer and no problems running 2 instances.

Is anyone else seeing this issue on Windows? Misery would love some company.
DNSB is offline   Reply With Quote
Old 04-25-2025, 02:27 PM   #2
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,431
Karma: 5702578
Join Date: Nov 2009
Device: many
Sorry, can not help here as the paradigm on MacOS is to allow multiple MainWindows from the same instance of Sigil.

Do your two displays use a single graphics card/driver instance or do you have multiple graphics cards installed?

If sharing the one graphics card and mapping the two displays to different areas of the virtual display (side by side displays or top and bottom displays) it should work.

But In all cases the two instances will share Sigil settings files, so perhaps one is trying to open up on top of or behind the second instance?

Perhaps it is a problem with Qt WebEngine? Have you tried hiding Preview and then launching the second instance?

Any other error messages get printed when you launch one from the command line?

I will try this on Linux (two instances of Sigil running) but I only have a single display.

Last edited by KevinH; 04-25-2025 at 02:32 PM.
KevinH is offline   Reply With Quote
Old 04-25-2025, 02:38 PM   #3
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,330
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'll try it on Windows with the latest GitHub sometime this weekend. I also only have one display though.
DiapDealer is offline   Reply With Quote
Old 04-25-2025, 05:59 PM   #4
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,368
Karma: 167205629
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Just checked. I removed one display and the issue occurs when I try opening a second Sigil instance (right click on the Sigil icon in the taskbar and then click on Sigil) on the same display.

One oddment is that the 2nd instance shows as using 7-10% of CPU continuously while the first instance shows 0%.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2025-04-25 150431.png
Views:	14
Size:	5.9 KB
ID:	215266  

Last edited by DNSB; 04-25-2025 at 06:05 PM. Reason: added image of 2 Sigil instances in Task Manager
DNSB is offline   Reply With Quote
Old 04-25-2025, 06:19 PM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,368
Karma: 167205629
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by KevinH View Post
Sorry, can not help here as the paradigm on MacOS is to allow multiple MainWindows from the same instance of Sigil.

Do your two displays use a single graphics card/driver instance or do you have multiple graphics cards installed?
There is a single graphic card driving the displays.

Quote:
Originally Posted by KevinH View Post
If sharing the one graphics card and mapping the two displays to different areas of the virtual display (side by side displays or top and bottom displays) it should work.

But In all cases the two instances will share Sigil settings files, so perhaps one is trying to open up on top of or behind the second instance?
The second instance opens in front of the first edition.

Quote:
Originally Posted by KevinH View Post
Perhaps it is a problem with Qt WebEngine? Have you tried hiding Preview and then launching the second instance?
The preview windows isn't open. Book browser, code window, ToC and validation results. I closed the book browser and Toc leaving the code window and toolbars open and still the same result.

Edit: disabled everything except the code window and the same result.

Quote:
Originally Posted by KevinH View Post
Perhaps it is a problem with Qt WebEngine? Have Any other error messages get printed when you launch one from the command line?
No error messages, just returns to the command prompt.

Quote:
Originally Posted by KevinH View Post
I will try this on Linux (two instances of Sigil running) but I only have a single display.
Just checked and removed the second display. The issue still happens when I open a second instance of Sigil.

Last edited by DNSB; 04-25-2025 at 06:23 PM.
DNSB is offline   Reply With Quote
Old 04-25-2025, 07:05 PM   #6
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,431
Karma: 5702578
Join Date: Nov 2009
Device: many
In Linux I happily opened 5 instances of Sigil at the same time with no issues. Using multiple MainWindows works on MacOS as well.

So whatever this is it is specific to Windows.
KevinH is offline   Reply With Quote
Old 04-25-2025, 07:23 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,368
Karma: 167205629
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I'm rather hoping that @DiapDealer when he tests on Windows this weekend comes up with no issues so it's not an issue with the Sigil codebase.
DNSB is offline   Reply With Quote
Old 04-25-2025, 07:43 PM   #8
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,431
Karma: 5702578
Join Date: Nov 2009
Device: many
I was reading on Windows 11 and saw that it supports multiple virtual desktops. Could Sigil have opened in a second virtual Desktop?
KevinH is offline   Reply With Quote
Old 04-25-2025, 08:11 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,368
Karma: 167205629
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I tried opening a virtual desktop and got the same result. Opened Sigil in desktop 1, switched to desktop 2, opened a second Sigil instance and Sigil hung with the wait cursor. Oddly the minimize and full screen/window button still work but the close button does not.
DNSB is offline   Reply With Quote
Old 04-25-2025, 08:29 PM   #10
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,431
Karma: 5702578
Join Date: Nov 2009
Device: many
That is a weird one. Let's hope DiapDealer or BeckyEbook has some ideas?
KevinH is offline   Reply With Quote
Old 04-25-2025, 09:01 PM   #11
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,431
Karma: 5702578
Join Date: Nov 2009
Device: many
There was one recent change that could cause an infinite loop but should not.

This is the one I am worrying about:

https://github.com/Sigil-Ebook/Sigil...afbe68f6c1d6b2


So could you try the following change to see if it helps in any way:

In Sigil/src/ViewEditors/ViewPreview.cpp

Code:
void ViewPreview::CustomSetDocument(const QString &path, const QString &html)
{
    if (html.isEmpty()) {
        return;
    }

    m_CustomSetDocumentInProgress = true;

    if (!url().isEmpty()) {

        // Storing the Caret Location here causes problems as it happens to interfere with later loading
        // StoreCurrentCaretLocation();

        // To keep memory footprint small, clear any caches when a new page loads
	// But in Qt 6.7.0 and later cache clearing became asynchronous requiring a callback
	// *before* trying to load anything after a cache clear, otherwise loading
        // remote resources fails

        // Note: toLocalFile() fails with any custom scheme (ie. our sigil: scheme)
        // So convert url to file: scheme to extract the local file
        QUrl localurl(url());
        localurl.setScheme("file");
        localurl.setHost("");
        if (localurl.toLocalFile() != path) {
	     DBG qDebug() <<  "clearing Preview's httpcache";
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
	     m_CacheCleared = false;
#endif
	     page()->profile()->clearHttpCache();
             while(!m_CacheCleared) {
                 qApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers, 50);
             }
        } 
    }
Try commenting out the setting of m_CacheCleared to false and commenting out the actual clearing of the cache itself: page()->profile()->clearHttpCache();

In other words make it look like the following:

Code:
void ViewPreview::CustomSetDocument(const QString &path, const QString &html)
{
    if (html.isEmpty()) {
        return;
    }

    m_CustomSetDocumentInProgress = true;

    if (!url().isEmpty()) {

        // Storing the Caret Location here causes problems as it happens to interfere with later loading
        // StoreCurrentCaretLocation();

        // To keep memory footprint small, clear any caches when a new page loads
	// But in Qt 6.7.0 and later cache clearing became asynchronous requiring a callback
	// *before* trying to load anything after a cache clear, otherwise loading
        // remote resources fails

        // Note: toLocalFile() fails with any custom scheme (ie. our sigil: scheme)
        // So convert url to file: scheme to extract the local file
        QUrl localurl(url());
        localurl.setScheme("file");
        localurl.setHost("");
        if (localurl.toLocalFile() != path) {
	     DBG qDebug() <<  "clearing Preview's httpcache";
#if QT_VERSION >= QT_VERSION_CHECK(6, 7, 0)
	     // m_CacheCleared = false;
#endif
	     // page()->profile()->clearHttpCache();
             while(!m_CacheCleared) {
                 qApp->processEvents(QEventLoop::ExcludeUserInputEvents | QEventLoop::ExcludeSocketNotifiers, 50);
             }
        } 
    }
That will let it pass straight through the loop waiting for the cache to clear.

Perhaps there is some lock being held on the cache so that the second instance can never clear it properly.

If that is the case I will have to rethink/redesign the clearing of the cache code so that two different Sigil instances use separate caches. Perhaps by using uuid generation to make unique cache names.

If you get a free moment, please give that a try and let me know if that is the culprit.

Last edited by KevinH; 04-25-2025 at 09:26 PM.
KevinH is offline   Reply With Quote
Old 04-26-2025, 01:51 AM   #12
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 44,368
Karma: 167205629
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
I tried that modification and it worked! I launched 4 Sigil instances and they were happy campers.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2025-04-25 225043.png
Views:	11
Size:	190.9 KB
ID:	215268  
DNSB is offline   Reply With Quote
Old 04-26-2025, 07:11 AM   #13
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,330
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Wow! Good catch. That's not something I would have suspected.
DiapDealer is offline   Reply With Quote
Old 04-26-2025, 08:33 AM   #14
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,431
Karma: 5702578
Join Date: Nov 2009
Device: many
So on Windows the cache is being locked and therefore can not be cleared by a second or third instance of Sigil.

I ran some experiments and the web profile name "Preview" in our case (see Misc/ WebProfileMgr.cpp) is not being used so adding a uuid to it will not help. I will have to create unique "local-storage" locations for each instance of Sigil inside Prefs somehow to allow the cache to be properly cleared.

Thanks for reporting that bug and testing things to confirm its source.

Last edited by KevinH; 04-26-2025 at 08:40 AM.
KevinH is offline   Reply With Quote
Old 04-26-2025, 10:34 AM   #15
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,431
Karma: 5702578
Join Date: Nov 2009
Device: many
Okay from looking around, Qt seems to put its cache files everyplace even though we provide it with a local storage path.

This is so strange ...

It seems that some caching is done in our Sigil Prefs inside the designated local-storage folder.

It seems a QtWebEngine folder is also created there but it is basically empty always.

Then I found some recent cache files in ~/Libary/Caches/sigil-ebook/sigil/ locations which is Qt's StandardPaths::CacheLocation

Here is what Qt's StandardPaths::CacheLocation that defaults to on all three platforms:

MacOS: ~/Library/Caches/<APPNAME> (APPNAME for me was sigil-ebook/sigil/)

Windows: "C:/Users/<USER>AppData/Local/<APPNAME>/cache"

Linux: ~/.cache/<APPNAME>

If I look inside that I do find a cache called "Preview" as expected and it does have some data.

But there is a bunch of stuff in our Sigil Prefs folder in the assigned "local-storage" folder that is updated when working in Sigil as well.

I have no idea which of these locations on Windows, that the second (or third or ...) instance of Sigil is being locked out of.

I have no idea why QtWebEngine is spreading its working files all over the place.

So I am not sure which name or path needs to be extended by a uuid.

I tried wiping out all of those cache locations and local-storage locations and restarting Sigil and they are all being recreated and used.

What are people seeing under Linux and Windows?

Last edited by KevinH; 04-26-2025 at 10:36 AM.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple content-server instances possible ? Tuxracer Server 15 05-28-2022 02:09 PM
Running 2 instances in order to merge/combine two very different libraries? manawydan Library Management 1 12-28-2020 06:41 PM
Way to open multiple instances of calibre? charlweed Server 1 12-28-2018 09:24 PM
Two instances of calibre running BetterRed Calibre 2 06-19-2017 04:18 AM
Two or multiple instances of Calibre on one computer clockmaker Library Management 2 06-30-2012 01:55 PM


All times are GMT -4. The time now is 03:15 AM.


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