+++ This bug was initially created as a clone of Bug #1429172 +++
Description of problem:
GDB dumps core When escaping a newline with \ in a multiline command.
Version-Release number of selected component (if applicable):
gdb-7.12.1-46.fc25.x86_64
How reproducible:
always
Steps to Reproduce:
1. gdb
2. py
3. print(1);\\
4. print(2)
5. end
6. help
Actual results:
$ gdb
(gdb) py
>print(1);\
(gdb) print(2)
>end
1
2
help
readline: readline_callback_read_char() called with no handler!
zsh: abort (core dumped) gdb -q
Expected results:
No core dumping and just the normal (gdb) prompt after enterering the multiline command is finished (plus printing the help screen).
Additional info:
Entering the `help` command isn't significant - other commands reproduce this as well - even just hitting enter.
This can also reproduced with other multiline commands, e.g.:
$ gdb ls
Reading symbols from ls...Reading symbols from /usr/lib/debug/usr/bin/ls.debug...done.
done.
(gdb) b main
Breakpoint 1 at 0x3990: file ../src/ls.c, line 1347.
(gdb) commands
Type commands for breakpoint(s) 1, one per line.
End with a line saying just "end".
>silent
>print \
(gdb) argc
>end
readline: readline_callback_read_char() called with no handler!
zsh: abort (core dumped) gdb -q ls
Escaping newlines in single-line commands works as expected, e.g.:
$ gdb
(gdb) py print(1);\
print(2)
1
2
(gdb)
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2017:1151