首页 > 解决方案 > LINUX - 我的 Unity 游戏的构建在几个小时后崩溃 - 收到未处理的 NULL 异常

问题描述

问题描述:

构建崩溃并在几个小时后自行关闭(通常在 4 到 12 小时之间),并在日志中打印此消息:

Receiving unhandled NULL exception

#0  0x00000000ff382c in std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector()
#1  0x0000000102c983 in std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector()
#2  0x0000000102d9c5 in std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector()
#3  0x00000000c07080 in operator new[](unsigned long, std::nothrow_t const&)
#4  0x00000000c0719f in operator new[](unsigned long, std::nothrow_t const&)
#5  0x00000000c07522 in operator new[](unsigned long, std::nothrow_t const&)
#6  0x00000000c07798 in operator new[](unsigned long, std::nothrow_t const&)
#7  0x00000000c078db in operator new[](unsigned long, std::nothrow_t const&)
#8  0x00000000cb8d90 in operator new[](unsigned long, std::nothrow_t const&)
#9  0x007f29dc9ff182 in start_thread
#10 0x007f29dc926b1f in clone

技术规格:

已完成测试(未修复错误):

卷曲错误6:无法解析主机:cdp.cloud.unity3d.com

 #0 std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector()
 #1 ???
 #2 std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector()
 #3 std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector()
 #4 std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector()
 #5 operator new[](unsigned long, std::nothrow_t const&)
 #6 operator new[](unsigned long, std::nothrow_t const&)
 #7 operator new[](unsigned long, std::nothrow_t const&)
 #8 operator new[](unsigned long, std::nothrow_t const&)
 #9 operator new[](unsigned long, std::nothrow_t const&)
 #10 operator new[](unsigned long, std::nothrow_t const&)
 #11 start_thread
 #12 clone

从之前的测试中收集的信息:

调试日志堆栈跟踪

DebugLog from Update!

#0 std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector()
#1 std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector()
#2  (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,string,UnityEngine.Object)
#3 mono_print_method_from_ip
#4 mono_perfcounter_foreach
#5 mono_runtime_invoke
#6 operator new[](unsigned long, std::nothrow_t const&)
#7 operator new[](unsigned long, std::nothrow_t const&)
#8 operator new[](unsigned long, std::nothrow_t const&)
#9 operator new[](unsigned long, std::nothrow_t const&)
#10 operator new[](unsigned long, std::nothrow_t const&)
#11 operator new[](unsigned long, std::nothrow_t const&)
#12 operator new[](unsigned long, std::nothrow_t const&)
#13 ???
#14 __libc_start_main
#15 ???

“不同的接收未处理的 NULL 异常”

Receiving unhandled NULL exception 

#0  0x007f1056492bf4 in nouveau_drm_screen_create 
#1  0x007f1056495aa0 in nouveau_drm_screen_create 
#2  0x007f10561a878f in nouveau_drm_screen_create 
#3  0x007f1056235c84 in nouveau_drm_screen_create 
#4  0x007f1056235f87 in nouveau_drm_screen_create 
#5  0x000000010dcf2a in std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector() 
#6  0x000000010f1169 in std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector() 
#7  0x00000000b01116 in operator new[](unsigned long, std::nothrow_t const&) 
#8  0x000000010ef244 in std::vector<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >, std::allocator<std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > > > >::~vector() 
#9  0x00000000924e9b in std::pow(float, float) 
#10 0x000000009209e2 in std::pow(float, float) 
#11 0x00000000920b19 in std::pow(float, float) 
#12 0x00000000cb8d90 in operator new[](unsigned long, std::nothrow_t const&) 
#13 0x007f105b6ed182 in start_thread 
#14 0x007f105b614b1f in clone

处理信号日志

1601585247770866   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585247770920   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585247770934   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585247771012   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585247771033   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585247771101   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585247771112   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585247790047   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585247790085   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585247790098   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585247790155   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585247790171   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585247790234   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585247790245   Thu Oct  1 22:47:27 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585252704451   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585252704506   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585252704570   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585252704591   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585252704653   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585252704673   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585252704685   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGPWR    MyGame.x86_
1601585252723584   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585252723644   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585252723698   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585252723716   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585252723799   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585252723819   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585252723829   Thu Oct  1 22:47:32 2020 CEST        MyGame.x86_   30851   SIGXCPU   MyGame.x86_
1601585253349839   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSEGV   MyGame.x86_
1601585253360946   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGABRT   MyGame.x86_
1601585253471368   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253471658   Thu Oct  1 22:47:33 2020 CEST        MyGame:cs0   30851   SIGSTOP   gdb
1601585253471690   Thu Oct  1 22:47:33 2020 CEST        MyGame:sh0   30851   SIGSTOP   gdb
1601585253471704   Thu Oct  1 22:47:33 2020 CEST        MyGame:sh1   30851   SIGSTOP   gdb
1601585253471731   Thu Oct  1 22:47:33 2020 CEST        MyGame:sh2   30851   SIGSTOP   gdb
1601585253471752   Thu Oct  1 22:47:33 2020 CEST        MyGame:sh3   30851   SIGSTOP   gdb
1601585253471763   Thu Oct  1 22:47:33 2020 CEST        MyGame:sh4   30851   SIGSTOP   gdb
1601585253471774   Thu Oct  1 22:47:33 2020 CEST        MyGame:sh5   30851   SIGSTOP   gdb
1601585253471859   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253471890   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253471904   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253471917   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253471937   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253471953   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253471968   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253471980   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253471990   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472015   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472027   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472043   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472059   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472074   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472084   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472103   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472121   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472136   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472150   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472165   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472176   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472194   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472208   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472223   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472246   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472275   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472291   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472316   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472333   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472348   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472363   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472391   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472408   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472418   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472435   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472451   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472482   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585253472593   Thu Oct  1 22:47:33 2020 CEST        MyGame.x86_   30851   SIGSTOP   gdb
1601585254227807   Thu Oct  1 22:47:34 2020 CEST        MyGame.x86_   30851   SIGCHLD   gdb
1601585254227927   Thu Oct  1 22:47:34 2020 CEST        MyGame.x86_   30851   SIGABRT   MyGame.x86_
1601585254309322   Thu Oct  1 22:47:34 2020 CEST        MyGame.x86_   30851   SIGPIPE   MyGame.x86_
1601585254309342   Thu Oct  1 22:47:34 2020 CEST        MyGame.x86_   30851   SIGPIPE   MyGame.x86_

使用的资源:

我使用以下脚本来拦截信号,使用命令“sudo stap myscript.stp”运行它。

#! /usr/bin/env stap

probe signal.send {
  if ((isinstr(pid_name, "MyGame"))) {
      printf("%10d   %-34s   %-10s   %5d   %-7s   %s\n",
      gettimeofday_us(), tz_ctime(gettimeofday_s()),
      pid_name, sig_pid, sig_name, execname());
  }
}


probe begin {
  printf("systemtap script started at: %s\n\n", tz_ctime(gettimeofday_s()));
  printf("%50s%-18s\n", "",  "Signaled Process");
  printf("%-10s   %-34s   %-10s   %5s   %-7s   %s\n",
    "Epoch", "Time of Signal", "Name", "PID", "Signal", "Signaling Process Name");
  printf("---------------------------------------------------------------");
  printf("---------------------------------------------------------------");
  printf("\n");
}

probe end {
  printf("\n");
}

怀疑

我正在尝试做的事情(但我目前陷入困境):

更新 x1:

我能够创建核心转储。你可以在这里找到完整的日志: https ://pastebin.com/1Bm70rNd

虽然异常的本机堆栈跟踪是:

/home/username0/MyGame_Game/Game/MyGame_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so(+0xd5378) [0x7f644c157378]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x15540) [0x7f645dd08540]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb) [0x7f645db463eb]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b) [0x7f645db25899]
MyGame_Game/Game/MyGame.x86_64() [0xd341e6]
/home/username0/MyGame_Game/Game/MyGame_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so(+0x14ea2e) [0x7f644c1d0a2e]    /home/username0/MyGame_Game/Game/MyGame_Data/MonoBleedingEdge/x86_64/libmonobdwgc-2.0.so(+0x5be11) [0x7f644c0dde11]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x15540) [0x7f645dd08540]
MyGame_Game/Game/MyGame.x86_64() [0xb23e60]
MyGame_Game/Game/MyGame.x86_64() [0xff382c]
MyGame_Game/Game/MyGame.x86_64() [0x102c983]
MyGame_Game/Game/MyGame.x86_64() [0x102d9c5]
MyGame_Game/Game/MyGame.x86_64() [0xc07080]
MyGame_Game/Game/MyGame.x86_64() [0xc0719f]
MyGame_Game/Game/MyGame.x86_64() [0xc07522]
MyGame_Game/Game/MyGame.x86_64() [0xc07798]
MyGame_Game/Game/MyGame.x86_64() [0xc078db]
MyGame_Game/Game/MyGame.x86_64() [0xcb8d90]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x9669) [0x7f645dcfc669]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43) [0x7f645dc222b3]

在网上搜索有关此异常的信息,我发现它可能是 Mono 的错误和/或驱动程序兼容性问题。现在我将 Ubuntu 从 19.04 更新到 20.04 以尝试 amdgpu-pro 驱动程序(而不是 Ubuntu 中包含的 amdgpu),因为我找不到适用于 Ubuntu 19.04 的 amdgpu-pro 驱动程序。

标签: linuxunity3dubuntuexceptioncrash

解决方案


最后,我发现我的问题是粒子的 Trail 选项。当我在互联网上搜索时,我发现其他人说轨迹渲染器可能是问题,但我不知道我正在使用它,因为它在粒子内部(我有几个),所以我排除了这个原因。

我还检查了驱动程序兼容性问题,我更新到 Ubuntu 20.04 并安装了 amdgpu-pro 驱动程序,但它没有解决任何问题。

希望这会有所帮助。


推荐阅读