diff options
author | dholland <dholland@pkgsrc.org> | 2022-05-15 01:56:24 +0000 |
---|---|---|
committer | dholland <dholland@pkgsrc.org> | 2022-05-15 01:56:24 +0000 |
commit | 645e9d741c73b60a16a1c051dca3b9e5df908a35 (patch) | |
tree | 69f82da1d9f0eae44f36aae4b7f2f5be6e8484c9 /lang | |
parent | 8ec59ce509269878b1452174b6969a4a8197fd55 (diff) | |
download | pkgsrc-645e9d741c73b60a16a1c051dca3b9e5df908a35.tar.gz |
lang/tcl-expect: add workaround for deadlock seen on Linux and Solaris
Closes PR 34442.
Diffstat (limited to 'lang')
-rw-r--r-- | lang/tcl-expect/Makefile | 4 | ||||
-rw-r--r-- | lang/tcl-expect/distinfo | 3 | ||||
-rw-r--r-- | lang/tcl-expect/patches/patch-exp__chan.c | 49 |
3 files changed, 53 insertions, 3 deletions
diff --git a/lang/tcl-expect/Makefile b/lang/tcl-expect/Makefile index 8f91b6c3b2c..da34a263ee3 100644 --- a/lang/tcl-expect/Makefile +++ b/lang/tcl-expect/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.34 2018/09/07 08:51:39 jperkin Exp $ +# $NetBSD: Makefile,v 1.35 2022/05/15 01:56:24 dholland Exp $ .include "Makefile.common" PKGNAME= tcl-expect-${EXPECT_VERSION} -PKGREVISION= 4 +PKGREVISION= 5 CATEGORIES= lang MAINTAINER= pkgsrc-users@NetBSD.org diff --git a/lang/tcl-expect/distinfo b/lang/tcl-expect/distinfo index 01f7900d122..113c22e1636 100644 --- a/lang/tcl-expect/distinfo +++ b/lang/tcl-expect/distinfo @@ -1,7 +1,8 @@ -$NetBSD: distinfo,v 1.22 2021/10/26 10:51:57 nia Exp $ +$NetBSD: distinfo,v 1.23 2022/05/15 01:56:24 dholland Exp $ BLAKE2s (expect5.45.tar.gz) = 38c440ed0868322b6ec7438decaa036a636e7d700191b754c1e4a7dc0fdd0c46 SHA512 (expect5.45.tar.gz) = be991c68241e607b3a689eae7e7966056dbfb577e857331d54a4911bd178c1816425217603b43918ad1b6d2e966271a0f01e79d7028a22e223562d59d10c8c51 Size (expect5.45.tar.gz) = 628808 bytes SHA1 (patch-Makefile.in) = 24efcbdb0a21985cb8a0fb7812c5f45f67de7c30 SHA1 (patch-configure) = a16c833e61d23f63abff1413522b99cd2251bc34 +SHA1 (patch-exp__chan.c) = 5af6bf31fa87a4d9951be6bc978ede5440380981 diff --git a/lang/tcl-expect/patches/patch-exp__chan.c b/lang/tcl-expect/patches/patch-exp__chan.c new file mode 100644 index 00000000000..44dd73d9241 --- /dev/null +++ b/lang/tcl-expect/patches/patch-exp__chan.c @@ -0,0 +1,49 @@ +$NetBSD: patch-exp__chan.c,v 1.1 2022/05/15 01:56:24 dholland Exp $ + +Add hack to work around deadlock situation that occurs on Solaris and +Linux. See PR 34442. + +The problem apparently does not occur on BSD, but it doesn't seem to +be clear why or whether that's really the case; the description of the +problem as far as it's understood seems to be portable. So don't +conditionalize it, as the check should be safe. If this turns out to +cause problems, we can wrap it in ifdefs. + +--- exp_chan.c.orig 2010-07-01 00:53:49.000000000 +0000 ++++ exp_chan.c +@@ -7,6 +7,7 @@ + */ + + #include <sys/types.h> ++#include <sys/poll.h> + #include <stdio.h> + #include <signal.h> + #include <errno.h> +@@ -205,6 +206,8 @@ ExpInputProc(instanceData, buf, toRead, + ExpState *esPtr = (ExpState *) instanceData; + int bytesRead; /* How many bytes were actually + * read from the input device? */ ++ struct pollfd fds[1]; ++ int pollResult; + + *errorCodePtr = 0; + +@@ -215,6 +218,18 @@ ExpInputProc(instanceData, buf, toRead, + * nonblocking, the read will never block. + */ + ++ /* Update: there isn't always, which can lead to hangs. See PR 34442. */ ++ fds[0].fd = esPtr->fdin; ++ fds[0].events = POLLIN | POLLERR | POLLHUP | POLLNVAL; ++ pollResult = poll(fds, 1, 0); ++ if (pollResult <= 0) { ++ *errorCodePtr = EWOULDBLOCK; ++ return -1; ++ } else if (fds[0].revents & (POLLERR | POLLHUP | POLLNVAL)) { ++ *errorCodePtr = EBADF; ++ return -1; ++ } ++ + bytesRead = read(esPtr->fdin, buf, (size_t) toRead); + /*printf("ExpInputProc: read(%d,,) = %d\r\n",esPtr->fdin,bytesRead);*/ + if (bytesRead > -1) { |