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

* [Bug gdb/27644] GDB crashes when memset() is called with "print" command
  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 ` 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
  2 siblings, 0 replies; 4+ messages in thread
From: fasching.a91 at gmail dot com @ 2021-03-24 14:47 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Alexander Fasching <fasching.a91 at gmail dot com> ---
Created attachment 13326
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13326&action=edit
core dump

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

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

* [Bug gdb/27644] GDB crashes when memset() is called with "print" command
  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
  2 siblings, 0 replies; 4+ messages in thread
From: fasching.a91 at gmail dot com @ 2021-03-24 14:54 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Alexander Fasching <fasching.a91 at gmail dot com> ---
Backtrace:

#0  0x00007fe8bf8203d7 in raise () from /lib64/libc.so.6
#1  0x00007fe8bf821ac8 in abort () from /lib64/libc.so.6
#2  0x0000000000705d36 in dump_core () at utils.c:204
#3  0x000000000070a465 in internal_vproblem(internal_problem *, const char *,
int, const char *, typedef __va_list_tag __va_list_tag *)
(problem=problem@entry=0xd023a0 <internal_error_problem>, file=<optimized out>,
line=732, fmt=<optimized out>, ap=ap@entry=0x7fff747c3fc8) at utils.c:414
#4  0x000000000070a659 in internal_verror (file=<optimized out>,
line=<optimized out>, fmt=<optimized out>, ap=ap@entry=0x7fff747c3fc8) at
utils.c:439
#5  0x0000000000801ea2 in internal_error (file=file@entry=0x8ebd28
"regcache.c", line=line@entry=732, fmt=fmt@entry=0x82fd23 "%s: Assertion `%s'
failed.") at errors.cc:55
#6  0x000000000065cd3a in readable_regcache::cooked_read_value (this=0x1b60370,
regnum=7) at regcache.c:732
#7  0x000000000068beae in sentinel_frame_prev_register (this_frame=<optimized
out>, this_prologue_cache=<optimized out>, regnum=<optimized out>) at
sentinel-frame.c:53
#8  0x000000000054f69e in frame_unwind_register_value
(next_frame=next_frame@entry=0x19871a0, regnum=regnum@entry=7) at frame.c:1281
#9  0x00000000005509e9 in frame_unwind_register_unsigned (next_frame=0x19871a0,
regnum=7) at frame.c:1370
#10 0x0000000000585e72 in call_function_by_hand_dummy (function=0x1bb59c0,
default_return_type=default_return_type@entry=0x1aa20c0, args=...,
dummy_dtor=dummy_dtor@entry=0x0, dummy_dtor_data=dummy_dtor_data@entry=0x0) at
infcall.c:846
#11 0x0000000000587b5f in call_function_by_hand (function=<optimized out>,
default_return_type=default_return_type@entry=0x1aa20c0, args=...) at
infcall.c:744
#12 0x00000000005375c2 in eval_call (noside=<optimized out>, nargs=3,
argvec=0x7fff747c44d0, function_name=<optimized out>,
default_return_type=0x1aa20c0, exp=<optimized out>, exp=<optimized out>) at
eval.c:828
#13 0x0000000000538bec in evaluate_funcall (expect_type=<optimized out>,
exp=0x1bb5760, pos=<optimized out>, noside=<optimized out>) at eval.c:1233
#14 0x000000000053ac65 in evaluate_subexp_standard
(expect_type=expect_type@entry=0x1aa20c0, exp=exp@entry=0x1bb5760,
pos=0x7fff747c4abc, noside=noside@entry=EVAL_NORMAL) at eval.c:1916
#15 0x00000000004889dd in evaluate_subexp_c (expect_type=0x1aa20c0,
exp=0x1bb5760, pos=0x7fff747c4abc, noside=EVAL_NORMAL) at c-lang.c:727
#16 0x00000000005376e8 in evaluate_subexp
(expect_type=expect_type@entry=0x1aa20c0, exp=exp@entry=0x1bb5760,
pos=pos@entry=0x7fff747c4abc, noside=noside@entry=EVAL_NORMAL) at eval.c:78
#17 0x00000000005387b0 in evaluate_subexp_for_cast (exp=exp@entry=0x1bb5760,
pos=pos@entry=0x7fff747c4abc, noside=noside@entry=EVAL_NORMAL,
to_type=0x1aa20c0) at eval.c:3333
#18 0x0000000000539fdb in evaluate_subexp_standard
(expect_type=expect_type@entry=0x0, exp=exp@entry=0x1bb5760,
pos=0x7fff747c4abc, noside=noside@entry=EVAL_NORMAL) at eval.c:2757
#19 0x00000000004889dd in evaluate_subexp_c (expect_type=0x0, exp=0x1bb5760,
pos=0x7fff747c4abc, noside=EVAL_NORMAL) at c-lang.c:727
#20 0x00000000005376e8 in evaluate_subexp (expect_type=expect_type@entry=0x0,
exp=0x1bb5760, pos=pos@entry=0x7fff747c4abc, noside=noside@entry=EVAL_NORMAL)
at eval.c:78
#21 0x0000000000537a5d in evaluate_expression (exp=<optimized out>) at
eval.c:138
#22 0x000000000061c57e in print_command_1 (args=0x1b5d682 "(void *)
memset((void *) 0, (int) 0, (unsigned long) 0)", voidprint=1) at
printcmd.c:1214
#23 0x0000000000499fcf in cmd_func (cmd=<optimized out>, args=<optimized out>,
from_tty=<optimized out>) at cli/cli-decode.c:2181
#24 0x00000000006edf69 in execute_command (p=<optimized out>, p@entry=0x1b5d680
"p (void *) memset((void *) 0, (int) 0, (unsigned long) 0)", from_tty=0) at
top.c:668
#25 0x000000000053ea74 in command_handler (command=0x1b5d680 "p (void *)
memset((void *) 0, (int) 0, (unsigned long) 0)") at event-top.c:588
#26 0x00000000006eeef6 in read_command_file (stream=stream@entry=0x1aa0800) at
top.c:447
#27 0x000000000049ffdc in script_from_file (stream=0x1aa0800, file=<optimized
out>) at cli/cli-script.c:1622
#28 0x00000000004972a8 in source_script_from_stream
(file_to_open=0x7fff747c5977 "commands.gdb", file=0x7fff747c5977
"commands.gdb", stream=0x1aa0800) at cli/cli-cmds.c:687
#29 source_script_with_search (file=0x7fff747c5977 "commands.gdb",
file@entry=<error reading variable: value has been optimized out>,
from_tty=<error reading variable: value has been optimized out>,
search_path=<error reading variable: value has been optimized out>) at
cli/cli-cmds.c:737
#30 0x00000000005d5240 in catch_command_errors (command=<optimized out>,
arg=<optimized out>, from_tty=<optimized out>) at main.c:457
#31 0x00000000005d66ac in captured_main_1
(context=context@entry=0x7fff747c4f50) at main.c:1215
#32 0x00000000005d6fdb in captured_main (data=data@entry=0x7fff747c4f50) at
main.c:1243
#33 gdb_main (args=args@entry=0x7fff747c4f70) at main.c:1268
#34 0x000000000040e2a5 in main (argc=<optimized out>, argv=<optimized out>) at
gdb.c:32

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

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

* [Bug gdb/27644] GDB crashes when memset() is called with "print" command
  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
  2 siblings, 0 replies; 4+ messages in thread
From: fasching.a91 at gmail dot com @ 2021-03-24 14:58 UTC (permalink / raw)
  To: gdb-prs

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

Alexander Fasching <fasching.a91 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fasching.a91 at gmail dot com

-- 
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).