pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/tcl-expect



Module Name:    pkgsrc
Committed By:   dholland
Date:           Sun May 15 01:56:24 UTC 2022

Modified Files:
        pkgsrc/lang/tcl-expect: Makefile distinfo
Added Files:
        pkgsrc/lang/tcl-expect/patches: patch-exp__chan.c

Log Message:
lang/tcl-expect: add workaround for deadlock seen on Linux and Solaris

Closes PR 34442.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 pkgsrc/lang/tcl-expect/Makefile
cvs rdiff -u -r1.22 -r1.23 pkgsrc/lang/tcl-expect/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/lang/tcl-expect/patches/patch-exp__chan.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/tcl-expect/Makefile
diff -u pkgsrc/lang/tcl-expect/Makefile:1.34 pkgsrc/lang/tcl-expect/Makefile:1.35
--- pkgsrc/lang/tcl-expect/Makefile:1.34        Fri Sep  7 08:51:39 2018
+++ pkgsrc/lang/tcl-expect/Makefile     Sun May 15 01:56:24 2022
@@ -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@localhost

Index: pkgsrc/lang/tcl-expect/distinfo
diff -u pkgsrc/lang/tcl-expect/distinfo:1.22 pkgsrc/lang/tcl-expect/distinfo:1.23
--- pkgsrc/lang/tcl-expect/distinfo:1.22        Tue Oct 26 10:51:57 2021
+++ pkgsrc/lang/tcl-expect/distinfo     Sun May 15 01:56:24 2022
@@ -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

Added files:

Index: pkgsrc/lang/tcl-expect/patches/patch-exp__chan.c
diff -u /dev/null pkgsrc/lang/tcl-expect/patches/patch-exp__chan.c:1.1
--- /dev/null   Sun May 15 01:56:24 2022
+++ pkgsrc/lang/tcl-expect/patches/patch-exp__chan.c    Sun May 15 01:56:24 2022
@@ -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) {



Home | Main Index | Thread Index | Old Index