简体   繁体   English

在Debian上启动.NET Core应用程序时出现分段错误

[英]Segmentation fault when launching .NET Core app on Debian

标题中的所有内容都在显示,如果我尝试运行dotnet,则退出时不会显示任何消息,但是在DLL上使用dotnet exec会输出“分段错误”并退出。

Okay, so another developer working on the project found the problem. 好的,所以另一个从事该项目的开发人员发现了问题。 I caused a stack overflow (how convenient) on one of the custom attributes I made. 我在我创建的一个自定义属性上导致了堆栈溢出(多么方便)。 Here's the code: 这是代码:

private string Message
{
    get
    {
        return this.Message;
    }
    set
    {
        this.Message = value;
    }
}

So basically, it was calling itself indefinitely. 因此,基本上,它是无限期地调用自己。 What I was supposed to do instead was create a second string to access it from: 我应该做的是创建第二个字符串来从以下位置访问它:

private string Message
{
    get
    {
        return this.message;
    }
    set
    {
        this.message = value;
    }
}

private string message;

Hope it helps some of you! 希望对您有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM