This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/20760] New: Crash when casting variable to char[][] type


https://sourceware.org/bugzilla/show_bug.cgi?id=20760

            Bug ID: 20760
           Summary: Crash when casting variable to char[][] type
           Product: gdb
           Version: 7.12.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: rikard.falkeborn at gmail dot com
  Target Milestone: ---

GDB crashes when trying to print a variable as (char[][]) (and int[][], didn't
try any others). The cast may be bogus, but GDB shouldn't crash. See below for
a minimal example. GCC 6.2.1 was used to build the test case.

$ cat cast-crash.c 
int main(int argc, char *argv[])
{
    return 0;
}

$ gcc -g cast-crash.c 
$ gdb ./a.out
(gdb) break main
(gdb) run
Starting program: /home/rikard/code/test/a.out 

Breakpoint 1, main (argc=1, argv=0x7fffffffe998) at cast-crash.c:3
3           return 0;
(gdb) print (char[][]) argc
$1 = 
gdbtypes.c:4610: internal-error: type* copy_type(const 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)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]