I found a simple way to crash gdb: $ /bin/gdb -nx /bin/gdb (gdb) start (gdb) p ({unsigned char[]}{0x17}) ../../gdb/gdbtypes.c:4641: 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)
*** Bug 21162 has been marked as a duplicate of this bug. ***
*** Bug 20760 has been marked as a duplicate of this bug. ***
*** Bug 25209 has been marked as a duplicate of this bug. ***
Sent a patch.
The master branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8e2da165187907a570a33eee7e56ce16fc597a40 commit 8e2da165187907a570a33eee7e56ce16fc597a40 Author: Tom Tromey <tom@tromey.com> Date: Sun Jun 5 11:28:10 2022 -0600 Fix assertion failure in copy_type PR exp/20630 points out a simple way to cause an assertion failure in copy_type -- but this was found in the wild a few times as well. copy_type only works for objfile-owned types, but there isn't a deep reason for this. This patch fixes the bug by updating copy_type to work for any sort of type. Better would perhaps be to finally implement type GC, but I still haven't attempted this. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=20630
Fixed.
*** Bug 30238 has been marked as a duplicate of this bug. ***