Closed NiLuJe closed 2 years ago
I can provide the core-dump and matching Kobo build if necessary.
Similar bt from a live session, except we don't lose the LuaJIT magic bits ;p.
Program received signal SIGSEGV, Segmentation fault.
0x34589642 in ldomXPointer::getRect (this=this@entry=0x7e878820, rect=..., extended=<optimized out>, adjusted=adjusted@entry=false) at /var/tmp/niluje/Build_KO/koreader/base/thirdparty/kpvcrlib/crengine/crengine/src/lvtinydom.cpp:9634
9634 /var/tmp/niluje/Build_KO/koreader/base/thirdparty/kpvcrlib/crengine/crengine/src/lvtinydom.cpp: No such file or directory.
(gdb) bt full
#0 0x34589642 in ldomXPointer::getRect (this=this@entry=0x7e878820, rect=..., extended=<optimized out>, adjusted=adjusted@entry=false) at /var/tmp/niluje/Build_KO/koreader/base/thirdparty/kpvcrlib/crengine/crengine/src/lvtinydom.cpp:9634
w = {61192, 15329, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 2, 0, 16, 0, 34148, 32391, 0, 0, 515, 0, 33504, 32391, 41821, 13398, 0, 0, 24, 73, 33520, 32391, 24576, 10959, 0, 0, 0, 0, 2, 0, 6288, 15330, 33544, 32391, 12048, 15330, 12312, 15330, 10, 0, 7248, 15330, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
0, 2, 0, 6, 0, 0, 0, 11, 0, 26608, 11258, 33640, 32391, 6329, 2, 32766, 0, 2048, 0, 33692, 32391, 33692, 32391, 41912, 10959, 33664, 32391, 0, 0, 33692, 32391, 41912, 10959, 33680, 32391, 0, 0, 12, 22, 0, 0, 12, 22, 33704, 32391, 9, 0, 0, 0, 12, 22, 33720, 32391, 41821, 13398, 0, 0, 64400, 72, 33736, 32391, 52377, 13398, 64400, 72, 12312, 15330,
24, 0, 24, 0, 41464, 10959, 62431, 1, 33768, 32391, 62459, 1, 33776, 32391, 2011, 2, 24, 0, 1, 0, 52712, 11150, 3, 0, 33808, 32391, 0, 0, 0, 0, 25955, 3, 4180, 10957, 10, 0, 0, 0, 41624, 10959, 28, 0, 1, 0, 52712, 11150, 41416, 10959...}
flg = "\000`\317*\002\000\000\000\220\373H\000\220&\342;\270\200\207~\274g\317*\b\000\000\000\274g\317*\b\000\000\000\001\000\000\000\000\201\207~\001\000\000\000\000\000\000\000ȁ\207~\374\200\207~\260:\302*\002\000\000\000\000\000\000\000\002\000\000\000L\201\207~|\000\000\000w\000\000\000n\000\000\000[\000\000\000:", '\000' <repeats 19 times>, "\002\000\000\000\021\000\000\000\200\000\000\000\000`\317*\021\000\000\000T\020\315*(b\317*\314\032y4\000\000\000\000\000\020x4\274g\317*\200\000\000\000\000\000\000\000\220\201\207~\b\000\000\000\001\000\000\000\060\000I\000|\201\207~\260:\302*@1\342;\000\000\000\000\000\000\000\000"...
str = {pchunk = 0x2a97a8, static EMPTY_STR_32 = 0x34791acc <empty_chunk_32>, static empty_str = {pchunk = 0x34791acc <empty_chunk_32>, static EMPTY_STR_32 = 0x34791acc <empty_chunk_32>, static empty_str = <same as static member of an already seen type>}}
chx = <optimized out>
font = 0x40100 <lj_cf_ffi_cast+64>
hints = 0
word = 0x42eac0
word_is_rtl = <optimized out>
lastWord = false
w = <optimized out>
frmline = 0x42ea88
line_is_bidi = false
l = <optimized out>
fmt = {<lvdomElementFormatRec> = {_y = 1273, _height = 1005, _x = 0, _width = 1050, _inner_width = 1050, _inner_x = 0, _inner_y = 0, _baseline = 0, _usable_left_overflow = 15, _usable_right_overflow = 15, _top_overflow = 0, _bottom_overflow = 0, _lang_node_idx = 2241, _flags = 40, _extra0 = 0, _extra1 = 0, _extra2 = 0, _extra3 = 0, _extra4 = 0,
_extra5 = 0, _listprop_node_idx = 0}, _node = 0x490030, _modified = false, _dirty = false}
inner_width = <optimized out>
xp = {<ldomXPointer> = {_data = 0x3be218b0}, _indexes = {0, 0, 6, 0, 0, 0, 2, 1, 3, 4870664, 726639851, 2, 1, 852844520, 9411976, 2122809328, 726640423, 2, 0, 0, 2122809336, 2122811332, 0, 124, 119, 110, 91, 56, 0, 0, 0, 0, 0, 3, 16, 718233600, 3, 718082132, 718234152, 70, 878124053, 880283648, 718235580, 16, 761, 2122809496, 880283648, 1,
718233600, 2122809476, 0, 852839984, 0, 0, 1441804, 0, 1441804, 2122809480, 878093149, 0, 1441804, 2, 8, 2}, _level = 9}
bestBidiRect = {left = 0, top = 0, right = 0, bottom = 0}
rc = {left = 6, top = 8993, right = 1056, bottom = 9998}
srcLen = 1005
lastOffset = <optimized out>
nearestForwardSrcIndex = <optimized out>
hasBestBidiRect = 26
node = 0x0
srcIndex = <optimized out>
lastLen = <optimized out>
txtform = {_ptr = 0x796748}
offset = 983055
lastIndex = <optimized out>
nearestForwardSrcOffset = 68812800
p = <optimized out>
p0 = <optimized out>
finalNode = <optimized out>
doc = <optimized out>
mainNode = <optimized out>
#1 0x345898e4 in ldomXPointer::toPoint (this=this@entry=0x7e878820, extended=extended@entry=true) at /var/tmp/niluje/Build_KO/koreader/base/thirdparty/kpvcrlib/crengine/crengine/src/lvtinydom.cpp:9138
rc = {left = 0, top = 0, right = 0, bottom = 0}
#2 0x344760be in getPosFromXPointer (L=0x2acfa1c8) at cre.cpp:901
xpe = {<ldomXPointer> = {_data = 0x3be23140}, _indexes = {0, 0, 6, 0, 0, 0, 2, 1, 3, 3, 9, 0, 8192, 0, 1092776962, 153, 2122811244, 153, 718236704, 76, 76, 718250488, 127967, 2122811248, 127995, 92, 92, 718250488, 127967, 2122811272, 127995, 2122811280, 133083, 92, 0, 0, 1092776962, 0, 1076887552, 729766732, 150429, 0, 739584432, 833528482,
2122811352, 71, 731926536, 56, 718250488, 56, 127967, 2122811360, 127995, 2122811368, 199221, 2040, 2122811376, -12, 2040, 734632216, 1, 2122811408, 242605, 729824720}, _level = 9}
pt = {x = 718071856, y = 718090344}
doc = <optimized out>
xpointer_str = <optimized out>
--Type <RET> for more, q to quit, c to continue without paging--c
y = 0
x = 0
xp = {_data = 0x3be23128}
#3 0x00052710 in lj_BC_FUNCC () at buildvm_arm.dasc:928
No locals.
#4 0x0004b66a in lua_pcall (L=L@entry=0x2acfa1c8, nargs=nargs@entry=0, nresults=-1, errfunc=errfunc@entry=2) at lj_api.c:1145
g = 0x2acfa1f8
oldh = 0 '\000'
ef = <optimized out>
status = <optimized out>
#5 0x00013936 in docall (L=L@entry=0x2acfa1c8, narg=narg@entry=0, clear=clear@entry=0) at luajit.c:122
status = <optimized out>
base = 2
#6 0x00013f4a in handle_script (L=L@entry=0x2acfa1c8, argx=argx@entry=0x7e878b28) at luajit.c:292
narg = 0
status = <optimized out>
fname = <optimized out>
#7 0x00014486 in pmain (L=0x2acfa1c8) at luajit.c:550
s = 0x6b1bc <smain>
argv = 0x7e878b24
argn = 1
flags = 0
#8 0x00052710 in lj_BC_FUNCC () at buildvm_arm.dasc:928
No locals.
#9 0x0004b74e in lua_cpcall (L=L@entry=0x2acfa1c8, func=<optimized out>, ud=ud@entry=0x0) at lj_api.c:1173
g = 0x2acfa1f8
oldh = 0 '\000'
status = <optimized out>
#10 0x00014520 in main (argc=2, argv=0x7e878b24) at luajit.c:581
status = <optimized out>
L = 0x2acfa1c8
Thanks.
I couldn't reproduce it by following your steps, changing font size to get xrkvc
near the top...
But I can if I tap on the footnote link (or follow it with a swipe) on that second page.
Will investigate.
(Same backtrace as you - so, no need for more info :)
Glad you figured it out. :-)
Good news is that it seems caused by something recent :) and the footnote link having some left margin (.apnb { margin: 0 0 0 0.2em }
) and my added support for that in https://github.com/koreader/crengine/pull/477, and my:
https://github.com/koreader/crengine/blob/de482f93541f50509ba1d76fd3145ccdaf37e60a/crengine/src/lvtinydom.cpp#L9567
being proved wrong :|
Couldn't reproduce a crash in RTL text... Anyway, should be solved by skipping such "words" early:
--- a/crengine/src/lvtinydom.cpp
+++ b/crengine/src/lvtinydom.cpp
@@ -9336,6 +9336,11 @@ bool ldomXPointer::getRect(lvRect & rect, bool extended, bool adjusted) const
bool line_is_bidi = frmline->flags & LTEXT_LINE_IS_BIDI;
for ( int w=0; w<(int)frmline->word_count; w++ ) {
const formatted_word_t * word = &frmline->words[w];
+ if (word->flags & LTEXT_WORD_IS_PAD ) {
+ // Skip these as they are virtual and don't map to real nodes
+ // text indices: they won't be part of any rect
+ continue;
+ }
bool word_is_rtl = word->flags & LTEXT_WORD_DIRECTION_IS_RTL;
bool lastWord = (l == txtform->GetLineCount() - 1
&& w == frmline->word_count - 1);
c.f., https://www.mobileread.com/forums/showthread.php?t=347071 for the test-case (in my case, paging back from the top of the second page (specifically, on
xkrvc
) after the mentioned chapter did the trick).