Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sun, 20 Feb 2005 04:32:08 +0300 From: Oleg Semenov Subject: WSADuplicateSocket error To: cygwin AT cygwin DOT com Message-id: <4217E898.1010904@yandex.ru> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) Hi, On my PC, any cygwin app which has a socket open (inetd, cddbd, whatever) seems to be unable to fork. I've included a strace excerpt below. As I see from strace, WSADuplicateSocket fails with error 10024 (too many open sockets). Could someone help me with this? I understand that quite probably it's caused by some third party software hooked into winsock, but I couldn't find the cause. I tried clearing out the LSP chains and uninstalling all applications which could be linked to this (firewall and VPN client), this did not help. Running on XP SP2, cygwin 1.5.12. Regards, Oleg Semenov Strace excerpt comes here: 33 10100382 [main] cddbd 3148 fork: entering 25 10100407 [main] cddbd 3148 sig_send: sendsig 0x700, pid 3148, signal -40, its_me 1 27 10100434 [main] cddbd 3148 sig_send: wakeup 0x66C 32 10100466 [main] cddbd 3148 sig_send: Waiting for pack.wakeup 0x66C 29 10100495 [sig] cddbd 3148 wait_sig: signalled 0x66C 33 10100528 [main] cddbd 3148 sig_send: returning 0x0 from sending signal -40 25 10100553 [main] cddbd 3148 __cygwin_lock_lock: threadcount 1. not locking 22 10100575 [main] cddbd 3148 __cygwin_lock_lock: threadcount 1. not locking 22 10100597 [main] cddbd 3148 __cygwin_lock_lock: threadcount 1. not locking 21 10100618 [main] cddbd 3148 __cygwin_lock_lock: threadcount 1. not locking 21 10100639 [main] cddbd 3148 __cygwin_lock_unlock: threadcount 1. not unlocking 27 10100666 [main] cddbd 3148 __cygwin_lock_lock: threadcount 1. not locking 21 10100687 [main] cddbd 3148 __cygwin_lock_lock: threadcount 1. not locking 21 10100708 [main] cddbd 3148 __cygwin_lock_unlock: threadcount 1. not unlocking 22 10100730 [main] cddbd 3148 __cygwin_lock_lock: threadcount 1. not locking 21 10100751 [main] cddbd 3148 __cygwin_lock_lock: threadcount 1. not locking 21 10100772 [main] cddbd 3148 __cygwin_lock_unlock: threadcount 1. not unlocking 22 10100794 [main] cddbd 3148 __cygwin_lock_unlock: threadcount 1. not unlocking 60 10100854 [main] cddbd 3148 subproc_init: started wait_subproc thread 54 10100908 [main] cddbd 3148 __cygwin_lock_lock: threadcount 1. not locking 24 10100932 [main] cddbd 3148 __cygwin_lock_unlock: threadcount 1. not unlocking 34 10100966 [main] cddbd 3148 stack_base: bottom 0x230000, top 0x30000, stack 0x22E410, size 7152, reserve 2097152 27 10100993 [main] cddbd 3148 fork_parent: CreateProcess (C:\cygwin\usr\local\bin\cddbd.exe, C:\cygwin\usr\local\bin\cddbd.exe, 0, 0, 1, 24, 0, 0, 0x22E4B0, 0x22E500) 2786 10103779 [proc] cddbd 3148 wait_subproc: starting 3069 10106848 [main] cddbd 3148 dtable::fixup_before_fork: fd 0 (/dev/console) 57 10106905 [main] cddbd 3148 dtable::fixup_before_fork: fd 1 (/usr/local/bin/f) 23 10106928 [main] cddbd 3148 dtable::fixup_before_fork: fd 2 (/usr/local/bin/f2) 22 10106950 [main] cddbd 3148 dtable::fixup_before_fork: fd 3 () 169 10107119 [main] cddbd 3148 fhandler_socket::fixup_before_fork_exec: WSADuplicateSocket error, sock 0x6AC, win_proc_id 512, prot_info_ptr 0x6179165C 32 10107151 [main] cddbd 3148 __set_winsock_errno: fixup_before_fork_exec:269 - winsock error 10024 -> errno 1 25 10107176 [main] cddbd 3148 dtable::fixup_before_fork: fd 4 () 29 10107205 [main] cddbd 3148 fhandler_socket::fixup_before_fork_exec: WSADuplicateSocket error, sock 0x67C, win_proc_id 512, prot_info_ptr 0x61791A6C 24 10107229 [main] cddbd 3148 __set_winsock_errno: fixup_before_fork_exec:269 - winsock error 10024 -> errno 1 135 10107364 [main] cddbd 3148 proc_subproc: args: 1, 2286752 32 10107396 [main] cddbd 3148 proc_subproc: Couldn't duplicate my handle<0x7DC> for pid 512, Win32 error 5 485 10107881 [main] cddbd 3148 proc_subproc: added pid 512 to wait list, slot 0, winpid 0x200, handle 0x64C 26 10107907 [main] cddbd 3148 proc_subproc: returning 1 24 10107931 [main] cddbd 3148 sync_with_child: waiting for child. reason: waiting for longjmp, hang_child 1 89 10108020 [proc] cddbd 3148 wait_subproc: looping 54 10108074 [proc] cddbd 3148 proc_subproc: args: 2, 0 79 10108153 [proc] cddbd 3148 proc_subproc: pid 512[0] terminated, handle 0x64C, nchildren 1, nzombies 0 27 10108180 [proc] cddbd 3148 proc_subproc: zombifying [0], pid 512, handle 0x64C, nchildren 1 23 10108203 [proc] cddbd 3148 proc_subproc: returning 1 23 10108226 [proc] cddbd 3148 sig_send: sendsig 0x700, pid 3148, signal 20, its_me 1 31 10108257 [proc] cddbd 3148 sig_send: Not waiting for sigcomplete. its_me 1 signal 20 24 10108281 [proc] cddbd 3148 sig_send: returning 0x0 from sending signal 20 22 10108303 [proc] cddbd 3148 wait_subproc: looping -327 10107976 [main] cddbd 3148 sync_with_child: child 512(0x64C) died before initialization with status code 0xC0000005 516 10108492 [main] cddbd 3148 sync_with_child: *** child state waiting for longjmp 365 10108857 [main] cddbd 3148 sync_with_child: Child died before subproc_ready signalled 30 10108887 [main] cddbd 3148 sig_send: sendsig 0x700, pid 3148, signal -41, its_me 1 25 10108912 [main] cddbd 3148 sig_send: wakeup 0x664 26 10108938 [main] cddbd 3148 sig_send: Waiting for pack.wakeup 0x664 26 10108964 [sig] cddbd 3148 sigpacket::process: signal 20 processing 62 10109026 [sig] cddbd 3148 _cygtls::find_tls: sig 20 25 10109051 [sig] cddbd 3148 sigpacket::process: signal 20, about to call 0x41799C 24 10109075 [sig] cddbd 3148 setup_handler: controlled interrupt. incyg 1, exception 0, stackptr 0x22FC04, stack 0x22FC00, stackptr[-1] 0x4087AA 25 10109100 [sig] cddbd 3148 proc_subproc: args: 3, 1 20 10109120 [sig] cddbd 3148 proc_subproc: clear waiting threads 19 10109139 [sig] cddbd 3148 proc_subproc: finished clearing 19 10109158 [sig] cddbd 3148 proc_subproc: returning 1 19 10109177 [sig] cddbd 3148 _cygtls::interrupt_setup: armed signal_arrived 0x708, sig 20, res 1 20 10109197 [sig] cddbd 3148 setup_handler: signal 20 delivered 21 10109218 [sig] cddbd 3148 sigpacket::process: returning 1 21 10109239 [sig] cddbd 3148 wait_sig: signalled 0x664 29 10109268 [main] cddbd 3148 reset_signal_arrived: reset signal_arrived 24 10109292 [main] cddbd 3148 reset_signal_arrived: stackptr[-1] 0x4087AA 21 10109313 [main] cddbd 3148 set_process_mask_delta: oldmask 0x0, newmask 0x80000, deltamask 0x80000 31 10109344 [main] cddbd 3148 wait4: calling proc_subproc, pid -1, options 1 22 10109366 [main] cddbd 3148 proc_subproc: args: 4, 2292680 22 10109388 [main] cddbd 3148 proc_subproc: wval->pid -1, wval->options 1 24 10109412 [main] cddbd 3148 checkstate: nchildren 0, nzombies 1 22 10109434 [main] cddbd 3148 stopped_or_terminated: considering pid 512 123 10109557 [main] cddbd 3148 remove_zombie: removing 0, pid 512, nzombies 1 91 10109648 [main] cddbd 3148 checkstate: returning 1 29 10109677 [main] cddbd 3148 proc_subproc: released waiting thread 21 10109698 [main] cddbd 3148 proc_subproc: finished processing terminated/stopped child 22 10109720 [main] cddbd 3148 proc_subproc: returning 1 36 10109756 [main] cddbd 3148 wait4: 0 = WaitForSingleObject (...) 24 10109780 [main] cddbd 3148 wait4: intpid -1, status 0x0, w->status 65280, options 1, res 512 26 10109806 [main] cddbd 3148 wait4: calling proc_subproc, pid -1, options 1 21 10109827 [main] cddbd 3148 proc_subproc: args: 4, 2292680 22 10109849 [main] cddbd 3148 proc_subproc: wval->pid -1, wval->options 1 22 10109871 [main] cddbd 3148 checkstate: nchildren 0, nzombies 0 20 10109891 [main] cddbd 3148 checkstate: checking alive children 22 10109913 [main] cddbd 3148 checkstate: returning 0 20 10109933 [main] cddbd 3148 proc_subproc: waiting thread found no children 23 10109956 [main] cddbd 3148 proc_subproc: finished processing terminated/stopped child 21 10109977 [main] cddbd 3148 proc_subproc: returning 1 20 10109997 [main] cddbd 3148 wait4: intpid -1, status 0x0, w->status 0, options 1, res -1 22 10110019 [main] cddbd 3148 wait4: *** errno 10 22 10110041 [main] cddbd 3148 void: 0x41799C = signal (20, 0x41799C) 22 10110063 [main] cddbd 3148 set_signal_mask: oldmask 0x80000, newmask 0x0, mask_bits 0x80000 22 10110085 [main] cddbd 3148 sig_send: returning 0x0 from sending signal -41 22 10110107 [main] cddbd 3148 fork: -1 = fork() -- 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/