惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
P
Privacy International News Feed
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
C
CXSECURITY Database RSS Feed - CXSecurity.com
Know Your Adversary
Know Your Adversary
Security Latest
Security Latest
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Attack and Defense Labs
Attack and Defense Labs
NISL@THU
NISL@THU
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
GbyAI
GbyAI
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Y
Y Combinator Blog
C
CERT Recently Published Vulnerability Notes
N
Netflix TechBlog - Medium
S
Security Affairs
Spread Privacy
Spread Privacy
罗磊的独立博客
腾讯CDC
MyScale Blog
MyScale Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
L
LINUX DO - 热门话题
The Cloudflare Blog
L
LangChain Blog
博客园_首页
H
Hacker News: Front Page
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
SecWiki News
SecWiki News
A
Arctic Wolf
爱范儿
爱范儿
Google Online Security Blog
Google Online Security Blog
T
Threat Research - Cisco Blogs
Hacker News - Newest:
Hacker News - Newest: "LLM"
有赞技术团队
有赞技术团队
The GitHub Blog
The GitHub Blog
Cyberwarzone
Cyberwarzone
博客园 - 叶小钗
V
Visual Studio Blog
V
V2EX
T
Tailwind CSS Blog
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
F
Fortinet All Blogs
MongoDB | Blog
MongoDB | Blog
D
Docker

博客园 - CooS

PowerDesigner使用心得 有意思的图片 到底是顺时针还是逆时针旋转呢? - CooS - 博客园 又是两个小错误 Windows服务 小错误 大杂烩-今天遇到的问题的总结 .NET相关资源 杀毒 请问:javascript 如何新建一个类的对象 如:work w = new work() File.Delete不能删除文件的问题 小试Ajax-下拉框联动 笑话 用google搜索时它会告诉你找到多少页面。这里规定找到页面多的一方胜(zz) 人生的状态是由自己心灵的温度决定的 Oracle函数列表速查(zz) 在oracle9i中创建自增序列-触发器(zz) 背上的爱(zz) 程序人生 - 我已经努力了七年(zz) 美女当道,丑女孩会有爱情吗?(zz)
System.StackOverflowException
CooS · 2006-06-15 · via 博客园 - CooS

System.StackOverflowException

两个类互相调用,出现这个异常,不过这只是一种可能性,参考里是另一种,其他情况Google

class A()
{
 B() b = new B();
 ...
}

class B()
{
 A() a = new A();
 ...
}

StackOverflowException 因执行堆栈溢出错误引发,通常在存在非常深的递归或无界递归时发生。LocallocMicrosoft 中间语言 (MSIL) 指令引发 StackOverflowException

两个类互相调用应该就是无界递归了

Summary

Represents the error that occurs when the execution stack overflows due to too many method calls.

Description

[Note: StackOverflowException is thrown for execution stack overflow errors, typically in the case of a very deep or unbounded recursion.

The localloc IL instruction throws StackOverflowException.

]

Example

The following example demonstrates an error that causes a StackOverflowException exception.
using System;
public class StackOverflowExample {
public static void recursion() { recursion(); }
public static void Main() {
try {
recursion();
}
catch(StackOverflowException e) {
Console.WriteLine("Error caught: {0}", e);
}
}
}
The output is

Error caught: System.StackOverflowException: Exception of type System.StackOverflowException was thrown.