Bug 214918

Summary: devel/gdb: -batch mode with EOF from stdin makes gdb hang
Product: Ports & Packages Reporter: Tomi Ollila <tomi.ollila>
Component: Individual Port(s)Assignee: Tijl Coosemans <tijl>
Status: Closed FIXED    
Severity: Affects Only Me CC: luca.pizzamiglio
Priority: --- Flags: luca.pizzamiglio: maintainer-feedback+
Version: Latest   
Hardware: amd64   
OS: Any   
Bug Depends on: 214927    
Bug Blocks:    

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.