public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/27644] New: GDB crashes when memset() is called with "print" command
@ 2021-03-24 14:42 fasching.a91 at gmail dot com
  2021-03-24 14:47 ` [Bug gdb/27644] " fasching.a91 at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: fasching.a91 at gmail dot com @ 2021-03-24 14:42 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 27644
           Summary: GDB crashes when memset() is called with "print"
                    command
           Product: gdb
           Version: 10.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: fasching.a91 at gmail dot com
  Target Milestone: ---

OS: Centos 7 Docker container on Arch Linux host
GDB: 10.1
GCC: 4.8.5 20150623 (Red Hat 4.8.5-44)
GLIBC: glibc-2.17-323.el7_9.x86_64
Kernel: 5.11.8-arch1-1

STEPS TO REPRODUCE
=======================================

1. Required files
---------------------------------------
$ cat program.c
int main(int argc, char **argv) {
    return 0;
}

$ cat commands.gdb
break main
run
p (void *) memset((void *) 0, (int) 0, (unsigned long) 0)


2. Compile the program and run GDB
---------------------------------------
$ gcc -g -o program program.c
$ gdb --batch -x commands.gdb program
Breakpoint 1 at 0x4004f8: file program.c, line 2.

Breakpoint 1, main (argc=1, argv=0x7ffc9b42c118) at program.c:2
2           return 0;
regcache.c:732: internal-error: value*
readable_regcache::cooked_read_value(int): Assertion `regnum <
m_descr->nr_cooked_registers' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) [answered Y; input not from terminal]

This is a bug, please report it.  For instructions, see:
<https://www.gnu.org/software/gdb/bugs/>.

regcache.c:732: internal-error: value*
readable_regcache::cooked_read_value(int): Assertion `regnum <
m_descr->nr_cooked_registers' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Create a core file of GDB? (y or n) [answered Y; input not from terminal]
Aborted (core dumped)
---------------------------------------

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-24 14:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24 14:42 [Bug gdb/27644] New: GDB crashes when memset() is called with "print" command fasching.a91 at gmail dot com
2021-03-24 14:47 ` [Bug gdb/27644] " fasching.a91 at gmail dot com
2021-03-24 14:54 ` fasching.a91 at gmail dot com
2021-03-24 14:58 ` fasching.a91 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).