执行本机代码时出现 SIGABRT - Cloudformation 期间在 AWS 上 运行 xsp4 时出错

Got a SIGABRT while executing native code - error when running xsp4 on AWS during Cloudformation

我在 AWS Ubuntu AMI 上启动 xsp4 服务器时遇到错误。错误是initialize: mono_thread_create_internal () failed,然后:

Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.

同样的命令在我自己的电脑上执行没有错误。知道错误是什么 - 可能是缺少包、某些配置或类似的东西?

编辑: 嗯,这很奇怪,当我通过 ssh 登录并手动 运行 命令时它正在工作。然而,我需要在 CloudFormation 期间 运行 它,但它在那里失败了。可能在 CloudFormation 期间还没有完全设置,或者用户帐户不同?但转念一想,CloudFormation 运行 不是 root 吗?

完整日志:

+ xsp4 --端口 80
Cloud-init v. 0.7.9 运行ning 'modules:final' 2017 年 10 月 22 日星期日 17:18:30 +0000。上升 12.78 秒。
Cloud-init v. 0.7.9 于 2017 年 10 月 22 日星期日 17:19:27 +0000 完成。数据源 DataSourceEc2。上升 69.50 秒
xsp4
监听地址:0.0.0.0
根目录:/var/www/HelloWebApi
侦听端口:80(非安全)
点击 Return 停止服务器。
服务器未启动。
  在 Mono.WebServer.ApplicationServer.Stop () 在 :0
  at (wrapper remoting-invoke-with-check) Mono.WebServer.ApplicationServer:Stop ()
  在 Mono.WebServer.XSP.Server.DebugMain(System.String[] args,布尔根,IApplicationHost ext_apphost,布尔安静)在:0
初始化:mono_thread_create_internal () 失败
堆栈跟踪:

  在
  在(包装器管理到本机)System.Net.Sockets.Socket.socket_pool_queue (System.Net.Sockets.SocketAsyncCallback,System.Net.Sockets.SocketAsyncResult)
  在 System.Net.Sockets.Socket.QueueSocketAsyncResult (System.Collections.Generic.Queue`1,System.Net.Sockets.SocketAsyncWorker,System.Net.Sockets.SocketAsyncResult)
  在 System.Net.Sockets.Socket.AcceptAsync (System.Net.Sockets.SocketAsyncEventArgs)
  在 Mono.WebServer.ApplicationServer.运行 服务器 ()
  在 System.Threading.ThreadHelper.ThreadStart_Context(对象)
  在 System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
  在 System.Threading.ExecutionContext.运行 (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
  在 System.Threading.ExecutionContext.运行 (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
  在 System.Threading.ThreadHelper.ThreadStart ()
  在(包装器运行time-invoke)object.runtime_invoke_void__this__(对象,intptr,intptr,intptr)

本机堆栈跟踪:

        /usr/bin/mono() [0x49ff2f]
        /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390) [0x7f39c549b390]
        /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38) [0x7f39c50f5428]
        /lib/x86_64-linux-gnu/libc.so.6(中止+0x16a) [0x7f39c50f702a]
        /usr/bin/mono() [0x630409]
        /usr/bin/mono() [0x63069c]
        /usr/bin/mono() [0x63076f]
        /usr/bin/mono() [0x58e6e5]
        [0x4044ec36]

来自 gdb 的调试信息:


================================================ ===============
执行本机代码时收到 SIGABRT。这通常表明
单声道 运行 时间或本机库之一中的致命错误
由您的应用程序使用。
================================================ ===============

如果它在 SSH 之后工作而不是直接工作,他们很可能是缺少 TTY 的问题。如果您的服务器需要 TTY,那么它不会以这种方式启动

正如您在回复中提到的那样,xsp4 等待回车键退出并执行 --nonstop 如果您不想要这种行为,那么您应该使用该参数。它将确保不需要 TTY。

如果可执行文件实际上仍然需要 TTY,那么您可以查看 script 命令。哪个确实分配了一个 TTY 并执行了命令。详情见下文

http://man7.org/linux/man-pages/man1/script.1.html