Bugzilla – Attachment 1587 Details for
Bug 1517
ssh ControlMaster process is crashing frequently when multiplexing ssh and scp connections with error 'select: Invalid argument'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
debug wrapper for select()
client-debug-select.diff (text/plain), 3.03 KB, created by
Damien Miller
on 2008-12-08 10:55:28 AEDT
(
hide
)
Description:
debug wrapper for select()
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2008-12-08 10:55:28 AEDT
Size:
3.03 KB
patch
obsolete
>Index: clientloop.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/clientloop.c,v >retrieving revision 1.205 >diff -u -p -r1.205 clientloop.c >--- clientloop.c 2 Dec 2008 19:01:07 -0000 1.205 >+++ clientloop.c 7 Dec 2008 23:53:11 -0000 >@@ -566,7 +566,7 @@ client_wait_until_can_do_something(fd_se > tv.tv_usec = 0; > tvp = &tv; > } >- ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp); >+ ret = debug_select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp); > if (ret < 0) { > char buf[100]; > >Index: misc.c >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/misc.c,v >retrieving revision 1.69 >diff -u -p -r1.69 misc.c >--- misc.c 13 Jun 2008 01:38:23 -0000 1.69 >+++ misc.c 7 Dec 2008 23:53:12 -0000 >@@ -832,3 +832,53 @@ ms_to_timeval(struct timeval *tv, int ms > tv->tv_usec = (ms % 1000) * 1000; > } > >+int >+debug_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, >+ struct timeval *timeout) >+{ >+ int i, ret; >+ >+ debug3("%s: nfds = %d", __func__, nfds); >+ debug3("%s: readfds = %p, writefds = %p, exceptfds = %p", __func__, >+ readfds, writefds, exceptfds); >+ if (timeout == NULL) >+ debug3("%s: timeout = NULL", __func__); >+ else >+ debug3("%s: timeout = %p { %ld, %ld }", __func__, timeout, >+ timeout->tv_sec, timeout->tv_usec); >+ for (i = 0; readfds && i < nfds; i++) { >+ if (FD_ISSET(i, readfds)) >+ debug3("%s: before rfd %d%s", __func__, i, >+ fcntl(i, F_GETFL, 0) < 0 ? " INVALID" : ""); >+ } >+ for (i = 0; writefds && i < nfds; i++) { >+ if (FD_ISSET(i, writefds)) >+ debug3("%s: before wfd %d%s", __func__, i, >+ fcntl(i, F_GETFL, 0) < 0 ? " INVALID" : ""); >+ } >+ for (i = 0; exceptfds && i < nfds; i++) { >+ if (FD_ISSET(i, exceptfds)) >+ debug3("%s: before efd %d%s", __func__, i, >+ fcntl(i, F_GETFL, 0) < 0 ? " INVALID" : ""); >+ } >+ errno = 0; >+ ret = select(nfds, readfds, writefds, exceptfds, timeout); >+ debug3("%s: select() = %d", __func__, ret); >+ if (ret < 0) >+ debug3("%s: errno = %d: %s", __func__, errno, strerror(errno)); >+ >+ for (i = 0; readfds && ret > 0 && i < nfds; i++) { >+ if (FD_ISSET(i, readfds)) >+ debug3("%s: after rfd %d", __func__, i); >+ } >+ for (i = 0; writefds && ret > 0 && i < nfds; i++) { >+ if (FD_ISSET(i, writefds)) >+ debug3("%s: after wfd %d", __func__, i); >+ } >+ for (i = 0; exceptfds && ret > 0 && i < nfds; i++) { >+ if (FD_ISSET(i, exceptfds)) >+ debug3("%s: after efd %d", __func__, i); >+ } >+ return ret; >+} >+ >Index: misc.h >=================================================================== >RCS file: /cvs/src/usr.bin/ssh/misc.h,v >retrieving revision 1.38 >diff -u -p -r1.38 misc.h >--- misc.h 12 Jun 2008 20:38:28 -0000 1.38 >+++ misc.h 7 Dec 2008 23:53:12 -0000 >@@ -35,6 +35,7 @@ char *tohex(const void *, size_t); > void sanitise_stdfd(void); > void ms_subtract_diff(struct timeval *, int *); > void ms_to_timeval(struct timeval *, int); >+int debug_select(int, fd_set *, fd_set *, fd_set *, struct timeval *); > > struct passwd *pwcopy(struct passwd *); > const char *ssh_gai_strerror(int);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1517
:
1564
| 1587