This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patchv2] compile: Fix crash on cv-qualified self-reference
- From: Pedro Alves <palves at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>, gdb-patches at sourceware dot org
- Cc: Phil Muldoon <pmuldoon at redhat dot com>
- Date: Wed, 01 Jul 2015 11:32:16 +0100
- Subject: Re: [patchv2] compile: Fix crash on cv-qualified self-reference
- Authentication-results: sourceware.org; auth=none
- References: <20150418172843 dot GA17777 at host1 dot jankratochvil dot net> <20150516132555 dot GB17266 at host1 dot jankratochvil dot net>
On 05/16/2015 02:25 PM, Jan Kratochvil wrote:
> On Sat, 18 Apr 2015 19:28:43 +0200, Jan Kratochvil wrote:
> Hi,
>
> with this modified testcase GDB would:
>
> compile code struct_object.selffield = &struct_object
> ./compile/compile-c-types.c:83: internal-error: insert_type: Assertion `add == NULL || add->gcc_type == gcc_type' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Quit this debugging session? (y or n) FAIL: gdb.compile/compile.exp: compile code struct_object.selffield = &struct_object (GDB internal error)
>
> While the insert_type() assertion looks unclear trying to fix it one ends up
> with either GCC crash
> [gcc libcc1] build_qualified_type for self-referencing/incomplete types
> https://gcc.gnu.org/ml/gcc/2015-04/msg00108.html
> c_incomplete_type_error()
> or after fixing up the GCC type for proper error reporting one gets:
> gdb command line:1:1: error: invalid use of incomplete typedef ‘sv’
> which is the real culprit of this bug as explained in this patch.
>
> This patch is related to the XFAIL introduced by
> [PATCH v3 5/9] compile: Use -Wall, not -w
> https://sourceware.org/ml/gdb-patches/2015-04/msg00429.html
> as for proper -Wall happiness the 'volatile' qualifier needs to be added there
> - but adding the qualifier has caused this crash.
>
> No regressions on {x86_64,x86_64-m32,i686}-fedora23pre-linux-gnu.
OK. Sorry for the delay.
Thanks,
Pedro Alves