Search Unity

All my Jobs suddenly refuse to compile with System.IO.EndOfStreamException

Discussion in 'Entity Component System' started by Matt-Cranktrain, Jan 19, 2022.

  1. Matt-Cranktrain

    Matt-Cranktrain

    Joined:
    Sep 10, 2013
    Posts:
    129
    Hi, this is a frustrating one, all of a sudden every one of my jobs, which were working just fine, now refuse to compile, filling my console with a series of identical "Unexpected exception System.IO.EndOfStreamException: Unable to read beyond the end of the stream." errors for each job.

    A full stack trace looks like:

    Code (csharp):
    1. Unexpected exception System.IO.EndOfStreamException: Unable to read beyond the end of the stream.
    2.   at System.IO.__Error.EndOfFile () [0x0000a] in <47ab72e0328040438980f9c23608e1ec>:0
    3.   at System.IO.BinaryReader.FillBuffer (System.Int32 numBytes) [0x0007a] in <47ab72e0328040438980f9c23608e1ec>:0
    4.   at System.IO.BinaryReader.ReadInt32 () [0x00026] in <47ab72e0328040438980f9c23608e1ec>:0
    5.   at Burst.Compiler.IL.Hashing.Storage.ILHashingResultRuntime.GetHeader (System.String hashCachePath) [0x0000e] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    6.   at Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheLoader.CreateHashingResult (System.String assemblyFilePath) [0x0003d] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    7.   at Burst.Compiler.IL.Hashing.CacheRuntime.AssemblyState..ctor (Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore+LoadHashingResultDelegate loadHashingResultCallback, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore+GetStringWriterDelegate getStringWriterCallback, Mono.Cecil.AssemblyNameReference assemblyName, System.String filePath, Mono.Cecil.AssemblyDefinition assemblyDefinition) [0x0000d] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    8.   at Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore.GetAssemblyState (System.String assemblyName, zzzUnity.Burst.CodeGen.AssemblyLoader assemblyLoader) [0x0005d] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    9.   at Burst.Compiler.IL.Hashing.CacheRuntime.LocalHashCacheAssemblyStore.GetAssemblyState (System.String assemblyName) [0x00000] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    10.   at Burst.Compiler.IL.Hashing.CacheRuntime.Util.TypeReferenceExtensions.GetAssemblyState (Mono.Cecil.TypeReference typeReference, Burst.Compiler.IL.Hashing.CacheRuntime.LocalHashCacheAssemblyStore assemblyStore) [0x00011] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    11.   at Burst.Compiler.IL.Hashing.CacheRuntime.Util.TypeReferenceExtensions.ToILType (Mono.Cecil.TypeReference typeReference, Burst.Compiler.IL.Hashing.CacheRuntime.LocalHashCacheAssemblyStore assemblyStore) [0x001db] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    12.   at Burst.Compiler.IL.Hashing.CacheRuntime.Util.MethodReferenceExtensions.ToILTypes (Mono.Collections.Generic.Collection`1[T] types, Burst.Compiler.IL.Hashing.CacheRuntime.LocalHashCacheAssemblyStore assemblyStore) [0x0001d] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    13.   at Burst.Compiler.IL.Hashing.CacheRuntime.Util.MethodReferenceExtensions.CreateGenericContext (Mono.Cecil.MethodReference methodReference, Burst.Compiler.IL.Hashing.CacheRuntime.LocalHashCacheAssemblyStore assemblyStore) [0x00044] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    14.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.GetHashImpl () [0x000ad] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    15.   at Burst.Compiler.IL.Hashing.CacheRuntime.ILFinalHashCalculator.GetHash (Mono.Cecil.MethodReference[] methodReferences, Burst.Compiler.IL.Hashing.CacheRuntime.HashCacheAssemblyStore assemblyStore, zzzUnity.Burst.CodeGen.AssemblyLoader assemblyLoader, Burst.Compiler.IL.NativeCompilerOptions options, System.Action`2[T1,T2] onVisitItem) [0x0000c] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    16.   at Burst.Compiler.IL.NativeCompiler.ComputeHash () [0x0004e] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    17.   at Burst.Compiler.IL.Jit.JitCompiler.CompileMethodInternal (Burst.Compiler.IL.Jit.JitResult result, System.Collections.Generic.List`1[T] methodsToCompile, Burst.Compiler.IL.Jit.JitOptions jitOptions) [0x0017f] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    18.   at Burst.Compiler.IL.Jit.JitCompiler.CompileMethods (Burst.Compiler.IL.Jit.JitMethodGroupRequest& request, Burst.Compiler.IL.Jit.JitCompilationRequestType requestType) [0x00209] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    19.   at Burst.Compiler.IL.Jit.JitCompiler.CompileMethod (Burst.Compiler.IL.Jit.MethodReferenceWithMethodRefString method, Burst.Compiler.IL.Jit.JitOptions jitOptions, Burst.Compiler.IL.Jit.JitCompilationRequestType requestType) [0x00023] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    20.   at Burst.Compiler.IL.Jit.JitCompilerService+CompilerThreadContext.Compile (Burst.Compiler.IL.Jit.JitCompilerService+CompileJob job, Burst.Compiler.IL.Jit.JitCompilationRequestType requestType) [0x00491] in <b6aa8fdf6d8144e588cc59c2555fb2d5>:0
    21.  
    22. While compiling job: System.Void Unity.Entities.JobForEachExtensions/JobStruct_Process_EC`2<PointMassSystem/CopyAntiFogDataJob,AntiFogData>::Execute(Unity.Entities.JobForEachExtensions/JobStruct_Process_EC`2<T,T0>&,System.IntPtr,System.IntPtr,Unity.Jobs.LowLevel.Unsafe.JobRanges&,System.Int32)
    23. at <empty>:line 0
    24.  
    I didn't change anything, and I wasn't even working on jobs code at the time, I'm doing localization stuff.

    I've upgraded to Unity 2021.2.8f1 and Burst 1.6.4 to see if that would help, nope, still the same errors. Ran a 'Reimport All', no change.

    Since it's an IO related error I checked my disk, I have plenty of disk space free.

    Why are my jobs all suddenly not compiling successfully?
     
  2. Matt-Cranktrain

    Matt-Cranktrain

    Joined:
    Sep 10, 2013
    Posts:
    129
    I deleted the contents of /Library/ and let the Unity project re-fetch all the packages, and it's back to normal. Nope, I have no idea what happened, I would have assumed that:
    1. When I updated the Burst package to the latest version that that would clear anything incorrect, and
    2. more generally, anything else wrong within /Library/PackageCache/ would just be reset automatically, since that's what normally happens if you try and edit a package without moving it to /Packages/ first.
     
  3. IliqNikushev

    IliqNikushev

    Joined:
    Feb 1, 2017
    Posts:
    22
    Got the same issue after refactoring all my systems to use a new Base class (instead of SystemBase, using a MySystemBase that has a dedicated onCreate method)

    Deleing Burst Cache and Package cache worked, thanks!
     
    Ony, Baggers_ and Matt-Cranktrain like this.
  4. Zergling103

    Zergling103

    Joined:
    Aug 16, 2011
    Posts:
    392
    I've been getting this too after upgrading. Ick!

    To fix it, just close Unity (just to be safe - don't know if this is necessary), delete Library\BurstCache, then re-open. It'll have to regenerate this stuff.
     
    Ony and Baggers_ like this.