Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1430469

Summary: GDB dumps core when escaping newline in multi line command
Product: Red Hat Developer Toolset Reporter: Jan Kratochvil <jan.kratochvil>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact: Michal Kolar <mkolar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: DTS 6.1 RHEL 7CC: bgollahe, extras-qa, gbenson, jan.kratochvil, kanderso, mcermak, mkolar, mnewsome, ohudlick, palves, pmuldoon, sergiodj
Target Milestone: alphaKeywords: Regression
Target Release: 6.1   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: devtoolset-6-gdb-7.12.1-47.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1429172 Environment:
Last Closed: 2017-04-26 10:11:53 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: 1429172    
Bug Blocks:    

Description Jan Kratochvil 2017-03-08 16:46:16 UTC
+++ 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)

Comment 6 errata-xmlrpc 2017-04-26 10:11:53 UTC
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