GDB crashes with internal error when trying to evaluate the following expression: (gdb) p ((char*)(short[]){1})[1] /home/arnez/src/binutils-gdb/gdb/gdbtypes.c:4722: internal-error: type* copy_type(const type*): Assertion `TYPE_OBJFILE_OWNED (type)' failed.
Is this a regression compared to 7.12?
(In reply to Joel Brobecker from comment #1) > Is this a regression compared to 7.12? No, 7.12.1 and 7.11.1 fails too. (gdb) run Starting program: /home/qiyao/source/gdb-7.11/build-7.11.1/gdb/gdb Breakpoint 1, main (argc=1, argv=0x7fffffffe648) at ../../gdb-7.11.1/gdb/gdb.c:25 25 { (gdb) p ((char*)(short[]){1})[1] Python Exception <type 'exceptions.NameError'> Installation error: gdb.execute_unwinders function is missing: ../../gdb-7.11.1/gdb/gdbtypes.c:4575: internal-error: copy_type: Assertion `TYPE_OBJFILE_OWNED (type)' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n)
Thanks for confirming, Yao. So this PR should not be blocking for 8.0, and I will remove the target milestone. Of course, we still have plenty of time until branching and eventually release, so if it gets fixed by then, all the better!
This problem was introduced in April 2014 with GIT commit 80180f796d366d230822c07a15aa68971abf9d77 -- "type: add c99 variable length array support" (https://sourceware.org/ml/gdb-patches/2014-04/msg00160.html).
Created attachment 9832 [details] Test case for internal error with unbounded array typecast
I think this is a duplicate of PR20630.
Dup. *** This bug has been marked as a duplicate of bug 20630 ***