Author: markj Date: Wed Aug 7 03:14:45 2019 New Revision: 350671 URL: https://svnweb.freebsd.org/changeset/base/350671
Log: readelf: Close input files when done with them. The low fd limit used by poudriere exposed an odd failure mode in cap_fileargs (used by readelf as of r350516). In particular, when the limit was hit, both the main process and casper service would block on their shared socket, waiting forever for the other to send a message. Reported by: zeising MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Aug 7 01:41:17 2019 (r350670) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Aug 7 03:14:45 2019 (r350671) @@ -7732,10 +7732,12 @@ main(int argc, char **argv) for (i = 0; i < argc; i++) { re->filename = argv[i]; fd = fileargs_open(fa, re->filename); - if (fd < 0) + if (fd < 0) { warn("open %s failed", re->filename); - else + } else { dump_object(re, fd); + close(fd); + } } exit(EXIT_SUCCESS); _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"