bind9/bin/check
Tony Finch 19970088fc Fix hang in named-compilezone | head
I was truncating zone files for experimental purposes when I found
that `named-compilezone | head` got stuck. The full command line that
exhibited the problem was:

	dig axfr dotat.at |
	named-compilezone -o /dev/stdout dotat.at /dev/stdin |
	head

This requires a large enough zone to exhibit the problem, more than
about 70000 bytes of plain text output from named-compilezone.
I was running the command on Debian Stretch amd64.

This was puzzling since it looked like something was suppressing the
SIGPIPE. I used `strace` to examine what was happening at the hang.
The program was just calling write() a lot to print the zone file, and
the last write() hanged until I sent it a SIGINT.

During some discussion with friends, Ian Jackson guessed that opening
/dev/stdout O_RDRW might be the problem, and after some tests we found
that this does in fact suppress SIGPIPE.

Since `named-compilezone` only needs to write to its output file, the
fix is to omit the stdio "+" update flag.

(cherry picked from commit a87ccea032)
2019-10-30 10:52:22 +11:00
..
win32 Make VS solution upgrading unnecessary 2019-09-27 09:16:02 +02:00
.gitignore added gitignore, removed cvsignore 2012-03-03 23:10:05 -08:00
check-tool.c Fix hang in named-compilezone | head 2019-10-30 10:52:22 +11:00
check-tool.h Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
Makefile.in add a search for GeoIP2 libraries in configure 2019-06-27 16:25:28 -07:00
named-checkconf.8 prep 9.13.6 2019-02-06 22:13:05 +00:00
named-checkconf.c Add -c to usage message for named-checkconf 2019-03-05 16:52:49 -08:00
named-checkconf.docbook update copyrights 2019-01-02 10:20:43 +11:00
named-checkconf.html prep 9.13.6 2019-02-06 22:13:05 +00:00
named-checkzone.8 prep 9.13.6 2019-02-06 22:13:05 +00:00
named-checkzone.c Hint the compiler with ISC_UNREACHABLE(); that code after INSIST(0); cannot be reached 2018-11-08 12:22:17 +07:00
named-checkzone.docbook update copyrights 2019-01-02 10:20:43 +11:00
named-checkzone.html prep 9.13.6 2019-02-06 22:13:05 +00:00