An Unsuccessful Call to the Connect() Function on a Non-Blocking Socket Leaks a Thread in the Device.exe Process (817758)



The information in this article applies to:

  • Microsoft Windows CE Platform Builder 4.1

SYMPTOMS

An application that uses the Windows Sockets API stops responding when a call to the CloseSocket() function does not return. System processes that seem to be unrelated may stop working.

CAUSE

When the application calls CloseSocket() on a non-blocking socket, Device.exe creates a thread to handle closing the socket and to allow the application thread to continue execution. The new thread does not complete the close operation. As a result, a system thread object is leaked. When the process Device.exe reaches the per-process limit on thread objects, the call to CloseSocket blocks until one of the leaked threads exits. Because the leaked thread never exits, the problem occurs.

RESOLUTION

Hotfix Information

A supported software update is now available from Microsoft as Windows CE 4.1 Core OS QFE 030430_Q817758. To resolve this problem immediately, click the following article number for information about obtaining Windows CE Platform Builder and core operating system software updates:

837392 How to locate core operating system fixes for Microsoft Windows CE Platform Builder products

This hotfix does not replace any other hotfixes.
The English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time                      Size    File name
   -----------------------------------------------------------------------------------

   Path: 030430_q817758
   30-Apr-2003  20:48                      7,741  Wince .net 4.1_qfe_readme_q817758.htm

   Path: 030430_q817758\Public\Common\Oak\Lib\Armv4\Debug
   17-Apr-2003  02:35                  1,099,680  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Armv4\Retail
   17-Apr-2003  02:34                    698,304  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Armv4i\Debug
   17-Apr-2003  02:34                  1,100,728  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Armv4i\Retail
   17-Apr-2003  02:33                    699,182  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Armv4t\Debug
   17-Apr-2003  02:33                  1,053,684  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Armv4t\Retail
   17-Apr-2003  02:32                    695,128  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Mips16\Debug
   17-Apr-2003  02:36                    990,670  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Mips16\Retail
   17-Apr-2003  02:36                    633,964  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Mipsii\Debug
   17-Apr-2003  02:36                  1,115,142  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Mipsii\Retail
   17-Apr-2003  02:35                    710,848  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Mipsii_fp\Debug
   17-Apr-2003  02:37                  1,115,278  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Mipsii_fp\Retail
   17-Apr-2003  02:37                    711,076  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Mipsiv\Debug
   17-Apr-2003  02:41                  1,124,994  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Mipsiv\Retail
   17-Apr-2003  02:40                    715,784  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Mipsiv_fp\Debug
   17-Apr-2003  02:39                  1,125,128  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Mipsiv_fp\Retail
   17-Apr-2003  02:39                    716,016  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Sh3\Debug
   17-Apr-2003  02:38                    999,482  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Sh3\Retail
   17-Apr-2003  02:38                    658,948  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Sh4\Debug
   17-Apr-2003  02:40                    998,878  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\Sh4\Retail
   17-Apr-2003  02:39                    657,728  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\X86\Debug
   17-Apr-2003  02:32                    983,518  Afdlib.lib

   Path: 030430_q817758\Public\Common\Oak\Lib\X86\Retail
   17-Apr-2003  02:32                    619,648  Afdlib.lib

   Path: 030430_q817758\Signed
   30-Apr-2003  22:05  4.1.3.430       1,100,392  030430_armv4i_wce41-q817758.exe  
   30-Apr-2003  22:05  4.1.3.430       1,100,392  030430_armv4t_wce41-q817758.exe  
   30-Apr-2003  22:05  4.1.3.430       1,100,392  030430_armv4_wce41-q817758.exe  
   30-Apr-2003  22:04  4.1.3.430       1,047,144  030430_mips16_wce41-q817758.exe  
   30-Apr-2003  22:06  4.1.3.430       1,133,160  030430_mipsii_fp_wce41-q817758.exe  
   30-Apr-2003  22:06  4.1.3.430       1,133,160  030430_mipsii_wce41-q817758.exe  
   30-Apr-2003  22:06  4.1.3.430       1,141,352  030430_mipsiv_fp_wce41-q817758.exe  
   30-Apr-2003  22:06  4.1.3.430       1,141,352  030430_mipsiv_wce41-q817758.exe  
   30-Apr-2003  22:05  4.1.3.430       1,063,528  030430_sh3_wce41-q817758.exe  
   30-Apr-2003  22:05  4.1.3.430       1,063,528  030430_sh4_wce41-q817758.exe  
   30-Apr-2003  22:03  4.1.3.430       1,010,280  030430_x86_wce41-q817758.exe  

WORKAROUND

To work around this problem, either do not use non-blocking sockets, or use a very small time-out value, such as 1, in the call to CloseSocket().

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.

Modification Type:MinorLast Reviewed:5/27/2005
Keywords:kbBug kbfix kbQFE KB817758 kbAudOEM