Bug 1429172 - GDB dumps core when escaping newline in multi line command
Summary: GDB dumps core when escaping newline in multi line command
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: 25
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1430469
TreeView+ depends on / blocked
 
Reported: 2017-03-05 10:32 UTC by Georg Sauthoff
Modified: 2017-03-10 15:21 UTC (History)
6 users (show)

Fixed In Version: gdb-7.12.1-47.fc25
Clone Of:
: 1430469 (view as bug list)
Environment:
Last Closed: 2017-03-10 15:21:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Sourceware 21218 0 None None None 2017-03-05 13:00:29 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.