Bug 214918 - devel/gdb: -batch mode with EOF from stdin makes gdb hang
Summary: devel/gdb: -batch mode with EOF from stdin makes gdb hang
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Tijl Coosemans
URL:
Keywords:
Depends on: 214927
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-28 22:30 UTC by Tomi Ollila
Modified: 2016-12-18 16:12 UTC (History)
1 user (show)

See Also:
luca.pizzamiglio: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomi Ollila 2016-11-28 22:30:52 UTC
# /usr/local/bin/gdb --version | head -1
GNU gdb (GDB) 7.11.1 [GDB v7.11.1 for FreeBSD]
#

# /usr/local/bin/gdb -batch -ex run --args sleep 2 < /dev/null
quit
A debugging session is active.

	Inferior 1 [process 17087] will be killed.

Quit anyway? (y or n) [answered Y; input not from terminal]

--
e.g. hangs above. pkill -9 gdb stops it.

without < /dev/null (or running same on linux) yields:

# /usr/local/bin/gdb -batch -ex run --args sleep 2 
[Inferior 1 (process 17093) exited normally]
#
Comment 1 luca.pizzamiglio 2016-11-29 09:39:57 UTC
Hi Tomi,
thanks to reporting.

I can reproduce the problem.

I've repeated the test using the upcoming gdb 7.12 and it seems fixed.

I'm filling a PR and soon it will be available as package.