System.Data.OracleClient.dll 在 w2k8 上导致 w3wp.exe 崩溃
我正在使用 Windbg 来调试 Windows Server 2008、IIS7 环境中的网站中发生的错误。我已将符号路径设置为“SRV*c:\websymbols*http://msdl.microsoft.com /download/symbols”
然后我浏览网站,进入登录页面。在那一刻,我将 Windbg 附加到 w3wp.exe 进程。然后,我在登录页面中输入我的凭据并提交表单,这是出现问题的过程。然后我选择 Windbg ->调试-> Go Unhandled Exception,它在控制台中输出以下内容:
ModLoad: 6d720000 6d835000 C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Data.OracleC#\fb8da45f3873169a502db3cb492b25a0\System.Data.OracleClient.ni.dll
ModLoad: 06a80000 06afb000 System.Data.OracleClient.dll
ModLoad: 06b00000 06b7b000 System.Data.OracleClient.dll
ModLoad: 06a80000 06afb000 C:\Windows\assembly\GAC_32 \System.Data.OracleClient\2.0.0.0__b77a5c561934e089\System.Data.OracleClient.dll
ModLoad: 06b80000 06be1000 C:\XEClient\bin\oci.dll
ModLoad: 7c340000 7c396000 C:\Windows\system32\MSVCR71.dll
ModLoad: 06c50000 09af9000 C:\XEClient\bin\OraOCIXE10.dll
ModLoad: 739d0000 73a02000 C:\Windows\system32\WINMM.dll
ModLoad: 73990000 739cd000 C:\Windows\system32\OLEACC.dll
Critical error detected c0000374
之后,我多次按 F10,直到将以下内容打印到输出中,调试器继续思考:
eax=05cbe288 ebx=00000000 ecx=76e47463 edx=05cbe025 esi=001a0000 edi=01fb3210
eip=76ebfaf3 esp=05cbe274 ebp=05cbe2f0 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
ntdll!RtlReportCriticalFailure+0x56:
76ebfaf3 e89063fbff call ntdll!RtlRaiseException (76e75e88)
0:023> p
(5b0.b5c): Unknown exception - code c0000374 (first chance)
一旦调试器最终继续,它会将以下内容打印到控制台:
WARNING: Step/trace thread exited
eax=000000c0 ebx=00000000 ecx=00000400 edx=00000000 esi=04420000 edi=000005b0
eip=76e75e74 esp=05cbdd88 ebp=05cbde0c iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000202
ntdll!KiFastSystemCallRet:
76e75e74 c3 ret
然后 w3wp.exe 死亡。
我的问题是...我怎样才能获得有关该错误的更多信息?我已经知道它与 Oracle 有关,因为如果我将以下内容放入 global.asax Application_Start 方法中,错误就会消失:
尝试{
new OracleConnection().ConnectionString = "任何东西";
}catch(异常){
}
这行简单的代码修复了应用程序......难以置信,对吧?
提前致谢
更新:2011.02.09 15:46
该网络应用程序在 Windows XP 和 Windows 上运行良好。 Windows Server 2003、IIS 5 和6.
Global.asax
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
Logger.LogMessage("Application_Start", "Started");
}
protected void Application_End()
{
Logger.LogMessage("Application_End", "ended");
}
LoginController.cs
public ActionResult LogOn()
{
string connString = "Data Source=IP:Port/Service;Persist Security Info=True;User ID=user; Password=user;Unicode=True";
System.Data.OracleClient.OracleConnection dbConn = new System.Data.OracleClient.OracleConnection();
dbConn.ConnectionString = connString;
System.Data.OracleClient.OracleCommand dbComm = new System.Data.OracleClient.OracleCommand();
dbComm.CommandText = "user.package.procedure";
dbComm.CommandType = CommandType.StoredProcedure;
dbComm.Connection = dbConn;
dbComm.Parameters.Add("MyParam", System.Data.OracleClient.OracleType.Number);
dbComm.Parameters["MyParam"].Value = DBNull.Value;
System.Data.OracleClient.OracleDataAdapter dbAdap = new System.Data.OracleClient.OracleDataAdapter(dbComm);
DataSet ds = new DataSet();
try {
Logger.LogMessage("TEST", "1");
dbConn.Open();
Logger.LogMessage("TEST", "2");
dbAdap.Fill(ds);
Logger.LogMessage("TEST", "3");
} catch(Exception ex) {
Logger.LogMessage("TEST", "4");
} finally {
Logger.LogMessage("TEST", "5");
if(dbConn.State != ConnectionState.Closed) {
dbConn.Close();
}
dbConn.Dispose();
}
return View();
}
现在奇怪的是:您安装了该网站。浏览一下。您将进入登录页面。 w3wp.exe 现已上线。输入凭据并提交表单。一切都好。您登录该网站并开始浏览其页面。所有页面都有 Oracle 交互。
停止浏览。
停止浏览几分钟后,w3wp.exe 就会消失。没关系。除非您另有指定,否则它必须发生。
再次浏览。您将进入登录页面,并且 w3wp.exe 再次启动。输入凭据并单击提交。执行“dbConn.Open();”行时代码停止
我在日志中看到的是:
- Application_Start - Started
- TEST - 1
大约 1 分钟后,我在日志中看到以下内容:
- Application_Start - Started
- TEST - 1
之后,应用程序仅显示“Internet Explorer 无法显示网页”页面。
日志不显示捕获的“TEST - 4”原因,也不显示 global.asax 方法的“Application_End - Ended”原因。
EventViewer 没有帮助,因为它只显示 w3wp.exe 失败。
现在更奇怪的是。如果我在 Application_Start 方法中应用以下行,应用程序将正常工作:
尝试{ new System.Data.OracleClient.OracleConnection().ConnectionString = "任何东西"; }catch(异常前){ }
它抛出一个异常,表示连接字符串格式无效。但应用程序有效。
我对 Windbg 有何期望?我期待它能给我一些可以在谷歌中浏览的东西,然后谷歌带我到一些博客,其中一个人写了“你必须重新安装 Oracle 10g”或类似的东西......
再次感谢。
I'm using Windbg to debug an error that is happening in a website that we have on a Windows Server 2008, IIS7 environment. I've set the symbol path to "SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols"
Then I browse the website, which takes me to the login page. In that moment I attach Windbg to the w3wp.exe process. I then enter my credentials into the login page and submit the form, which is the process that is giving problems. I then select Windbg -> Debug -> Go Unhandled Exception, which outputs the following in the console:
ModLoad: 6d720000 6d835000 C:\Windows\assembly\NativeImages_v2.0.50727_32\System.Data.OracleC#\fb8da45f3873169a502db3cb492b25a0\System.Data.OracleClient.ni.dll
ModLoad: 06a80000 06afb000 System.Data.OracleClient.dll
ModLoad: 06b00000 06b7b000 System.Data.OracleClient.dll
ModLoad: 06a80000 06afb000 C:\Windows\assembly\GAC_32 \System.Data.OracleClient\2.0.0.0__b77a5c561934e089\System.Data.OracleClient.dll
ModLoad: 06b80000 06be1000 C:\XEClient\bin\oci.dll
ModLoad: 7c340000 7c396000 C:\Windows\system32\MSVCR71.dll
ModLoad: 06c50000 09af9000 C:\XEClient\bin\OraOCIXE10.dll
ModLoad: 739d0000 73a02000 C:\Windows\system32\WINMM.dll
ModLoad: 73990000 739cd000 C:\Windows\system32\OLEACC.dll
Critical error detected c0000374
After that I hit F10 many times until the following is print to the output and debugger keep thinking:
eax=05cbe288 ebx=00000000 ecx=76e47463 edx=05cbe025 esi=001a0000 edi=01fb3210
eip=76ebfaf3 esp=05cbe274 ebp=05cbe2f0 iopl=0 nv up ei pl zr na pe nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000246
ntdll!RtlReportCriticalFailure+0x56:
76ebfaf3 e89063fbff call ntdll!RtlRaiseException (76e75e88)
0:023> p
(5b0.b5c): Unknown exception - code c0000374 (first chance)
Once debugger finally continues, it prints the following to the console:
WARNING: Step/trace thread exited
eax=000000c0 ebx=00000000 ecx=00000400 edx=00000000 esi=04420000 edi=000005b0
eip=76e75e74 esp=05cbdd88 ebp=05cbde0c iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000202
ntdll!KiFastSystemCallRet:
76e75e74 c3 ret
Then w3wp.exe dies.
My question is... How can I get some more info about the error? I already knew it was related to Oracle because errors dissapear if I just put the following in the global.asax Application_Start method:
try{
new OracleConnection().ConnectionString = "anything";
}catch(Exception ex){
}
That simple line of code fixes the application... Incredible, right?
Thanks in advance
UPDATE: 2011.02.09 15:46
The web app is working fine in Windows XP & Windows Server 2003, IIS 5 & 6.
Global.asax
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
Logger.LogMessage("Application_Start", "Started");
}
protected void Application_End()
{
Logger.LogMessage("Application_End", "ended");
}
LoginController.cs
public ActionResult LogOn()
{
string connString = "Data Source=IP:Port/Service;Persist Security Info=True;User ID=user; Password=user;Unicode=True";
System.Data.OracleClient.OracleConnection dbConn = new System.Data.OracleClient.OracleConnection();
dbConn.ConnectionString = connString;
System.Data.OracleClient.OracleCommand dbComm = new System.Data.OracleClient.OracleCommand();
dbComm.CommandText = "user.package.procedure";
dbComm.CommandType = CommandType.StoredProcedure;
dbComm.Connection = dbConn;
dbComm.Parameters.Add("MyParam", System.Data.OracleClient.OracleType.Number);
dbComm.Parameters["MyParam"].Value = DBNull.Value;
System.Data.OracleClient.OracleDataAdapter dbAdap = new System.Data.OracleClient.OracleDataAdapter(dbComm);
DataSet ds = new DataSet();
try {
Logger.LogMessage("TEST", "1");
dbConn.Open();
Logger.LogMessage("TEST", "2");
dbAdap.Fill(ds);
Logger.LogMessage("TEST", "3");
} catch(Exception ex) {
Logger.LogMessage("TEST", "4");
} finally {
Logger.LogMessage("TEST", "5");
if(dbConn.State != ConnectionState.Closed) {
dbConn.Close();
}
dbConn.Dispose();
}
return View();
}
Now the curious thing: You install the website. Browse it. You're taken to Login page. w3wp.exe is now live. Enter credentials an submit form. Everything is ok. You log on to the site and start navigating through its pages. All pages have Oracle interaction.
Stop browsing.
Some minutes after you stopped browsing, w3wp.exe dies. It is ok. It must happen unless you specify otherwise.
Browse again. You are taken to login page and w3wp.exe is live again. Enter credentials and click submit. Code stops when executing the line "dbConn.Open();"
What I see in the log is:
- Application_Start - Started
- TEST - 1
After 1 minute or so, I see the following in the log:
- Application_Start - Started
- TEST - 1
After that, application just display the "Internet Explorer cannot display the webpage" page.
Log does not show "TEST - 4" cause of the catch neither it shows "Application_End - Ended" cause of the global.asax method.
EventViewer is not helpful, since it only says that w3wp.exe has failed.
Now the even more courious thing. If I apply following line in Application_Start method, application works:
try{
new System.Data.OracleClient.OracleConnection().ConnectionString = "anything";
}catch(Exception ex){
}
It throws an exception saying that connection string format is invalid. But application works.
What am I expecting from Windbg? I'm expecting it to gives me something I can browse in google and then google takes me to some blog where a guy wrote that "you have to reinstall Oracle 10g" or something like that...
Thanks again.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来像托管异常
诊断托管代码异常的步骤
.loadby sos
对于 .NET 3.5 和 .NET 4.0 使用mscorwks
.loadby sos clr
sxe -c "!clrstack;!pe;KB" clr ;g 当存在托管异常时,这会中断调试器
,并为您提供托管/本机调用堆栈以及异常详细信息。
Looks like a managed exception
Steps to diagnose managed code Exception
.loadby sos
for up to .NET 3.5 and for .NET 4.0 usemscorwks
.loadby sos clr
sxe -c "!clrstack;!pe;KB" clr ;g
This would break the debugger when there is a managed exception and provide you with managed /native call-stack as well as exception details.
我不知道“w3wp.exe”死亡是什么意思。您能在 Windows 事件日志中看到是否有任何 IIS 错误吗?
如果您不熟悉实时调试,则调试诊断崩溃规则可能是捕获故障转储的更好方法,
http:// /support.microsoft.com/kb/919789
分析故障转储是解决崩溃问题的更清晰方法。
I don't know what do you mean by "w3wp.exe" dies. Can you see in Windows event log if there is any IIS error?
Debug Diag crash rule can be a better way to capture crash dumps if you are not familiar with live debugging,
http://support.microsoft.com/kb/919789
Analyzing crash dumps is a clearer approach for crash issues.