View Single Post
Old 06-08-2018, 01:33 PM   #20
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,887
Karma: 6120478
Join Date: Nov 2009
Device: many
That did the trick for me!

Here is the backtrace - it does not appear to be a Qt bug at all. When you switch to CodeView, Sigil uses javascript to get the location in the DOM hierarchy of the current cursor in BookView (much like a epubcfi and similar in that is is a node count from the body tag) so that in CodeView, we can put the cursor near where it was in BookView. This happens in all transitions from CodeView to BookView and BookView to CodeView.

Whatever we are doing is causing a very very strange or borken hierachy to be produced from the javascript in BookView that is making CodeView barf when it tries to place the cursor there.

The backtrace:

Code:
Process:               Sigil [619]
Path:                  /Applications/Sigil.app/Contents/MacOS/Sigil
Identifier:            com.sigil-ebook.Sigil.app
Version:               0.9.9 (0.9.9)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Sigil [619]
User ID:               501

Date/Time:             2018-06-08 13:24:06.358 -0400
OS Version:            Mac OS X 10.13.5 (17F77)
Report Version:        12
Anonymous UUID:        33AB802F-5FDD-DD5B-7A74-A04E3340B88C


Time Awake Since Boot: 230 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       EXC_I386_GPFLT
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Segmentation fault: 11
Termination Reason:    Namespace SIGNAL, Code 0xb
Terminating Process:   exc handler [0]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.sigil-ebook.Sigil.app     	0x000000010cccd0db CodeViewEditor::ConvertHierarchyToCaretMove(QList<ViewEditor::ElementIndex> const&) const + 235
1   com.sigil-ebook.Sigil.app     	0x000000010cccd39f CodeViewEditor::ExecuteCaretUpdate(bool) + 143
2   com.sigil-ebook.Sigil.app     	0x000000010c9e4f22 FlowTab::CodeView() + 242
3   com.sigil-ebook.Sigil.app     	0x000000010c9e51ed FlowTab::SetViewState(MainWindow::ViewState) + 141
4   com.sigil-ebook.Sigil.app     	0x000000010cd14705 MainWindow::UpdateViewState(bool) + 149
5   com.sigil-ebook.Sigil.app     	0x000000010cd12b85 MainWindow::CodeView() + 37
6   org.qt-project.QtCore         	0x00000001109ebb4c QMetaObject::activate(QObject*, int, int, void**) + 3020
7   org.qt-project.QtWidgets      	0x000000010d43f3d7 QAction::activate(QAction::ActionEvent) + 263
8   org.qt-project.QtWidgets      	0x000000010d536d29 0x10d437000 + 1047849
9   org.qt-project.QtWidgets      	0x000000010d537dd0 QAbstractButton::mouseReleaseEvent(QMouseEvent*) + 272
10  org.qt-project.QtWidgets      	0x000000010d61219f QToolButton::mouseReleaseEvent(QMouseEvent*) + 15
11  org.qt-project.QtWidgets      	0x000000010d48a5d3 QWidget::event(QEvent*) + 1571
12  org.qt-project.QtWidgets      	0x000000010d537b20 QAbstractButton::event(QEvent*) + 160
13  org.qt-project.QtWidgets      	0x000000010d6127c5 QToolButton::event(QEvent*) + 325
14  org.qt-project.QtWidgets      	0x000000010d448a76 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 294
15  org.qt-project.QtWidgets      	0x000000010d44be73 QApplication::notify(QObject*, QEvent*) + 8339
16  org.qt-project.QtCore         	0x00000001109b5ce4 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 164
17  org.qt-project.QtWidgets      	0x000000010d44942a QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) + 970
18  org.qt-project.QtWidgets      	0x000000010d4ac852 0x10d437000 + 481362
19  org.qt-project.QtWidgets      	0x000000010d4ab82e 0x10d437000 + 477230
20  org.qt-project.QtWidgets      	0x000000010d448a76 QApplicationPrivate::notify_helper(QObject*, QEvent*) + 294
21  org.qt-project.QtWidgets      	0x000000010d449fd8 QApplication::notify(QObject*, QEvent*) + 504
22  org.qt-project.QtCore         	0x00000001109b5ce4 QCoreApplication::notifyInternal2(QObject*, QEvent*) + 164
23  org.qt-project.QtGui          	0x00000001101ff90d QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) + 2877
24  org.qt-project.QtGui          	0x00000001101e7a1b QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 203
25  libqcocoa.dylib               	0x000000011311bb51 0x1130f8000 + 146257
26  com.apple.CoreFoundation      	0x00007fff3fb21a61 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
27  com.apple.CoreFoundation      	0x00007fff3fbdb47c __CFRunLoopDoSource0 + 108
28  com.apple.CoreFoundation      	0x00007fff3fb044c0 __CFRunLoopDoSources0 + 208
29  com.apple.CoreFoundation      	0x00007fff3fb0393d __CFRunLoopRun + 1293
30  com.apple.CoreFoundation      	0x00007fff3fb031a3 CFRunLoopRunSpecific + 483
31  com.apple.HIToolbox           	0x00007fff3ede9d96 RunCurrentEventLoopInMode + 286
32  com.apple.HIToolbox           	0x00007fff3ede9a0f ReceiveNextEventCommon + 366
33  com.apple.HIToolbox           	0x00007fff3ede9884 _BlockUntilNextEventMatchingListInModeWithFilter + 64
34  com.apple.AppKit              	0x00007fff3d09ba73 _DPSNextEvent + 2085
35  com.apple.AppKit              	0x00007fff3d831e34 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
36  com.apple.AppKit              	0x00007fff3d090885 -[NSApplication run] + 764
37  libqcocoa.dylib               	0x000000011311aa5f 0x1130f8000 + 141919
38  org.qt-project.QtCore         	0x00000001109b1ea1 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 417
39  org.qt-project.QtCore         	0x00000001109b6355 QCoreApplication::exec() + 341
40  com.sigil-ebook.Sigil.app     	0x000000010c9dd257 main + 5735
41  libdyld.dylib                 	0x00007fff6790d015 start + 1
So I will take a closer look at just what hierarchy is being fetched from inside of Bookview to see wherre it is telling CodeView to go.


Quote:
Originally Posted by Doitsu View Post
On my Linux machine, the problem didn't occur with all books and also not always with the same book. Try the following:

1. Close Sigil then download and open this MR epub.
2. Click Yes when asked if you want to fix the files.
3. Click the Book View icon.
4. Select 02_pof-03-prol.xhtml.
5. Double-click "history," click the Italic button twice and then the Code View button.

If this doesn't crash Sigl, switch to Book View and repeat the last step. Usually this triggers the crash.
KevinH is online now   Reply With Quote