2013-02-02 53 views
3

我收到「線程被中止。」在我的Asp.net應用程序的堆棧跟蹤中。我正在使用這裏描述的windbg tecnique來診斷: http://blogs.msdn.com/b/asiatech/archive/2012/06/21/how-to-troubleshoot-httpexception-request-timed-out-asp-net-4-0-64-bit.aspx 現在我只是試圖在提供的示例asp.net應用程序中捕獲此問題。我可以讓asp.net應用程序超時,但是我無法獲得文章中描述的轉儲來生成。我想我需要windbg人的幫助來理解我出錯的地方。我包括windbg條目。我的輸出有點不同,但我不知道要在描述的aspnet_timeout.cfg文件中使用哪個地址。診斷「線程正在中止。」在ASP.net

0:038> .symfix 
0:038> .loadby sos clr 
0:038> !name2ee system.web.dll System.Web.RequestTimeoutManager+RequestTimeoutEntry.TimeoutIfNeeded 
Module:  59201000 
Assembly: System.Web.dll 
Token:  0600699b 
MethodDesc: 592926e4 
Name:  System.Web.RequestTimeoutManager+RequestTimeoutEntry.TimeoutIfNeeded(System.DateTime) 
JITTED Code Address: 593f4200 
0:038> !U 593f4200 
preJIT generated code 
System.Web.RequestTimeoutManager+RequestTimeoutEntry.TimeoutIfNeeded(System.DateTime) 
Begin 593f4200, size 29. Cold region begin 59d14150, size 23 
Hot region: 
*** WARNING: Unable to verify checksum for C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Web\ccb5cc864818531ed9725d02d3d078a6\System.Web.ni.dll 
>>> 593f4200 55    push ebp 
593f4201 8bec   mov  ebp,esp 
593f4203 57    push edi 
593f4204 56    push esi 
593f4205 8bf1   mov  esi,ecx 
593f4207 8b4e10   mov  ecx,dword ptr [esi+10h] 
593f420a 8d4508   lea  eax,[ebp+8] 
593f420d ff7004   push dword ptr [eax+4] 
593f4210 ff30   push dword ptr [eax] 
593f4212 3909   cmp  dword ptr [ecx],ecx 
593f4214 e85f83f5ff  call System_Web_ni+0x14c578 (5934c578) (System.Web.HttpContext.MustTimeout(System.DateTime), mdToken: 060025f7) 
593f4219 8bf8   mov  edi,eax 
593f421b 85ff   test edi,edi 
593f421d 0f852dff9100 jne  System_Web_ni+0xb14150 (59d14150) 
593f4223 5e    pop  esi 
593f4224 5f    pop  edi 
593f4225 5d    pop  ebp 
593f4226 c20800   ret  8 
Cold region: 
59d14150 8bce   mov  ecx,esi 
59d14152 e849bb6cff  call System_Web_ni+0x1dfca0 (593dfca0) (System.Web.RequestTimeoutManager+RequestTimeoutEntry.RemoveFromList(), mdToken: 0600699a) 
59d14157 b9508f4859  mov  ecx,offset System_Web_ni+0x288f50 (59488f50) (MT: System.Web.HttpApplication+CancelModuleException) 
59d1415c e8ef4c63ff  call System_Web_ni+0x148e50 (59348e50) (System_Web_ni) 
59d14161 8bd0   mov  edx,eax 
59d14163 c6420401  mov  byte ptr [edx+4],1 
59d14167 8bcf   mov  ecx,edi 
59d14169 e89a0963ff  call System_Web_ni+0x144b08 (59344b08) (System_Web_ni) 
59d1416e e9b0006eff  jmp  System_Web_ni+0x1f4223 (593f4223) 

aspnet_timeout.cfg

<ADPlus Version='2'> 
     <!-- Configuring ADPlus to log all first chance exceptions --> 
     <!-- Will still create full dump for any type of second chance exceptions --> 
    <KeyWords> 
    <keyword Name="loadbysos"> .loadby sos clr</keyword> 
    <keyword Name="GetJIT"> !name2ee System.web.dll System.Web.RequestTimeoutManager+RequestTimeoutEntry.TimeoutIfNeeded </keyword> 
    <keyword Name="JITAddress"> .foreach /pS 0n13 (record {!name2ee System.web.dll System.Web.RequestTimeoutManager+RequestTimeoutEntry.TimeoutIfNeeded}) { r $t1= ${record}; bp $t1+0xb14150 ".dump /ma /u ${AdpDumpDirEsc}\\Full Request timed out ${AdpProcName}_.dmp;g"; .printf"*breakpoint list*\n"; bl}  </keyword> 
    </KeyWords> 
    <Settings> 
        <Option> NoDumpOnFirst </Option> 
        <RunMode> CRASH </RunMode> 
    </Settings> 
    <PreCommands> 
     <DebugActions> loadbysos; GetJIT; JITAddress </DebugActions> 
    </PreCommands> 
</ADPlus> 
+1

好,一個線程中止,但沒有您的網站,或不?也許是休息時間,或者池回收就是這樣做的。你有很多線程中止? – Aristos

回答

4

此日誌表明你有一個超時的地方。但是你的計算機上必須有一些其他事件顯示在巫婆頁面中,你有這個時間。

如果您有很多次需要找到導致該問題的頁面,可能是下載頁面來保存會話,或者需要比Timeout集合更多的時間運行的頁面。

這個執行timeout設置在web.config中的110秒默認值:

<system.web> 
    <httpRuntime executionTimeout="110"/> 
</system.web> 
+0

「System.Data.DataException:數據異常 線程正在中止。」發生在我的日誌中的各種途徑。我試圖按照列出的文章中的說明設置一個斷點,該斷點將生成一個轉儲文件,並允許我看到導致此異常的實際堆棧跟蹤。我的問題是確定在文章中描述的配置文件中設置哪個地址。 – jlo

+0

你有沒有想過問題是什麼?我在調用Web服務時遇到了ThreadAbortedExceptions,但無法使用IIS7中的示例服務在本地重現此問題。 – jaffa

+0

@jaffa由於某些原因,有時間,超時,你無法避免。但是你不應該在正常行爲上超時,並且不要讓糟糕的設計和超時,因爲sql運行時間太長,或者代碼會花費太多的時間來完成。 – Aristos