Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
On Wed, 12 Nov 2003, Corinna Vinschen wrote: > On Wed, Nov 12, 2003 at 04:15:46PM -0200, Fr?d?ric L. W. Meunier wrote: > > On Wed, 12 Nov 2003, Brian Ford wrote: > > > > > Corinna, > > > > > > Did you get a chance to look at the strace output he posted here: > > > > > > http://pervalidus.port5.com/tmp/imap.txt.gz > > > > > > A glance there by trained eyes might save him some time. I don't have the > > > time or the training for mine :). It appears to be stuck in close on the > > > socket after is has shutdown? > > > > It seems to be cause by the firewall from my SpeedStream 5200. > > > > 'a logout' worked once I disabled filtering 'TCP NULL', but the > > Pine delays remain. > > > > Anyway, why it worked on plain Windows and Linux is another > > story. I don't have any other firewalls enabled. > > fhandler_socket::close() tries to circumvent problems with unexpected > data loss which can occur, if an application exits without having > waited for the closesocket() call being successful. The problem with > the latter is, that there's no way to find out. Therefore Cygwin > lingers on closesocket(), even with non-blocking sockets. I don't > know if that helps but you could try to build a Cygwin DLL which only > lingers if shutdown hasn't been called. I tried it with ssh and it > seems at least not to disturb ssh operation. Patch below. It behaves the same. I applied your patch and compiled latest CVS. 6735077 Nov 12 17:02 cygwin1.dll And in gdb I still see #2 0x0005 in ?? () #3 0x0004 in ?? () #4 0x0001 in ?? () #5 0x00e3ffd0 in ?? () #6 0x81f2eda8 in ?? () #7 0x in ?? () Anyway, since disabling filtering 'TCP NULL' worked for 'a logout' I'll see what I can do in the modem configuration to make the Pine delays go away. Disabling all ADS (Attack Detection System), which has: Same Source and Destination Address Broadcast Source Address LAN Source Address On WAN Invalid IP Packet Fragment TCP NULL TCP FIN TCP Xmas Fragmented TCP Packet Fragmented TCP Header Fragmented UDP Header Fragmented ICMP Header Inconsistent UDP/IP header lengths Inconsistent IP header lengths didn't help. -- How to contact me - http://www.pervalidus.net/contact.html -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
On Wed, Nov 12, 2003 at 04:15:46PM -0200, Fr?d?ric L. W. Meunier wrote: > On Wed, 12 Nov 2003, Brian Ford wrote: > > > Corinna, > > > > Did you get a chance to look at the strace output he posted here: > > > > http://pervalidus.port5.com/tmp/imap.txt.gz > > > > A glance there by trained eyes might save him some time. I don't have the > > time or the training for mine :). It appears to be stuck in close on the > > socket after is has shutdown? > > It seems to be cause by the firewall from my SpeedStream 5200. > > 'a logout' worked once I disabled filtering 'TCP NULL', but the > Pine delays remain. > > Anyway, why it worked on plain Windows and Linux is another > story. I don't have any other firewalls enabled. fhandler_socket::close() tries to circumvent problems with unexpected data loss which can occur, if an application exits without having waited for the closesocket() call being successful. The problem with the latter is, that there's no way to find out. Therefore Cygwin lingers on closesocket(), even with non-blocking sockets. I don't know if that helps but you could try to build a Cygwin DLL which only lingers if shutdown hasn't been called. I tried it with ssh and it seems at least not to disturb ssh operation. Patch below. Corinna Index: fhandler_socket.cc === RCS file: /cvs/src/src/winsup/cygwin/fhandler_socket.cc,v retrieving revision 1.111 diff -u -p -r1.111 fhandler_socket.cc --- fhandler_socket.cc 25 Sep 2003 03:51:50 - 1.111 +++ fhandler_socket.cc 12 Nov 2003 18:32:18 - @@ -1101,14 +1101,17 @@ fhandler_socket::close () { int res = 0; - /* HACK to allow a graceful shutdown even if shutdown() hasn't been - called by the application. Note that this isn't the ultimate - solution but it helps in many cases. */ - struct linger linger; - linger.l_onoff = 1; - linger.l_linger = 240; /* seconds. default 2MSL value according to MSDN. */ - setsockopt (get_socket (), SOL_SOCKET, SO_LINGER, - (const char *)&linger, sizeof linger); + if (!saw_shutdown_write ()) +{ + /* HACK to allow a graceful shutdown even if shutdown() hasn't been +called by the application. Note that this isn't the ultimate +solution but it helps in many cases. */ + struct linger linger; + linger.l_onoff = 1; + linger.l_linger = 240; /* secs. default 2MSL value according to MSDN. */ + setsockopt (get_socket (), SOL_SOCKET, SO_LINGER, + (const char *)&linger, sizeof linger); +} while ((res = closesocket (get_socket ())) != 0) { -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developermailto:[EMAIL PROTECTED] Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
On Wed, 12 Nov 2003, Brian Ford wrote: > Corinna, > > Did you get a chance to look at the strace output he posted here: > > http://pervalidus.port5.com/tmp/imap.txt.gz > > A glance there by trained eyes might save him some time. I don't have the > time or the training for mine :). It appears to be stuck in close on the > socket after is has shutdown? It seems to be cause by the firewall from my SpeedStream 5200. 'a logout' worked once I disabled filtering 'TCP NULL', but the Pine delays remain. Anyway, why it worked on plain Windows and Linux is another story. I don't have any other firewalls enabled. -- How to contact me - http://www.pervalidus.net/contact.html -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
Corinna, Did you get a chance to look at the strace output he posted here: http://pervalidus.port5.com/tmp/imap.txt.gz A glance there by trained eyes might save him some time. I don't have the time or the training for mine :). It appears to be stuck in close on the socket after is has shutdown? On Wed, 12 Nov 2003, Frédéric L. W. Meunier wrote: > On Wed, 12 Nov 2003, Corinna Vinschen wrote: > > On Wed, Nov 12, 2003 at 12:20:57AM -0200, Fr?d?ric L. W. Meunier wrote: > > > Now I'm trying with gdb, but don't know if the following is right. > > > > > > $ openssl s_client -connect mail.postaccesslite.com:993 > > > $ gdb > > > (gdb) attach PPID of openssl > > > (gdb) where > > > #0 0x77f75a59 in ntdll!DbgUiConnectToDbg () from /c/WINDOWS/System32/ntdll.dll > > > #1 0x77f5f31f in ntdll!KiUserCallbackDispatcher () > > >from /c/WINDOWS/System32/ntdll.dll > > > #2 0x0005 in ?? () > > > #3 0x0004 in ?? () > > > #4 0x0001 in ?? () > > > #5 0x00e3ffd0 in ?? () > > > #6 0x81f2eda8 in ?? () > > > #7 0x in ?? () > > > #8 0x77fa88f0 in wcstombs () from /c/WINDOWS/System32/ntdll.dll > > > > > > Does that help ? What are #2 to #7 ? cygwin1.dll ? The OpenSSL > > > DLLs ? > > > > Nobody can say that. You should rebuild openssl for Cygwin and > > use CFLAGS=-g for the make. After unpacking the source package, > > it's as easy as this: > > > > $ cd openssl-0.9.7c-1 > > $ ./config --prefix=/usr shared no-idea no-rc5 no-mdc2 > > $ make depend CFLAGS=--g > > $ make CFLAGS=-g > > If the above gdb commands were right, using > > 2896329 Nov 12 11:56 cygcrypto-0.9.7.dll > 618518 Nov 12 11:56 cygssl-0.9.7.dll > 929614 Nov 12 11:56 openssl.exe > > didn't change anything. > From the strace output, I'd say you're stuck in the cygwin1.dll. Try a debug build of that instead. -- Brian Ford Senior Realtime Software Engineer VITAL - Visual Simulation Systems FlightSafety International Phone: 314-551-8460 Fax: 314-551-8444 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
On Wed, 12 Nov 2003, Corinna Vinschen wrote: > On Wed, Nov 12, 2003 at 12:20:57AM -0200, Fr?d?ric L. W. Meunier wrote: > > Now I'm trying with gdb, but don't know if the following is > > right. > > > > $ openssl s_client -connect mail.postaccesslite.com:993 > > $ gdb > > (gdb) attach PPID of openssl > > (gdb) where > > #0 0x77f75a59 in ntdll!DbgUiConnectToDbg () from /c/WINDOWS/System32/ntdll.dll > > #1 0x77f5f31f in ntdll!KiUserCallbackDispatcher () > >from /c/WINDOWS/System32/ntdll.dll > > #2 0x0005 in ?? () > > #3 0x0004 in ?? () > > #4 0x0001 in ?? () > > #5 0x00e3ffd0 in ?? () > > #6 0x81f2eda8 in ?? () > > #7 0x in ?? () > > #8 0x77fa88f0 in wcstombs () from /c/WINDOWS/System32/ntdll.dll > > > > Does that help ? What are #2 to #7 ? cygwin1.dll ? The OpenSSL > > DLLs ? > > Nobody can say that. You should rebuild openssl for Cygwin and > use CFLAGS=-g for the make. After unpacking the source package, > it's as easy as this: > > $ cd openssl-0.9.7c-1 > $ ./config --prefix=/usr shared no-idea no-rc5 no-mdc2 > $ make depend CFLAGS=--g > $ make CFLAGS=-g If the above gdb commands were right, using 2896329 Nov 12 11:56 cygcrypto-0.9.7.dll 618518 Nov 12 11:56 cygssl-0.9.7.dll 929614 Nov 12 11:56 openssl.exe didn't change anything. -- How to contact me - http://www.pervalidus.net/contact.html -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
On Wed, Nov 12, 2003 at 12:20:57AM -0200, Fr?d?ric L. W. Meunier wrote: > Now I'm trying with gdb, but don't know if the following is > right. > > $ openssl s_client -connect mail.postaccesslite.com:993 > $ gdb > (gdb) attach PPID of openssl > (gdb) where > #0 0x77f75a59 in ntdll!DbgUiConnectToDbg () from /c/WINDOWS/System32/ntdll.dll > #1 0x77f5f31f in ntdll!KiUserCallbackDispatcher () >from /c/WINDOWS/System32/ntdll.dll > #2 0x0005 in ?? () > #3 0x0004 in ?? () > #4 0x0001 in ?? () > #5 0x00e3ffd0 in ?? () > #6 0x81f2eda8 in ?? () > #7 0x in ?? () > #8 0x77fa88f0 in wcstombs () from /c/WINDOWS/System32/ntdll.dll > > Does that help ? What are #2 to #7 ? cygwin1.dll ? The OpenSSL > DLLs ? Nobody can say that. You should rebuild openssl for Cygwin and use CFLAGS=-g for the make. After unpacking the source package, it's as easy as this: $ cd openssl-0.9.7c-1 $ ./config --prefix=/usr shared no-idea no-rc5 no-mdc2 $ make depend CFLAGS=--g $ make CFLAGS=-g Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developermailto:[EMAIL PROTECTED] Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
On Tue, 11 Nov 2003, Frédéric L. W. Meunier wrote: > On Tue, 11 Nov 2003, Brian Ford wrote: > > > On Tue, 11 Nov 2003, Frédéric L. W. Meunier wrote: > > > On Tue, 11 Nov 2003, Corinna Vinschen wrote: > > > > Me neither. Seems to be a local problem. > > > > > > I don't see what could be wrong with my installation. > > > > > More likely, your network setup. > > BTW, I forgot that I had built OpenSSL 0.9.7c with Borland C++ > to make a Windows Lynx binary. > > I tested with this openssl.exe and it returned to the cmd.exe > prompt immediately after I issued the 'a logout'. Now I'm trying with gdb, but don't know if the following is right. $ openssl s_client -connect mail.postaccesslite.com:993 $ gdb (gdb) attach PPID of openssl (gdb) where #0 0x77f75a59 in ntdll!DbgUiConnectToDbg () from /c/WINDOWS/System32/ntdll.dll #1 0x77f5f31f in ntdll!KiUserCallbackDispatcher () from /c/WINDOWS/System32/ntdll.dll #2 0x0005 in ?? () #3 0x0004 in ?? () #4 0x0001 in ?? () #5 0x00e3ffd0 in ?? () #6 0x81f2eda8 in ?? () #7 0x in ?? () #8 0x77fa88f0 in wcstombs () from /c/WINDOWS/System32/ntdll.dll Does that help ? What are #2 to #7 ? cygwin1.dll ? The OpenSSL DLLs ? Or how am I supposed to see what happens after the 'a logout' ? -- How to contact me - http://www.pervalidus.net/contact.html -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
On Tue, 11 Nov 2003, Brian Ford wrote: > On Tue, 11 Nov 2003, Frédéric L. W. Meunier wrote: > > On Tue, 11 Nov 2003, Corinna Vinschen wrote: > > > Me neither. Seems to be a local problem. > > > > I don't see what could be wrong with my installation. > > > More likely, your network setup. BTW, I forgot that I had built OpenSSL 0.9.7c with Borland C++ to make a Windows Lynx binary. I tested with this openssl.exe and it returned to the cmd.exe prompt immediately after I issued the 'a logout'. -- How to contact me - http://www.pervalidus.net/contact.html -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
On Tue, 11 Nov 2003, Brian Ford wrote: > On Tue, 11 Nov 2003, Frédéric L. W. Meunier wrote: > > On Tue, 11 Nov 2003, Corinna Vinschen wrote: > > > Me neither. Seems to be a local problem. > > > > I don't see what could be wrong with my installation. > > > More likely, your network setup. > > > Anyway, any steps I can do to debug it are appreciated. > > > You might post/analyze an strace of it to see what call is taking so long. http://pervalidus.port5.com/tmp/imap.txt.gz 15:51:29 -> 15:53:55 -- How to contact me - http://www.pervalidus.net/contact.html -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
On Tue, 11 Nov 2003, Frédéric L. W. Meunier wrote: > On Tue, 11 Nov 2003, Corinna Vinschen wrote: > > Me neither. Seems to be a local problem. > > I don't see what could be wrong with my installation. > More likely, your network setup. > Anyway, any steps I can do to debug it are appreciated. > You might post/analyze an strace of it to see what call is taking so long. -- Brian Ford Senior Realtime Software Engineer VITAL - Visual Simulation Systems FlightSafety International Phone: 314-551-8460 Fax: 314-551-8444 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
nOn Tue, 11 Nov 2003, Corinna Vinschen wrote: > On Tue, Nov 11, 2003 at 01:52:36AM -0200, Fr?d?ric L. W. Meunier wrote: > > OK, so here's what turns out to be an OpenSSL issue. All thanks > > to Eduardo. > > > > On Mon, 10 Nov 2003, Eduardo Chappa wrote: > > > > > *** Fr?d?ric L. W. Meunier wrote on Nov 11, 2003: > > > > > > :) > Is there any delay? > > > :) > > > :) Yes. > > > > > > Ok, this means that the problem is not Pine. It's openssl. You may want to > > > repeat the experiment and see if > > > > > > openssl s_client -connect mail.postaccesslite.com:993 > > > > > > a logout > > > > > > repeats the problem. > > > > Yes, it does, and may be easier for others to try to reproduce. > > > > > In any case, the problem is not Pine. You may want to contact > > > the openssl maintainer to see what s/he says. > > > > At first I'm redirecting it to the Cygwin mailing-list since it > > works on Linux. > > > > For those of you who aren't aware, all started with > > http://sources.redhat.com/ml/cygwin/2003-11/msg00295.html > > > > How to reproduce it: > > > > $ openssl s_client -connect mail.postaccesslite.com:993 > > ... > > a logout > > * BYE Courier-IMAP server shutting down > > a OK LOGOUT completed > > read:errno=0 > > > > It takes around a minute to return to the shell prompt after > > the 'a logout'. > > > > Eduardo couldn't reproduce it. > > Me neither. Seems to be a local problem. I don't see what could be wrong with my installation. Anyway, any steps I can do to debug it are appreciated. -- How to contact me - http://www.pervalidus.net/contact.html -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Re: OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
On Tue, Nov 11, 2003 at 01:52:36AM -0200, Fr?d?ric L. W. Meunier wrote: > OK, so here's what turns out to be an OpenSSL issue. All thanks > to Eduardo. > > On Mon, 10 Nov 2003, Eduardo Chappa wrote: > > > *** Fr?d?ric L. W. Meunier wrote on Nov 11, 2003: > > > > :) > Is there any delay? > > :) > > :) Yes. > > > > Ok, this means that the problem is not Pine. It's openssl. You may want to > > repeat the experiment and see if > > > > openssl s_client -connect mail.postaccesslite.com:993 > > > > a logout > > > > repeats the problem. > > Yes, it does, and may be easier for others to try to reproduce. > > > In any case, the problem is not Pine. You may want to contact > > the openssl maintainer to see what s/he says. > > At first I'm redirecting it to the Cygwin mailing-list since it > works on Linux. > > For those of you who aren't aware, all started with > http://sources.redhat.com/ml/cygwin/2003-11/msg00295.html > > How to reproduce it: > > $ openssl s_client -connect mail.postaccesslite.com:993 > ... > a logout > * BYE Courier-IMAP server shutting down > a OK LOGOUT completed > read:errno=0 > > It takes around a minute to return to the shell prompt after > the 'a logout'. > > Eduardo couldn't reproduce it. Me neither. Seems to be a local problem. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developermailto:[EMAIL PROTECTED] Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
OpenSSL problem ? (Was Re: Pine 4.58 for Cygwin takes a very long time to close a certain IMAP INBOX)
OK, so here's what turns out to be an OpenSSL issue. All thanks to Eduardo. On Mon, 10 Nov 2003, Eduardo Chappa wrote: > *** Frédéric L. W. Meunier wrote on Nov 11, 2003: > > :) > Is there any delay? > :) > :) Yes. > > Ok, this means that the problem is not Pine. It's openssl. You may want to > repeat the experiment and see if > > openssl s_client -connect mail.postaccesslite.com:993 > > a logout > > repeats the problem. Yes, it does, and may be easier for others to try to reproduce. > In any case, the problem is not Pine. You may want to contact > the openssl maintainer to see what s/he says. At first I'm redirecting it to the Cygwin mailing-list since it works on Linux. For those of you who aren't aware, all started with http://sources.redhat.com/ml/cygwin/2003-11/msg00295.html How to reproduce it: $ openssl s_client -connect mail.postaccesslite.com:993 ... a logout * BYE Courier-IMAP server shutting down a OK LOGOUT completed read:errno=0 It takes around a minute to return to the shell prompt after the 'a logout'. Eduardo couldn't reproduce it. -- How to contact me - http://www.pervalidus.net/contact.html -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/