Bug 1429172

Summary: GDB dumps core when escaping newline in multi line command
Product: [Fedora] Fedora Reporter: Georg Sauthoff <fedora>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: gbenson, jan.kratochvil, palves, pmuldoon, sergiodj, tom
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: gdb-7.12.1-47.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1430469 (view as bug list) Environment:
Last Closed: 2017-03-10 15:21:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1430469    

Description Georg Sauthoff 2017-03-05 10:32:58 UTC
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)

Comment 1 Fedora Update System 2017-03-08 19:53:52 UTC
gdb-7.12.1-47.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-928cceff95

Comment 2 Fedora Update System 2017-03-09 14:58:35 UTC
gdb-7.12.1-47.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-928cceff95

Comment 3 Fedora Update System 2017-03-10 15:21:50 UTC
gdb-7.12.1-47.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.