[ This might be a duplicate of PR25102. ] Consider the patch here ( https://src.fedoraproject.org/rpms/gdb/blob/master/f/gdb-archer-vla-tests.patch ). It contains a test-case gdb.pascal/arrays.exp. When running the test-case, we run into: ... FAIL: gdb.pascal/arrays.exp: Print dynamic array of string (GDB internal error) ... In more detail: ... (gdb) print DynArrStr^M $8 = {'X!ú÷ÿ'#127#0#0#24'"ú÷', 'ÿ'#127#0#0#152'"ú÷ÿ'#127#0, #24'#ú÷ÿ'#127#0#0#152'#ú÷', 'ÿ'#127#0#0#24'$ú÷ÿ'#127#0, #152'$ú÷ÿ'#127#0#0#24'%ú÷', 'ÿ'#127#0#0#152'%ú÷ÿ'#127#0, #24'&ú÷ÿ'#127#0#0#152'&ú÷', /data/gdb_versions/devel/src/gdb/value.c:849: internal-error: bool value_contents_bits_eq(const value*, int, const value*, int, int): Assertion `offset2 + length <= TYPE_LENGTH (val2->enclosing_type) * TARGET_CHAR_BIT' failed.^M ... To reproduce on the command line: ... $ gdb -batch outputs/gdb.pascal/arrays/arrays -ex "b 81" -ex r -ex "print DynArrStr" ... Values causing assert to trigger: ... (gdb) p offset2 $9 = 768 (gdb) p length $10 = 96 (gdb) p offset2 + length $11 = 864 (gdb) p val2->enclosing_type.length * 8 $12 = 832 ... Backtrace: ... (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 #1 0x00007ffff4f60b01 in __GI_abort () at abort.c:79 #2 0x00000000009a8e2a in dump_core () at src/gdb/utils.c:204 #3 0x00000000009a933c in internal_vproblem(internal_problem *, const char *, int, const char *, typedef __va_list_tag __va_list_tag *) (problem=0x1214080 <internal_error_problem>, file=0xca1ff8 "src/gdb/value.c", line=849, fmt=0xca1f8b "%s: Assertion `%s' failed.", ap=0x7fffffffcd68) at src/gdb/utils.c:414 #4 0x00000000009a9404 in internal_verror (file=0xca1ff8 "src/gdb/value.c", line=849, fmt=0xca1f8b "%s: Assertion `%s' failed.", ap=0x7fffffffcd68) at src/gdb/utils.c:439 #5 0x0000000000b202c9 in internal_error (file=0xca1ff8 "src/gdb/value.c", line=849, fmt=0xca1f8b "%s: Assertion `%s' failed.") at src/gdbsupport/errors.cc:55 #6 0x00000000009ca2c2 in value_contents_bits_eq (val1=0x1bb5540, offset1=672, val2=0x1bb5540, offset2=768, length=96) at src/gdb/value.c:849 #7 0x00000000009ca4fb in value_contents_eq (val1=0x1bb5540, offset1=84, val2=0x1bb5540, offset2=96, length=12) at src/gdb/value.c:901 #8 0x00000000009c409c in value_print_array_elements (val=0x1bb5540, stream=0x1a75180, recurse=0, options=0x7fffffffd1a0, i=7) at src/gdb/valprint.c:1933 #9 0x00000000007c9dc1 in pascal_value_print_inner (val=0x1bb5540, stream=0x1a75180, recurse=0, options=0x7fffffffd1a0) at src/gdb/p-valprint.c:137 #10 0x00000000009c2214 in do_val_print (value=0x1bb5540, stream=0x1a75180, recurse=0, options=0x7fffffffd2b0, language=0x123c5a0 <pascal_language_defn>) at src/gdb/valprint.c:982 #11 0x00000000009c25d0 in common_val_print (val=0x1bb5540, stream=0x1a75180, recurse=0, options=0x7fffffffd2b0, language=0x123c5a0 <pascal_language_defn>) at src/gdb/valprint.c:1085 #12 0x00000000007caaa5 in pascal_value_print (val=0x1bb5540, stream=0x1a75180, options=0x7fffffffd430) at src/gdb/p-valprint.c:437 #13 0x00000000009c26de in value_print (val=0x1bb5540, stream=0x1a75180, options=0x7fffffffd430) at src/gdb/valprint.c:1123 #14 0x00000000007cf65a in print_formatted (val=0x1bb5540, size=0, options=0x7fffffffd430, stream=0x1a75180) at src/gdb/printcmd.c:320 #15 0x00000000007d1553 in print_value (val=0x1bb5540, opts=...) at src/gdb/printcmd.c:1188 #16 0x00000000007d16bb in print_command_1 (args=0x7fffffffe0df "DynArrStr", voidprint=1) at src/gdb/printcmd.c:1222 #17 0x00000000007d179c in print_command (exp=0x7fffffffe0df "DynArrStr", from_tty=0) at src/gdb/printcmd.c:1244 #18 0x0000000000502956 in do_const_cfunc (c=0x1a022f0, args=0x7fffffffe0df "DynArrStr", from_tty=0) at src/gdb/cli/cli-decode.c:95 #19 0x0000000000505c38 in cmd_func (cmd=0x1a022f0, args=0x7fffffffe0df "DynArrStr", from_tty=0) at src/gdb/cli/cli-decode.c:2113 #20 0x0000000000934f79 in execute_command (p=0x7fffffffe0e7 "r", from_tty=0) at src/gdb/top.c:655 #21 0x0000000000755dbb in catch_command_errors (command=0x934b09 <execute_command(char const*, int)>, arg=0x7fffffffe0d9 "print DynArrStr", from_tty=0) at src/gdb/main.c:457 #22 0x000000000075719c in captured_main_1 (context=0x7fffffffd9d0) at src/gdb/main.c:1219 #23 0x0000000000757391 in captured_main (data=0x7fffffffd9d0) at src/gdb/main.c:1244 #24 0x00000000007573fc in gdb_main (args=0x7fffffffd9d0) at src/gdb/main.c:1269 #25 0x00000000004150b9 in main (argc=14, argv=0x7fffffffdad8) at src/gdb/gdb.c:32 ...
Since the problem is triggered by a test-case in the fedora patch set, is there a patch in there that is supposed to fix this?
Please see the comment I just added to 25102.
Note that apart from the internal error, it looks like we're also triggering PR26855.
Dup. *** This bug has been marked as a duplicate of bug 21356 ***