This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
x86_64-m32 internal error for multi-thread-step.exp [Re: [PATCH v10 06/28] btrace: change branch trace data structure]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Markus Metzger <markus dot t dot metzger at intel dot com>
- Cc: palves at redhat dot com, gdb-patches at sourceware dot org
- Date: Thu, 8 Jan 2015 21:49:43 +0100
- Subject: x86_64-m32 internal error for multi-thread-step.exp [Re: [PATCH v10 06/28] btrace: change branch trace data structure]
- Authentication-results: sourceware.org; auth=none
- References: <1389686678-9039-1-git-send-email-markus dot t dot metzger at intel dot com> <1389686678-9039-7-git-send-email-markus dot t dot metzger at intel dot com>
On Tue, 14 Jan 2014 09:04:16 +0100, Markus Metzger wrote:
[...]
> +/* Allocate and initialize a new branch trace function segment.
> + PREV is the chronologically preceding function segment.
> + MFUN and FUN are the symbol information we have for this function. */
> +
> +static struct btrace_function *
> +ftrace_new_function (struct btrace_function *prev,
> + struct minimal_symbol *mfun,
> + struct symbol *fun)
> +{
> + struct btrace_function *bfun;
> +
> + bfun = xzalloc (sizeof (*bfun));
> +
> + bfun->msym = mfun;
> + bfun->sym = fun;
> + bfun->flow.prev = prev;
> +
> + /* We start with the identities of min and max, respectively. */
> + bfun->lbegin = INT_MAX;
> + bfun->lend = INT_MIN;
>
> - if (filename == NULL)
> - filename = "";
> + if (prev != NULL)
> + {
> + gdb_assert (prev->flow.next == NULL);
(gdb) PASS: gdb.btrace/multi-thread-step.exp: navigate: thread 1: record goto begin
info record^M
Active record target: record-btrace^M
btrace.c:220: internal-error: ftrace_new_function: Assertion `prev->flow.next == NULL' failed.^M
This occasionally happens on x86_64 system with -m32 inferior:
runtest CC_FOR_TARGET="gcc -m32" CXX_FOR_TARGET="g++ -m32" gdb.btrace/multi-thread-step.exp
cpu family : 6
model : 63
model name : Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz
stepping : 2
microcode : 0x2a
> + prev->flow.next = bfun;
>
> - return (filename_cmp (bfile, filename) != 0);
> + bfun->number = prev->number + 1;
> + bfun->insn_offset = (prev->insn_offset
> + + VEC_length (btrace_insn_s, prev->insn));
> + }
> +
> + return bfun;
> }
Although for -m32 inferior there are 100% reproducible more FAILs:
FAIL: gdb.btrace/rn-dl-bind.exp: reverse-next
FAIL: gdb.btrace/rn-dl-bind.exp: reverse-step
FAIL: gdb.btrace/rn-dl-bind.exp: reverse-step
FAIL: gdb.btrace/rn-dl-bind.exp: reverse-next
FAIL: gdb.btrace/rn-dl-bind.exp: next (the program exited)
FAIL: gdb.btrace/exception.exp: flat (pattern 1)
FAIL: gdb.btrace/exception.exp: indented (pattern 1)
So I do not think the assert may be such a critical issue as IIUC btrace is
probably not used for 32-bit inferiors.
Regards,
Jan