Mail Archives: cygwin/2005/10/04/09:43:17
Hi,
I am trying to use UNIX domain sockets in cygwin environment.
A program in question works fine just on any other POSIX
OS I can get my hands on (Linux, FreeBSD, Solaris, ...).
However, running on cygwin, select() hangs forever.
The program sets up 1 socket for Read mask and 2 sockets for
write mask to complete asynchronous connect. The timeout is
set to 1 second. What follows is the 'strace' of the relevant
portion. Looks like a select_socket thread is started and
properly detects data on all file descriptors, but it never
bubbles up to the application layer.
Can anyone at least suggest something?
strace output:
----------------------------------------------------
**********************************************
Program name: C:\cygwin\usr\vlg\mytest.exe
App version: 1005.18, api: 0.132
DLL version: 1005.18, api: 0.132
DLL build: 2005-07-02 20:30
OS version: Windows NT-5.1
Heap size: 402653184
Date/Time: 2005-10-03 18:00:26
**********************************************
42 781 [main] set_myself: myself->dwProcessId 1320
49 830 [main] time: 1128376826 = time (0)
select() is called with fd=5 set for read and fds=6,7 for write
with timeout of 1 second.
46 432912 [main] cygwin_select: 8, 0x6A2268, 0x6A2270, 0x6A2278,
0x22ED30
72 432984 [main] dtable::select_read: fd 5
70 433054 [main] dtable::select_write: fd 6
66 433120 [main] dtable::select_write: fd 7
35 433155 [main] cygwin_select: to->tv_sec 1, to->tv_usec 0, ms 1000
108 433263 [main] cygwin_select: sel.always_ready 0
91 433354 [main] start_thread_socket: Handle 0x654
36 433390 [main] start_thread_socket: Added to writefds
35 433425 [main] start_thread_socket: Added to exceptfds
34 433459 [main] start_thread_socket: Handle 0x678
35 433494 [main] start_thread_socket: Added to writefds
34 433528 [main] start_thread_socket: Added to exceptfds
37 433565 [main] start_thread_socket: Handle 0x680
59 433624 [main] start_thread_socket: Added to readfds
202 433826 [main] start_thread_socket: opened new socket 0x64C
44 433870 [main] start_thread_socket: exitsock 0x64C
35 433905 [main] start_thread_socket: stuff_start 0x22EC64
480 434385 [select_socket] cygthread::stub: thread 'select_socket',
id 0x1600, stack_ptr 0x1944EFD0
53 434438 [select_socket] thread_socket: stuff_start 0x6A7874
111 434549 [select_socket] thread_socket: Win32 select returned 3
41 434590 [select_socket] thread_socket: s 0x6A4830, testing fd 7 ()
76 434666 [select_socket] thread_socket: write_ready
38 434704 [select_socket] thread_socket: s 0x6A4800, testing fd 6 ()
37 434741 [select_socket] thread_socket: write_ready
36 434777 [select_socket] thread_socket: s 0x6A4358, testing fd 5 ()
38 434815 [select_socket] thread_socket: read_ready
46 434861 [main] select_stuff::wait: m 2, ms 1000
40 434901 [main] select_stuff::wait: woke up. wait_ret 1.
verifying
37 434938 [main] select_stuff::wait: gotone 1
36 434974 [main] select_stuff::wait: returning 0
36 435010 [main] select_stuff::cleanup: calling cleanup routines
38 435048 [main] socket_cleanup: si 0x6A4860 si->thread 0x610E6D44
200 435248 [main] socket_cleanup: sent a byte to exitsock 0x64C, res
1
78 435326 [main] socket_cleanup: reading a byte from exitsock 0x64C
53 435379 [main] socket_cleanup: recv returned 1
72 435451 [main] socket_cleanup: returning
36 435487 [main] socket_cleanup: si 0x0 si->thread 0x0
36 435523 [main] socket_cleanup: returning
35 435558 [main] socket_cleanup: si 0x0 si->thread 0x0
36 435594 [main] socket_cleanup: returning
40 435634 [main] peek_socket: considering handle 0x654
36 435670 [main] peek_socket: adding except fd_set , fd 7
46 435716 [main] peek_socket: WINSOCK_SELECT returned 0
37 435753 [main] set_bits: me 0x6A4830, testing fd 7 ()
37 435790 [main] fhandler_socket::af_local_connect: af_local_connect
called
2936 438726 [win] wndproc 129 WM_NCCREATE 0 423946532
195 438921 [win] wndproc 131 WM_NCCALCSIZE 0 423946592
43 438964 [win] wndproc 1 WM_CREATE 0 423946492
37 439001 [win] wndproc 5 WM_SIZE 0 0
53 439054 [win] wndproc 3 WM_MOVE 0 0
15180 454234 [main] fhandler_socket::af_local_send_secret:
Sending af_local secret succeeded
select() hangs here and never returns
185448001 185902235 [win] wndproc 26 WM_WININICHANGE 47 423947984
114543161 300445396 [unknown (0x1670)] _cygtls::remove: wait 0x0
92 300445488 [unknown (0x1670)] _cygtls::remove: removed 0x1924F07C
element 1
767004092 1067449580 [win] wndproc 537 unknown 7 0
-761926275 305523305 [win] wndproc 537 unknown 7 0
103487 305626792 [win] wndproc 537 unknown 7 0
443113348 748740140 [win] wndproc 537 unknown 7 0
261842044 1010582184 [win] wndproc 30 WM_TIMECHANGE 0 0
405175346 1415757530 [win] wndproc 537 unknown 7 0
73578 1415831108 [win] wndproc 537 unknown 7 0
1111717026 -1767419162 [win] wndproc 537 unknown 7 0
1041477782 -725941380 [win] wndproc 126 unknown 32 67110144
134972 -725806408 [win] wndproc 21 WM_SYSCOLORCHANGE 0 0
170898 -725635510 [win] wndproc 26 WM_WININICHANGE 0 0
13450679 -712184831 [win] wndproc 26 WM_WININICHANGE 47 423947984
166950301 -545234530 [win] wndproc 537 unknown 7 0
75297 -545159233 [win] wndproc 537 unknown 7 0
----------------------------------------------------
thanks in advance,
-Vlad
--
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/
- Raw text -