Binutils with MCST patches
Go to file
Pedro Alves 1d2736d43b Fix PR 19494: hang when killing unfollowed fork children
linux_nat_kill relies on get_last_target_status to determine whether
the current inferior is stopped at a unfollowed fork/vfork event.
This is bad because many things can happen ever since we caught the
fork/vfork event...  This commit rewrites that code to instead walk
the thread list looking for unfollowed fork events, similarly to what
was done for remote.c.

New test included.  The main idea of the test is make sure that when
the program stops for a fork catchpoint, and the user kills the
parent, gdb also kills the unfollowed fork child.  Since the child
hasn't been added as an inferior at that point, we need some other
portable way to detect that the child is gone.  The test uses a pipe
for that.  The program forks twice, so you have grandparent, child and
grandchild.  The grandchild inherits the write side of the pipe.  The
grandparent hangs reading from the pipe, since nothing ever writes to
it.  If, when GDB kills the child, it also kills the grandchild, then
the grandparent's pipe read returns 0/EOF and the test passes.
Otherwise, if GDB doesn't kill the grandchild, then the pipe read
never returns and the test times out, like:

 FAIL: gdb.base/catch-fork-kill.exp: fork-kind=fork: exit-kind=kill: fork: kill parent (timeout)
 FAIL: gdb.base/catch-fork-kill.exp: fork-kind=vfork: exit-kind=kill: vfork: kill parent (timeout)

No regressions on x86_64 Fedora 20.  New test passes with gdbserver as
well.

gdb/ChangeLog:
2016-01-25  Pedro Alves  <palves@redhat.com>

	PR gdb/19494
	* linux-nat.c (kill_one_lwp): New, factored out from ...
	(kill_callback): ... this.
	(kill_wait_callback): New, factored out from ...
	(kill_wait_one_lwp): ... this.
	(kill_unfollowed_fork_children): New function.
	(linux_nat_kill): Use it.

gdb/testsuite/ChangeLog:
2016-01-25  Pedro Alves  <palves@redhat.com>

	PR gdb/19494
	* gdb.base/catch-fork-kill.c: New file.
	* gdb.base/catch-fork-kill.exp: New file.
2016-01-25 13:16:43 +00:00
bfd Add missing end-of-comment marker to previous delta. (Doh!) 2016-01-25 09:44:18 +00:00
binutils Fix dlltool tests for ARM targets, which do not support the --leading-underscore option. 2016-01-20 14:52:33 +00:00
config Provide AC_PROG_LEX that copes with LEX=missing from top-level 2016-01-18 22:17:57 +10:30
cpu Remove leading/trailing white spaces in ChangeLog 2015-07-24 04:16:47 -07:00
elfcpp Remove typename from Mips64_rela_data 2016-01-12 12:08:06 -08:00
etc PR external/{16327,16328}: Remove etc/configure.texi and etc/standards.texi. 2014-06-27 11:33:25 +02:00
gas Fix gas testsuite failures for ARM netbesdelf configuration. 2016-01-21 14:39:34 +00:00
gdb Fix PR 19494: hang when killing unfollowed fork children 2016-01-25 13:16:43 +00:00
gold [gold][aarch64] PR gold/19472 - DSOs need pc-relative stubs. 2016-01-15 17:10:04 -08:00
gprof Regen configure 2016-01-17 12:28:14 +10:30
include Add support to readelf for reading FreeBSD ELF core notes. 2016-01-19 08:15:08 -08:00
intl Regen intl/configure 2015-08-31 12:53:36 +09:30
ld Fix linker testsuite failures for ARM netbsdelf target. 2016-01-21 15:20:57 +00:00
libdecnumber Remove leading/trailing white spaces in ChangeLog 2015-07-24 04:16:47 -07:00
libiberty libiberty: {count,dup,write}argv: constify argv input slightly 2016-01-05 15:25:13 -05:00
opcodes [AArch64] Reject invalid immediate operands to MSR UAO 2016-01-20 14:25:46 +00:00
readline Revert "Sync readline/ to version 7.0 alpha" 2015-07-25 15:57:00 -04:00
sim MIPS: Only build microMIPS specific simulator functions if microMIPS support is required. 2016-01-18 21:50:00 +00:00
texinfo * texinfo/texinfo.tex: Update to version 2009-03-28.05. 2009-04-21 12:36:46 +00:00
zlib Import zlib 1.2.8 with local change merged in. 2015-11-25 15:14:47 -08:00
.cvsignore
.gitattributes Add a .gitattributes file for use with git-merge-changelog 2014-07-25 18:07:23 -04:00
.gitignore Import changes made to files shared with the FSF GCC project. 2016-01-11 11:06:56 +00:00
COPYING
COPYING.LIB
COPYING.LIBGLOSS 2013-01-07 Jeff Johnston <jjohnstn@redhat.com> 2013-01-07 21:39:26 +00:00
COPYING.NEWLIB 2013-10-01 Jeff Johnston <jjohnstn@redhat.com> 2013-10-01 18:14:04 +00:00
COPYING3
COPYING3.LIB
ChangeLog Sync top-level btool.m4 with GCC 2016-01-12 08:44:52 -08:00
MAINTAINERS Update description of ownership of files in include/ 2014-11-04 16:14:14 -08:00
Makefile.def Sync top-level Makefile.def with GCC 2016-01-12 08:34:40 -08:00
Makefile.in Sync top-level Makefile.def with GCC 2016-01-12 08:34:40 -08:00
Makefile.tpl Import changes made to files shared with the FSF GCC project. 2016-01-11 11:06:56 +00:00
README
README-maintainer-mode
compile Update from upstream Automake 2014-11-16 13:43:48 +01:00
config-ml.in Sync toplevel files with GCC 2015-07-27 07:49:05 -07:00
config.guess Import changes made to files shared with the FSF GCC project. 2016-01-11 11:06:56 +00:00
config.rpath Remove freebsd1 from libtool.m4 macros and config.rpath. 2011-02-13 21:00:14 +00:00
config.sub Import changes made to files shared with the FSF GCC project. 2016-01-11 11:06:56 +00:00
configure Import changes made to files shared with the FSF GCC project. 2016-01-11 11:06:56 +00:00
configure.ac Import changes made to files shared with the FSF GCC project. 2016-01-11 11:06:56 +00:00
depcomp Update from upstream Automake 2014-11-16 13:43:48 +01:00
djunpack.bat
install-sh Update from upstream Automake 2014-11-16 13:43:48 +01:00
libtool.m4 Sync top-level btool.m4 with GCC 2016-01-12 08:44:52 -08:00
ltgcc.m4
ltmain.sh PR target/59788 2014-02-06 11:01:57 +01:00
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
makefile.vms
missing Update from upstream Automake 2014-11-16 13:43:48 +01:00
mkdep
mkinstalldirs Update from upstream Automake 2014-11-16 13:43:48 +01:00
move-if-change Update `move-if-change' from gnulib 2014-11-16 17:04:02 +01:00
setup.com
src-release.sh fix gdb version parsing in src-release.sh 2016-01-17 10:01:55 +04:00
symlink-tree
ylwrap Update from upstream Automake 2014-11-16 13:43:48 +01:00

README

		   README for GNU development tools

This directory contains various GNU compilers, assemblers, linkers, 
debuggers, etc., plus their support routines, definitions, and documentation.

If you are receiving this as part of a GDB release, see the file gdb/README.
If with a binutils release, see binutils/README;  if with a libg++ release,
see libg++/README, etc.  That'll give you info about this
package -- supported targets, how to use it, how to report bugs, etc.

It is now possible to automatically configure and build a variety of
tools with one command.  To build all of the tools contained herein,
run the ``configure'' script here, e.g.:

	./configure 
	make

To install them (by default in /usr/local/bin, /usr/local/lib, etc),
then do:
	make install

(If the configure script can't determine your type of computer, give it
the name as an argument, for instance ``./configure sun4''.  You can
use the script ``config.sub'' to test whether a name is recognized; if
it is, config.sub translates it to a triplet specifying CPU, vendor,
and OS.)

If you have more than one compiler on your system, it is often best to
explicitly set CC in the environment before running configure, and to
also set CC when running make.  For example (assuming sh/bash/ksh):

	CC=gcc ./configure
	make

A similar example using csh:

	setenv CC gcc
	./configure
	make

Much of the code and documentation enclosed is copyright by
the Free Software Foundation, Inc.  See the file COPYING or
COPYING.LIB in the various directories, for a description of the
GNU General Public License terms under which you can copy the files.

REPORTING BUGS: Again, see gdb/README, binutils/README, etc., for info
on where and how to report problems.