Unity crash when build a mod for OSX/Linux

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Unity crash when build a mod for OSX/Linux

Post by King of Worms »

Pls help. It just blackscreens and crashes when I try to build for OSX or linux :X

I captured both Editor.logs here, is it even the CORRECT FILE?
Also, Im incredibly inclined to drop the support for osx and linux, its just few guys downloading it and so much additional work to deal with.. like this for example
Desktop.rar
(20.56 KiB) Downloaded 71 times
It seems the required parts are installed?
a.jpg
a.jpg (75.18 KiB) Viewed 1376 times

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Unity crash when build a mod for OSX/Linux

Post by Interkarma »

There's a long stack track at end of editor log. It's only slightly different between OSX and Linux and most of the same errors crop up.

I unfortunately don't have an answer for you right now, but I'll try to unpack problem a little and maybe that will get us closer.

Things seem to be building OK then suddenly hit a run of these errors:

Code: Select all

d3d11: failed to create 2D texture shader resource view id=13805 [D3D error was 8007000e]
Then it crashes in the guts of Unity editor. A snip of stack trace below.

Code: Select all

at <unknown> <0xffffffff>
  at (wrapper managed-to-native) UnityEditor.AssetDatabase.LoadAssetAtPath (string,System.Type) [0x00008] in <bd70c40e01f641bdb7d836e1e97755bc>:0
  at TMPro.EditorUtilities.TMPro_TexturePostProcessor.OnPostprocessAllAssets (string[],string[],string[],string[]) [0x0008e] in C:\Users\Xerxes\Desktop\DFU Release\DFU MASTER 2019\Library\PackageCache\com.unity.textmeshpro@2.1.4\Scripts\Editor\TMPro_TexturePostProcessor.cs:33
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object_object_object_object (object,intptr,intptr,intptr) [0x0006f] in <26d6947aaca249f092fb5f7156fbe923>:0
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) [0x00016] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) [0x00038] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at System.Reflection.MethodBase.Invoke (object,object[]) [0x00006] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at UnityEditor.AssetPostprocessingInternal.InvokeMethod (System.Reflection.MethodInfo,object[]) [0x00030] in <bd70c40e01f641bdb7d836e1e97755bc>:0
  at UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (string[],string[],string[],string[],string[]) [0x0004f] in <bd70c40e01f641bdb7d836e1e97755bc>:0
  at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object_object_object_object_object (object,intptr,intptr,intptr) [0x00035] in <bd70c40e01f641bdb7d836e1e97755bc>:0
  at <unknown> <0xffffffff>
  at (wrapper managed-to-native) UnityEditor.BuildPipeline.BuildAssetBundlesWithInfoInternal (string,UnityEditor.AssetBundleBuild[],UnityEditor.BuildAssetBundleOptions,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget) [0x0000c] in <bd70c40e01f641bdb7d836e1e97755bc>:0
  at UnityEditor.BuildPipeline.BuildAssetBundles (string,UnityEditor.AssetBundleBuild[],UnityEditor.BuildAssetBundleOptions,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget) [0x00051] in <bd70c40e01f641bdb7d836e1e97755bc>:0
  at UnityEditor.BuildPipeline.BuildAssetBundles (string,UnityEditor.AssetBundleBuild[],UnityEditor.BuildAssetBundleOptions,UnityEditor.BuildTarget) [0x0000d] in <bd70c40e01f641bdb7d836e1e97755bc>:0
  at DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow.BuildMod () [0x0042a] in C:\Users\Xerxes\Desktop\DFU Release\DFU MASTER 2019\Assets\Game\Addons\ModSupport\Editor\CreateModEditorWindow.cs:670
  at DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow/<>c__DisplayClass28_0.<OnGUI>b__4 () [0x00064] in C:\Users\Xerxes\Desktop\DFU Release\DFU MASTER 2019\Assets\Game\Addons\ModSupport\Editor\CreateModEditorWindow.cs:423
  at DaggerfallWorkshop.GUILayoutHelper.Horizontal (DaggerfallWorkshop.GUILayoutHelper/VoidDelegate) [0x0000c] in C:\Users\Xerxes\Desktop\DFU Release\DFU MASTER 2019\Assets\Scripts\Editor\GUILayoutHelper.cs:55
  at DaggerfallWorkshop.Game.Utility.ModSupport.CreateModEditorWindow.OnGUI () [0x00320] in C:\Users\Xerxes\Desktop\DFU Release\DFU MASTER 2019\Assets\Game\Addons\ModSupport\Editor\CreateModEditorWindow.cs:412
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x0004f] in <eae584ce26bc40229c1b1aa476bfa589>:0
  at <unknown> <0xffffffff>
Starting with the initial error, this seems to be most often associated with either out of memory or out of disk space. That's not to say your PC is lacking, it's most likely a bug in Unity that's exploding memory or disk space in some weird way. The Linux log does report out of memory, which lends some weight to this idea.

Code: Select all

0x00007FF7CC71961E ((<unknown>)) (function-name not available)
  ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 00007FF7CD59CAC7)
  ERROR: SymGetModuleInfo64, GetLastError: 'Not enough memory resources are available to process this command.' (Address: 00007FF7CD59CAC7)
Could you keep an eye on RAM, VRAM, and HDD while building and see if Unity editor is consuming all of something when building for these platforms? That might be our starting point to resolve or workaround.

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Unity crash when build a mod for OSX/Linux

Post by King of Worms »

Thanks mate. Ive tested the RAM usage and u are right. Ive build for Win and than OSX, and as soon as OSX started to build and this tab appeared, the RAM usage went from 8 in a linear fashion to 16gb (my max) during 15 seconds and soon afterwards it blackscreened and crashed

This is always the last thing I see when it happens, but I was unable to grab the screen (most likely because my RAM was massacred at the moment) but now Ive succeeded

PS: when testing this, I use a rather small part of the DREAM, just the portraits, so its not because of excessive amount of assets being handled
01.jpg
01.jpg (27.78 KiB) Viewed 1346 times

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Unity crash when build a mod for OSX/Linux

Post by Interkarma »

Thanks for following up. Seems like we're on the right track.

I found a few similar reports out on the web, and one common theme is the memory explosion bug happens with certain texture compression formats.

If you've already isolated the textures where this happens, could you try disabling compression just as a test? And if that works, try a different compression format.

With some luck we might be able to work out what combo of things triggers the memory bug and workaround.

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Unity crash when build a mod for OSX/Linux

Post by King of Worms »

Thank you. Well I tried packing just sounds, so the texture compression is out of the equation (is it?) and the results are still the same. It hangs at the exact same "WaveFormcompute" spot as captured on the screen above. Fills the RAM and paging file completely and crashes.

I used Portraits section just because its a smallest package from the whole Dream, and I wanted to keep it fast and simple.
It seems it doesnt matter what the content of the mod is. It does not even get to that content and crashes before that.

EDIT: Ive tried just the Cinematics (Webm) or Music (ogg) with same crash results

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Unity crash when build a mod for OSX/Linux

Post by Interkarma »

Cheers, at least we know it's not any one type of asset.

Any chance you can make a "mini-DREAM" mod project that reproduces crash with only a few assets? If you're able to send me a zip to repro on my end, I can start noodling with the problem here.

I'm also happy to try with your full project if you don't mind zipping up the whole thing and sharing to me via Dropbox or similar.

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Unity crash when build a mod for OSX/Linux

Post by King of Worms »

Hi, just to be sure Ive uninstalled unity and reinstalled it, the problem persists.

As the whole dream package is 11gb and my upload is hardly a 512kb I will just export the portraits.
I think the issue lies in that "WaveFormcompute" spot, so even if I try to build one file, it will never work. It just HALTS before it gets to the files.

I will sent u the unity package in a PM right away

Thanks for troubleshooting! :)

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Unity crash when build a mod for OSX/Linux

Post by King of Worms »

Ok one more thing, if in the GitHub I select "target platform" MacOS and THAN run unity, than the export for mac OS works. It does not halt and produces a DFMOD file. IF that file works, I have no idea, but it looks proper.

It was NOT like this before in previous verions.
And Im not sure this is the way to do that. Any info on that pls?

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Unity crash when build a mod for OSX/Linux

Post by Interkarma »

When searching for it online, the "WaveformCompute.compute" shader is a post-processing helper I see bundled with other shaders. In of itself, I don't see any problems with it.

I can't say why it explodes memory and crashes the editor during build process for Linux and MacOS. That just looks like a Unity bug to me, not something you or I have done wrong.

Ok one more thing, if in the GitHub I select "target platform" MacOS and THAN run unity, than the export for mac OS works. It does not halt and produces a DFMOD file. IF that file works, I have no idea, but it looks proper.
Do you mean "target platform" in Unity's Build Settings dialog? Switching platforms rejiggers a few things under the hood for target platform, so maybe that's our workaround? We'll need someone with Linux (plenty of folks around here) and MacOS to test .dfmod to confirm working.

Good job! :)

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Unity crash when build a mod for OSX/Linux

Post by King of Worms »

:) I was able to build OSX and Linux version this way, fingers crossed it works tho, will ask for a quick test here at forums.
Its the setting here:
Untitled-2.jpg
Untitled-2.jpg (82.14 KiB) Viewed 1232 times
I always used the default "current platform" and than I specified further in Mod builder as OSX or Linux (I just ticked everything and it made DFMOD for 3 main systems)

Now I select target platform the OS I want to build for, and than in Mod builder I select just that one OS-

Post Reply