【问题标题】:How do I debug a program that runs in debug, builds and deploys without error, but then errors in UnityPlayer.dll?如何调试在调试中运行的程序,构建和部署没有错误,但 UnityPlayer.dll 中出现错误?
【发布时间】:2018-10-20 21:47:13
【问题描述】:

我正在 Unity 2017.4 中开发混合现实工具,该项目通过编辑器中的远程仿真和编辑器本身在 Hololens 上运行,该项目从 Visual Studio 2017 构建并部署到模拟器和设备。但是当程序运行 UnityPlayer.dll 会引发两个断点之一,即 0x0000003 或 0x0000005。这是我的调用堆栈:

UnityPlayer.dll!623d51fb() 未知

[下面的帧可能不正确和/或丢失,没有为 UnityPlayer.dll 加载符号]

UnityPlayer.dll!623d5703() 未知

UnityPlayer.dll!623d58d7() 未知

UnityPlayer.dll!61b1d66d() 未知

...

UnityPlayer.dll!630b22e2() 未知

UnityPlayer.dll!630b2444() 未知

UnityPlayer.dll!630bed92() 未知

[外部代码]

它还说,当抛出这些错误并且我将调试器设置为混合或本机时,找不到 UnityPlayer_UAP_x86_debug_dotnet.pdb。在托管它只是抛出这 2 个错误,目前 0x0000005 似乎更频繁地发生。

感谢 Josh Peterson 的评论,这里有一个希望更好的调用堆栈:

UnityPlayer.dll!OutOfMemoryError() 未知

UnityPlayer.dll!MemoryManager::Allocate(unsigned int,unsigned int,struct MemLabelId const &,enum AllocateOptions,char const *,int) 未知

UnityPlayer.dll!MemoryManager::Reallocate(void *,unsigned int,unsigned int,struct MemLabelId const &,enum AllocateOptions,char const *,int) 未知

UnityPlayer.dll!realloc_internal(void *,unsigned int,unsigned int,struct MemLabelId const &,enum AllocateOptions,char const *,int) 未知

UnityPlayer.dll!dynamic_array::reserve(unsigned int) 未知

UnityPlayer.dll!DecompressSubprogramBlob() 未知

UnityPlayer.dll!Shader::Transfer >(class StreamedBinaryRead &) 未知

...

UnityPlayer.dll!Platform::Details::__abi_FunctorCapture,void,struct Windows::Foundation::IAsyncAction ^>::Invoke(struct Windows::Foundation::IAsyncAction ^) 未知

UnityPlayer.dll!Windows::System::Threading::WorkItemHandler::[Windows::System::Threading::WorkItemHandler::__abi_IDelegate]::__abi_Windows_System_Threading_WorkItemHandler___abi_IDelegate____abi_Invoke(struct Windows::Foundation::IAsyncAction ^) 未知

threadpoolwinrt.dll!734c4c6f() 未知

[下面的帧可能不正确和/或丢失,没有为 threadpoolwinrt.dll 加载符号]

[外部代码]

【问题讨论】:

  • 欢迎来到 Stack Overflow!我删除了非描述性的额外行,所以这更容易阅读。我也尝试将您的问题作为标题中的一个问题来捕获,因此希望它会更容易被发现。我还从新标题中排除了标签,因为这些标签是默认为搜索引擎编码的。祝你好运!

标签: c# unity3d uwp hololens windows-mixed-reality


【解决方案1】:

Unity 确实发布了调试符号,您至少应该能够从本机调用堆栈中获取函数名称。有关如何连接到 Unity 符号服务器的信息,请参阅此文档:https://docs.unity3d.com/Manual/WindowsDebugging.html

【讨论】:

    【解决方案2】:

    需要检查的一些事项:

    • 在 Visual Studio 中,尝试在 Release 配置而不是 Debug 中构建。
    • 在 Unity 中,尝试在 WSA 的播放器设置中更改脚本后端。 .NET 后端的运气比 IL2CPP 后端好。
    • 更新 VS2017。我们遇到了一个特定版本的 VS2017 破坏构建的问题(虽然我不记得是哪一个)。

    【讨论】:

    • 现在完成所有这些。我显然需要一个 VS 更新,并且我已经在 .NET 后端运行,即将尝试再次使用 IL2CPP 进行重建。我现在正在发布,但遇到了同样的问题。
    猜你喜欢
    • 2011-01-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-06
    • 2020-03-06
    相关资源
    最近更新 更多