我有一个C#,多线程,TCP服务器应用程序在Mono上运行。这是在过去的4年中运行在100多台服务器上的同一款应用程序,没有任何问题。我在Windows上编译该应用程序,然后将其装入到Ubuntu的机器上并运行它..Ubuntu上的Mono堆栈/堆损坏导致分段错误
它的伟大工程!
然而,与OVH(通过OneProvider)单,出现以下错误崩溃之前的过程中一次只能运行约20分钟托管两组全新服务器:
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空对象的异常或设置类级别枚举值(这== 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;
至于I C告诉有没有.NET应该与字符串格式化异常或此设置枚举值崩溃的情况。
在我看来,什么是单声道的记忆和整个堆栈的踩踏越来越搞砸了。
的问题是,什么是关于引起该问题这两个特定的服务器?他们运行与所有其他服务器Ubuntu(14.04.2)相同的设置,具有相同版本的Mono(3.2.8)和相同的编译.net应用程序。
我们已经重新加载服务器数次用新鲜的Ubuntu没有运气安装。我们尝试过各种版本的Mono,并试图针对不同版本的框架(3.4 + 4)。不同的错误会导致崩溃,但结果总是相同的。
系统负载和内存在发生崩溃时都很好。这两台机器有32GB的ram,运行时只有100mb的单声道。还有很多可用的磁盘空间(1.7TB)。
如果这是新硬件,它听起来像是错误的。你有没有运行BIOS内存测试? –
我不知道硬件是否是新的,但它是一个相当不错的规格,所以我不认为它们很旧。 OneProvider向我保证硬件是好的,奇怪的是它发生在同一个数据中心托管的两台机器上。所有其他应用程序似乎运行良好,但公平地说,没有其他的东西 – antfx
它甚至可能是一个并发问题...不同的机器,不同的并发问题 – xanatos