System.Data.dll溢出 [英] System.Data.dll over flow

查看:57
本文介绍了System.Data.dll溢出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.Data.dll中发生了'System.StackOverflowException'类型的未处理异常我在asp.net应用程序中遇到此错误,如何克服这个错误?



提前感谢。

解决方案

在没有任何代码示例的情况下显示异常并不好。但是,通常这个问题很容易解决。



几乎100%的确定这是无限递归或相互递归的结果:

http://en.wikipedia.org/wiki/Recursion [ ^ ],

http://en.wikipedia.org/wiki/Mutual_recursion [ ^ ]。



使用调试器可以非常系统地解决这些问题。首先,您观察抛出异常的位置。在它发生之前设置一个断点并使用调试器窗口调用堆栈。您将看到来电的来源。找出无限递归的原因并设计退出递归的正确条件。通常,如果将调试与简单的逻辑相结合,可以非常快速地找到错误。



您对至少一个试图被调用的方法进行初步猜测无限次数。通常不需要很长时间才能找到这样的地方。你在这种方法的最开始处设置了断点,并尝试确认它发生了。当在断点上停止执行时,您可以向上或向下堆栈。下去更有效:你保持断点并逐步调试这个方法,首先做大步,直到你捕获相同的方法被深度调用堆栈(记住你的断点仍在那里)。当它发生时,你重新开始并向前走一小步,直到找到递归的位置。这一次试图弄清楚为什么永远不会满足递归结束的条件。同时你将你的断点移近递归呼叫的来源,缩小你的网络。



听起来可能很难,但是很少练习总是给出100%的结果,不同于具有一些未知性质的不同错误的情况。如果堆栈溢出,您可以100%确定在开始查找之前可以找到问题。



-SA

"An unhandled exception of type ''System.StackOverflowException'' occurred in System.Data.dll " i m getting this error in asp.net application,how to overcome this one?

thanks in advance.

解决方案

It''s not good to show just the exception without any code sample. However, usually this problem is very easy to solve.

Almost 100% of certainty that this is result of "infinite" recursion or mutual recursion:
http://en.wikipedia.org/wiki/Recursion[^],
http://en.wikipedia.org/wiki/Mutual_recursion[^].

Such problems can be resolved in a very systematic way using the debugger. First, you observe where the exception is thrown. Put a break point before it happens and use the debugger window "Call stack". You will see where the calls come from. Find out the reason for infinite recursion and devise a correct condition of exit from recursion. Usually, the bug can be found very quickly if you combine debugging with simple logic.

You make an initial guess on at least one method which is attempted to get called "infinite" number of times. Usually it does not take long to find such place. You put break point(s) on a very beginning of such method(s) and try to confirm it happens. When the execution is stopped on a breakpoint, you can go up the stack or down the stack. It''s more effective to go down: you keep the breakpoint and debug just one this method stepwise, making big steps at first, until you catch the same method being called deeper in stack (remember your breakpoint is still there). When it happens, you start over and go in smaller step until you pinpoint where the recursion goes. This time try to figure out why the condition of the recursion end is never met. At the same time you move your breakpoint(s) closer to the source of recursive call, narrowing your net.

It may sound difficult, but with little practice always gives 100% results, unlike the cases with different bugs of some unknown nature. In case of stack overflow, you can be 100% sure that you can find the problem before you start looking.

—SA


这篇关于System.Data.dll溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆