Unity crashes during build
I had a project with 3 scenes. Since Scene 4 is very like Scene 3, I created a new scene and copied some objects across using the clipboard (including a terrain). Most of the items I copied have now been turned into prefabs, but a few have been edited and have now diverged.
I found a few issues (eg both scenes sharing the same terrain data) but I've worked through all the errors, warnings and missing objects. Running in the editor, everything works perfectly.
If I compile the game with all 4 scenes, the build crashes and Unity quits to desktop with no visible error messages.
A bit of trial and error shows that I can build any combination of scenes as long as I don't have both 3 and 4 at the same time.
Below, I've included the Editor.log from a few lines before the crash error until the end of the file, with a lot of assembly references snipped.
Attaching VS and attempting to debug Unity itself shows Unhandled exception at 0x00000000770CF8D6 (ntdll.dll) in Unity.exe: 0xC0000005: Access violation writing location 0x0000000000000118
.
I'm assuming that some of the objects I've duplicated are sharing references, but I've been through everything n the scene and can't see anything wrong.
I can't see anything that indicates where the problem is. How can I debug this further?
Unloading 121 unused Assets to reduce memory usage. Loaded Objects now: 4188.
Total: 18.268221 ms (FindLiveObjects: 0.453090 ms CreateObjectMapping: 0.120743 ms MarkObjects: 15.421084 ms DeleteObjects: 2.271491 ms)
Load scene 'Assets/Scenes/Map.unity' time: 227.341675 ms
[00:00:00] Enlighten: Precompute started.
[00:00:00] Enlighten: Finished 1 Layout Systems job (0.00s execute, 0.00s integrate, 0.01s wallclock)
[00:00:00] Enlighten: Finished 1 Create SystemAtlas job (0.00s execute, 0.00s integrate, 0.02s wallclock)
[00:00:00] Enlighten: Precompute took 0.097168 seconds.
Enlighten scene contents: 0 geometries. 0 instances. 0 systems. 0 probe groups. 0 cube maps. Scene is up-to-date.
Crash!!!
Crash in winutils::ProcessInternalCrash(PEXCEPTION_POINTERS pExInfo)SymInit: Symbol-SearchPath: 'C:/Program Files/Unity/Editor/Data/MonoEmbedRuntime;.;E:\LosingMars\LosingMars;C:\Program Files\Unity\Editor;C:\Windows;C:\Windows\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 530, UserName: 'Obfuscated'
OS-Version: 6.1.7601 (Service Pack 1) 0x100-0x1
C:\Program Files\Unity\Editor\Unity.exe:Unity.exe (0000000140000000), size: 54140928 (result: 0), SymType: 'PDB', PDB: 'C:\Program Files\Unity\Editor\Unity_x64.pdb', fileVersion: 5.1.3.31179
C:\Windows\SYSTEM32\ntdll.dll:ntdll.dll (0000000077080000), size: 1736704 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\SYSTEM32\ntdll.dll', fileVersion: 6.1.7601.18798
... Snip ...
[00:00:00] Enlighten: Bake took 0.012530 seconds.
C:\Windows\system32\WS2_32.dll:WS2_32.dll (000007FEFD8E0000), size: 315392 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\WS2_32.dll', fileVersion: 6.1.7601.17514
C:\Windows\system32\NSI.dll:NSI.dll (000007FEFEFC0000), size: 32768 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\NSI.dll', fileVersion: 6.1.7600.16385
C:\Windows\system32\HID.DLL:HID.DLL (000007FEFB1E0000), size: 45056 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\HID.DLL', fileVersion: 6.1.7600.16385
C:\Program Files\Unity\Editor\TextureConverter.dll:TextureConverter.dll (000007FEE0C20000), size: 6627328 (result: 0), SymType: '-exported-', PDB: 'C:\Program Files\Unity\Editor\TextureConverter.dll'
C:\Program Files\Unity\Editor\umbraoptimizer64.dll:umbraoptimizer64.dll (000007FEF3A50000), size: 995328 (result: 0), SymType: '-exported-', PDB: 'C:\Program Files\Unity\Editor\umbraoptimizer64.dll'
... Snip ...
C:\Windows\system32\netutils.dll:netutils.dll (000007FEF9CF0000), size: 49152 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\netutils.dll', fileVersion: 6.1.7601.17514
C:\Windows\system32\MPR.dll:MPR.dll (000007FEF3530000), size: 98304 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\MPR.dll', fileVersion: 6.1.7600.16385
C:\Windows\system32\pfmapi_A1C.dll:pfmapi_A1C.dll (000000006D8B0000), size: 524288 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\system32\pfmapi_A1C.dll', fileVersion: 1.0.0.171
C:\Windows\System32\drprov.dll:drprov.dll (000007FEF9D20000), size: 40960 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\drprov.dll', fileVersion: 6.1.7600.16385
C:\Windows\System32\ntlanman.dll:ntlanman.dll (000007FEF9C30000), size: 139264 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\ntlanman.dll', fileVersion: 6.1.7601.17514
C:\Windows\System32\davclnt.dll:davclnt.dll (000007FEF9C10000), size: 118784 (result: 0), SymType: '-exported-', PDB: 'C:\Windows\System32\davclnt.dll', fileVersion: 6.1.7601.18201
Answer by ravishnair · Sep 16, 2016 at 05:30 PM
One year later, almost to the date, and I am having the same error. I have tried a decent amount of things, including reinstalling windows. I am pretty sure that its not a code thing, because the project I am testing in has no code, just a UI sprite that I start waving around and cause it to crash.
Did you end up resolving this?
Apologies, but no I didn't. I'm convinced to this day that when I copied one of the objects across, one of the references has been preserved ins$$anonymous$$d of duplicated, however, I was never able to identify the specific object causing problems. $$anonymous$$y scenes were relatively simple (I load a lot through scripts) so in the end, I created a new scene, used the same scripts, re-added the assets, etc... I just needed to recreate the game objects. I also made a point of not duplicating the terrain data, in case that was the cause.
If you ever get it solved, I'd love to know the cause.
I was on 5.3. If you are too, an update may help?
Ah crappers. Well I am on the same version, but i tried it out with a new version as well and that didn't help. Still getting the same crashes. I am on step FINAL: going to reinstall windows and hope that it is a problem with the ntdll.dll file. If that doesn't work then i am going to hijack someone elses pc and get work done :P
it's nothing to do with the dll. That's the file ultimately responsible for managing memory access. In short, some unmanaged code (code not written in .Net, probably Unity core code) has tried to access memory that it doesn't own. It asked nt.dll for access and the dll refused. This usually happens when a a pointer/reference is rendered invalid because memory was released incorrectly or the reference has been corrupted somehow. Since Unity doesn't show any errors, it's likely an edge-case bug in Unity triggered by project structure in some way. Somehow we both managed to hit it.
Also... Before you go rebuilding your whole PC, why not just spin up a Virtual $$anonymous$$achine? VirtualBox is free and great for quick test environments (although you couldn't game in it reliably).
Yeah, that makes sense. Although, in that case, shouldn't a reinstall of all files and reimporting do the trick? Anywho, I kinda got desperate at that point and went ahead with the Windows reinstall. Things seem to be working well now, but I would love to hear if there is a better way around that bug. Because, damn it was annoying.
Your answer
Follow this Question
Related Questions
canvas UI stretching components with Unity Build 0 Answers
My build looks like the "Matrix", but my viewport and game runtime look normal. Lighting problem? 2 Answers
Build crashes but not editor, cannot narrow down cause 0 Answers
Unity 2019 Stuck on "Compiling Assembly Definition Files Scripts" 0 Answers
Unity Build Error - Mac and Windows 0 Answers