Closed l0ddej0kk0 closed 2 months ago
Sigil window after opening KE3.epub
Can confirm ke3.epub crashes Sigil on Arch Linux with Qt6.7.2. I've not delved into it at all, but the epub is a flat structure (which always worked with Sigil in the past ). Perhaps it's an artifact of our Qt6-only restructuring? Will have more time later to investigate.
I don't see any visual weirdness when the epub opens, however.
The error seems to come in:
MainWindow.cpp - ShowLastOpenFileWarning
which means your epub's xhtml file is probably missing its DOCTYPE.
There was a recent fix in that routine that prevents re-entry that was pushed to master.
If your build was built from official Sigil-2.3.0 sources, please try a new build but from Sigil master today and test if your crash still happens.
Is URI a valid opf indentifier scheme?
<dc:identifier id="BookId" opf:scheme="URI">G1o8wG284</dc:identifier>
That epub has 2 problems:
After opening, you should be seeing these two error messages:
I do not think a URI scheme is allowed there but backtrace is showing the issues in in the warning dialogs that pop up after initial opening.
This all works on macOS.
I will test it on my Manjaro VM
I can confirm the segfault happens even with the updated code in Sigil master on my Qt 6.7.2 Manjaro box.
I should be able to get a good backtrace.
My complete guess is the problem is that some of the warning messages are being generated in a different thread than the main GUI one.
This one might be tricky to fix given ImportEPUB is multithreaded on purspose for loading speed.
Here is the complete backtrace. The problem is happening in QString assignment inside the ShowLastLoadWarnings routine in MainWindow.cpp.
Thread 1 "sigil" received signal SIGSEGV, Segmentation fault.
0x00007fffeb00e522 in QString::operator=(QString const&) () from /usr/lib/libQt6Core.so.6
(gdb) bt
#0 0x00007fffeb00e522 in QString::operator=(QString const&) () from /usr/lib/libQt6Core.so.6
#1 0x0000555555ae6a47 in MainWindow::ShowLastOpenFileWarnings() ()
#2 0x0000555555b00f48 in MainWindow::LoadFile(QString const&, bool) ()
#3 0x0000555555b0340c in MainWindow::Open() ()
#4 0x00007fffeaf9e94a in ?? () from /usr/lib/libQt6Core.so.6
#5 0x00007fffeb91a264 in QAction::activate(QAction::ActionEvent) () from /usr/lib/libQt6Gui.so.6
#6 0x00007fffebf1e4f9 in ?? () from /usr/lib/libQt6Widgets.so.6
#7 0x00007fffebf203f3 in ?? () from /usr/lib/libQt6Widgets.so.6
#8 0x00007fffebd9c15e in QWidget::event(QEvent*) () from /usr/lib/libQt6Widgets.so.6
#9 0x00007fffebd4c51c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt6Widgets.so.6
#10 0x00007fffebd519c1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt6Widgets.so.6
#11 0x00007fffeaf41d28 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt6Core.so.6
#12 0x00007fffebd43e2d in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool, bool) () from /usr/lib/libQt6Widgets.so.6
#13 0x00007fffebdb2530 in ?? () from /usr/lib/libQt6Widgets.so.6
#14 0x00007fffebdb35f0 in ?? () from /usr/lib/libQt6Widgets.so.6
#15 0x00007fffebd4c51c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt6Widgets.so.6
#16 0x00007fffeaf41d28 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt6Core.so.6
#17 0x00007fffeb575df0 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()
from /usr/lib/libQt6Gui.so.6
#18 0x00007fffeb5e4d64 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib/libQt6Gui.so.6
#19 0x00007fffd69f5637 in ?? () from /usr/lib/qt6/plugins/platforms/../../../libQt6XcbQpa.so.6
#20 0x00007fffe9f9aab9 in ?? () from /usr/lib/libglib-2.0.so.0
#21 0x00007fffe9ffc9e7 in ?? () from /usr/lib/libglib-2.0.so.0
#22 0x00007fffe9f99fc5 in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#23 0x00007fffeb19fcbd in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
from /usr/lib/libQt6Core.so.6
#24 0x00007fffeaf4c01e in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt6Core.so.6
#25 0x00007fffeaf4634d in QCoreApplication::exec() () from /usr/lib/libQt6Core.so.6
#26 0x000055555567fc09 in main ()
Okay, found the bug. Missed a test to handle warnings with no details info. The NCX one is that type of warning.
I will push a fix for this to master.
This is now fixed in master. Since master has a few other useful fixes, you may way to build from Sigil master from today. If not, you will need to hand apply this change.
diff --git a/src/MainUI/MainWindow.cpp b/src/MainUI/MainWindow.cpp
index a9904137c..d0430e0fd 100644
--- a/src/MainUI/MainWindow.cpp
+++ b/src/MainUI/MainWindow.cpp
@@ -1644,9 +1644,14 @@ void MainWindow::ShowLastOpenFileWarnings()
QString msg;
QString details;
if (!info.isEmpty()) {
- QStringList warning = info.split(QChar(31));
- msg = warning[0];
- details = warning[1];
+ if (info.contains(QChar(31))) {
+ QStringList warning = info.split(QChar(31), Qt::KeepEmptyParts);
+ msg = warning[0];
+ details = warning[1];
+ } else {
+ msg = info;
+ details = "";
+ }
Utility::DisplayStdWarningDialog(
"<p><b>" %
tr("Warning: ") % msg %
Having an epub2 with no NCX is very very rare as it is a required component of epub2, so whatever code built this epub is broken . So we had no test case for this particular type of epub. We do now.
Thank you for your bug report! The fix is in master and will appear in the next release.
Good work! An ncx-less epub2 should be pretty rare, no?
On Sun, Sep 1, 2024, 10:04 AM Kevin Hendricks @.***> wrote:
Okay, found the bug. Missed a test to handle warnings with no details info. The NCX one is that type of warning.
I will push a fix for this to master.
— Reply to this email directly, view it on GitHub https://github.com/Sigil-Ebook/Sigil/issues/770#issuecomment-2323353560, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACG3CXRVYRTJGCGCOKGLZITZUMNFFAVCNFSM6AAAAABNOYMT7KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTGM2TGNJWGA . You are receiving this because you commented.Message ID: @.***>
Sigil window after opening KE3.epub
I tried several other EPUBs now, and every time Sigil's window comes up like this, it will crash. Example: Clarkesworld #216 - Neil Clarke (ed.).epub.zip Again, don't unzip, merely remove the ".zip".
The EPUB creation is using https://chromewebstore.google.com/detail/epubpress-read-the-web-of/pnhdnpnnffpijjbnhnipkehhibchdeok which seems deprecated, though, so i'll probably switch to some other.
Usually, i look for a suitable cover image and metadata, then tell Calibre to polish the EPUB, which creates cover.xhtml, among other things.
The missing DOCTYPE stems probably from these 2 tools.
regards, l0ddej0kk0
That epub has 2 problems:
- It is an epub2 but has not NCX, Sigil has to create one
It does have a navigation.ncx, look in the KE3epub attached earlier.
- It is missing DOCTYPE on its xhtml files.
Thats from creating with EpubPress (s.a.) and polishing with Calibre, i guess.
After opening, you should be seeing these two error messages:
I used to get two different errors with new EPUBs, but with 2.3.0 it's: (the text about DOCTYPE appears new in 2.3.0) and one other which i cannot seem to reproduce now, about something with the .opf . Using an new empty book Test - Chrome Webstore.epub.zip
regards, l0ddej0kk0
It does have a navigation.ncx, look in the KE3epub attached earlier.
The existence of a navigation.ncx file is not enough. The name of the NCX file identifier must match the entry in the SPINE section.
Look here:
Hi,
just rebuilt from https://github.com/Sigil-Ebook/Sigil/archive/refs/heads/master.zip, but the version stays at 2.3.0. Though i did see in the make install output, that all files were indeed "installed", i.e. older ones overwritten.
Now, the coredump after opening certain EPUBs with the weird window placements seems gone, yay!
Fast work indeed, sir!
As to the two usual warnings on new EPUBs that Sigil has not yet seen before, thats: and
regards, l0ddej0kk0
Now that Sigil won't crash, you can easily eliminate the auto-generated ncx by correcting the spine to point to the id of your navigation ncx (as BeckyDTP described). Then save and reopen.
Those Sigil warnings are correct. As BeckyDTP said, your spine toc attribute does not match the id of the ncx file, it in fact specifies a manifest entry that does not exist in the manifest. Again whatever software generated that epub2 is broken and should not be used.
And as for missing DOCTYPEs, that is a common issue in epub2 epubs generated by Calibre. Kovid is aware of this and decided not to include DOCTYPE even though it is part of the epub specification. That is why Sigil checks and can auto fix those issues (but Sigil will still alert you).
Hi,
for completeness i maybe should include what Sigil says at a console start:
$ sigil
Info:
GL Type: desktop
Surface Type: OpenGL
Surface Profile: CompatibilityProfile
Surface Version: 4.6
QSG RHI Backend: OpenGL
Using Supported QSG Backend: yes
Using Software Dynamic GL: no
Using Multithreaded OpenGL: yes
Init Parameters:
* application-name sigil
* browser-subprocess-path /usr/lib/qt6/libexec/QtWebEngineProcess
* create-default-gl-context
* disable-features ConsolidatedMovementXY,InstalledApp,BackgroundFetch,WebOTP,WebPayments,WebUSB,PictureInPicture
* disable-setuid-sandbox
* disable-speech-api
* enable-features NetworkServiceInProcess,TracingServiceInProcess
* enable-threaded-compositing
* in-process-gpu
* use-gl desktop
regards, l0ddej0kk0
That's pretty typical output for a repo supplied Qt/WebEngineProcess.
On Mon, Sep 2, 2024, 9:46 AM Kevin Hendricks @.***> wrote:
Those Sigil warnings are correct. As BeckyDTP said, your spine toc attribute does not match the id of the ncx file, it in fact specifies a manifest entry that does not exist in the manifest. Again whatever software generated that epub2 is broken and should not be used.
And as for missing DOCTYPEs, that is a common issue in epub2 epubs generated by Calibre. Kovid is aware of this and decided not to include DOCTYPE even though it is part of the epub specification. That is why Sigil checks and can auto fix those issues (but Sigil will still alert you).
— Reply to this email directly, view it on GitHub https://github.com/Sigil-Ebook/Sigil/issues/770#issuecomment-2324800621, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACG3CXXF3ZYBQFDWVIVGZA3ZURT4BAVCNFSM6AAAAABNOYMT7KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRUHAYDANRSGE . You are receiving this because you commented.Message ID: @.***>
Bug Description
A few seconds after opening and weirdly displaying KE3.epub, KE3.epub.zip (just rename KE3.epub.zip to KE3.epub, as this was already zip-ed), Segmentation fault (core dumped) occurs. Other .epub's work just fine.
Sigil 2.3.0 is newly built today, build-sigil.sh also attached. build_sigil.sh.zip
Found the 14MB coredump, tell me if /how you want it.
Platform (OS)
Linux
OS Version / Specifics
LinuxMint 22 Virginia (Ubuntu 24 Noble)
What version of Sigil are you using?
2.3.0
Any backtraces or crash reports