Skip to content

Commit b47a5f5

Browse files
committed
TASK-214337 additional debug
1 parent 99db8c3 commit b47a5f5

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

src/lgc.c

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,8 @@ static void tailq_abort(lua_State *L, const char *where, const char *what,
19901990
{
19911991
void *o_next = NULL, *o_prev = NULL, *o_owner = NULL, *o_owner_L = NULL;
19921992
void *p_next = NULL, *p_owner = NULL, *p_owner_L = NULL;
1993-
int tt = -1;
1993+
void *nn_next = NULL, *nn_prev = NULL, *nn_owner = NULL, *nn_owner_L = NULL;
1994+
int tt = -1, nn_tt = -1;
19941995
unsigned marked = 0, xref = 0, ref = 0;
19951996

19961997
if (o) {
@@ -2002,6 +2003,14 @@ static void tailq_abort(lua_State *L, const char *where, const char *what,
20022003
marked = o->marked;
20032004
xref = o->xref;
20042005
ref = o->ref;
2006+
if (o->allocd.tqe_next && !is_bad_gc_ptr((uintptr_t)o->allocd.tqe_next)) {
2007+
GCheader *nn = o->allocd.tqe_next;
2008+
nn_next = (void*)nn->allocd.tqe_next;
2009+
nn_prev = (void*)nn->allocd.tqe_prev;
2010+
nn_owner = (void*)nn->owner;
2011+
nn_owner_L = safe_deref_owner_L(nn_owner);
2012+
nn_tt = nn->tt;
2013+
}
20052014
}
20062015
if (prev) {
20072016
p_next = (void*)prev->allocd.tqe_next;
@@ -2013,12 +2022,14 @@ static void tailq_abort(lua_State *L, const char *where, const char *what,
20132022
" node=%p node.next=%p node.prev=%p"
20142023
" prev=%p prev.next=%p prev.owner=%p prev.owner->L=%p"
20152024
" node.owner=%p node.owner->L=%p"
2016-
" tt=%d marked=0x%x xref=%u ref=%u\n",
2025+
" tt=%d marked=0x%x xref=%u ref=%u"
2026+
" nn=%p nn.next=%p nn.prev=%p nn.owner=%p nn.owner->L=%p nn.tt=%d\n",
20172027
where, what, (void*)L, (void*)L->heap, count,
20182028
(void*)o, o_next, o_prev,
20192029
(void*)prev, p_next, p_owner, p_owner_L,
20202030
o_owner, o_owner_L,
2021-
tt, marked, xref, ref);
2031+
tt, marked, xref, ref,
2032+
o_next, nn_next, nn_prev, nn_owner, nn_owner_L, nn_tt);
20222033
abort();
20232034
}
20242035

0 commit comments

Comments
 (0)