gpt4 book ai didi

c# - Ubuntu 上的 Mono 堆栈/堆损坏导致段错误

转载 作者:行者123 更新时间:2023-12-04 18:51:53 26 4
gpt4 key购买 nike

我有一个在 Mono 上运行的 C#、多线程、TCP 服务器应用程序。这是过去 4 年在 100 多台服务器上运行的同一个应用程序,没有任何问题。我在 Windows 上编译该应用程序,然后将其加载到 Ubuntu 机器上并运行它。

效果很好!

但是,在由 OVH 托管的两台新服务器上(通过 OneProvider )该进程一次只运行大约 20 分钟,然后 Mono 崩溃并出现以下错误:

mono-0 (err): =================================================================
mono-0 (err): Got a SIGSEGV while executing native code. This usually indicates
mono-0 (err): a fatal error in the mono runtime or one of the native libraries
mono-0 (err): used by your application.
mono-0 (err): =================================================================

在单声道崩溃之前,我在应用程序中捕获异常并将其输出到控制台,异常总是不同的并且总是很奇怪。例如,String.Format 中的空对象异常或设置类级别枚举值时的空对象异常(this == null??)

示例 1
mono-0 (out): System.NullReferenceException: Object reference not set to an instance of an object
mono-0 (out): at System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
mono-0 (out): at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in <filename unknown>:0
mono-0 (out): at System.String.Format (System.String format, System.Object arg0, System.Object arg1) [0x00000] in <filename unknown>:0
mono-0 (out): at server.handleClinet.logConsole (System.String msg) [0x00000] in <filename unknown>:0

示例 2
mono-0 (err): Unhandled Exception:
mono-0 (err): System.ArgumentNullException: Argument cannot be null.
mono-0 (err): Parameter name: obj
mono-0 (err): at server.handleClinet.set_ConnState (ConnectionState value) [0x00000] in <filename unknown>:0
mono-0 (err): at server.handleClinet.doConnect (System.Object p) [0x00000] in <filename unknown>:0
mono-0 (err): at System.Threading.Thread.StartInternal () [0x00000] in <filename unknown>:0
mono-0 (err): [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentNullException: Argument cannot be null.
mono-0 (err): Parameter name: obj
mono-0 (err): at server.handleClinet.set_ConnState (ConnectionState value) [0x00000] in <filename unknown>:0
mono-0 (err): at server.handleClinet.doConnect (System.Object p) [0x00000] in <filename unknown>:0
mono-0 (err): at System.Threading.Thread.StartInternal () [0x00000] in <filename unknown>:0

在这种情况下 ConnState是一个枚举,这是行:
ConnState = ConnectionState.Starting;

据我所知,.NET 不会因字符串格式异常或此设置枚举值而崩溃。

在我看来,有什么东西踩到了单声道的内存,整个堆栈都被搞砸了。

问题是,导致问题的这两个特定服务器是什么? 它们运行与所有其他服务器相同的设置,Ubuntu (14.04.2),具有相同版本的 Mono (3.2.8) 和相同的编译 .net 应用程序。

我们已经用全新的 Ubuntu 安装了几次服务器,但都没有成功。我们尝试了各种版本的 Mono 并尝试针对不同版本的框架(3.4 + 4)。崩溃会因错误不同而略有变化,但结果始终相同。

崩溃时系统负载和内存都很好。两台机器都有 32GB 的内存,单声道运行时只使用大约 100mb。还有大量可用磁盘空间(1.7TB)。

最佳答案

看起来这是从 3.13.0-48 引入内核的错误。向前。

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1450584

我们已回滚到 3.13.0-30直到 3.13.0-54被释放并且崩溃已经停止。

关于c# - Ubuntu 上的 Mono 堆栈/堆损坏导致段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30543510/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com