Search Unity

Burst Error

Discussion in 'Burst' started by PaulUsul, Dec 3, 2019.

  1. PaulUsul

    PaulUsul

    Joined:
    Nov 20, 2012
    Posts:
    29
    I was getting these errors on play in an empty scene with all my jobs [BurstCompile] commented out. Started copying code over to a new project to reproduce it so I could send a bug report, but could not reproduce it. Restarting unity fixed it. Hopefully this helps someone in the future googling the error

    Code (CSharp):
    1. Unexpected exception Burst.Options.OptionException: Unexpected arguments: `--is-for-function-pointer --managed-function-pointer=0x00000197DF2C17F0`
    2.  
    3.   at Burst.Compiler.IL.Jit.JitCompilerService.Compile (Burst.Compiler.IL.Jit.JitCompilerService+CompileJob job) [0x0012a] in <3179d4839c86430ca331f2949f40ede5>:0
    4.  
    5. While compiling job: Unity.Entities.StructuralChange, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::AddComponentEntitiesBatchExecute(Unity.Entities.EntityComponentStore*, Unity.Entities, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|Unity.Collections.LowLevel.Unsafe.UnsafeList*, Unity.Collections, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
    6. InvalidOperationException: Burst failed to compile the function pointer `Void AddComponentEntitiesBatchExecute(Unity.Entities.EntityComponentStore*, Unity.Collections.LowLevel.Unsafe.UnsafeList*, Int32)`
    7.   at Unity.Burst.BurstCompiler.Compile[T] (T delegateObj, System.Boolean isFunctionPointer) [0x0015e] in D:\project\Dwar\Library\PackageCache\com.unity.burst@1.2.0-preview.9\Runtime\BurstCompiler.cs:160
    8.   at Unity.Burst.BurstCompiler.CompileFunctionPointer[T] (T delegateMethod) [0x00001] in D:\project\Dwar\Library\PackageCache\com.unity.burst@1.2.0-preview.9\Runtime\BurstCompiler.cs:78
    9.   at Unity.Entities.StructuralChange.Initialize () [0x00001] in D:\project\Dwar\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Entities\EntityManagerChangeArchetype.cs:55
    10.   at Unity.Entities.EntityManager..ctor (Unity.Entities.World world) [0x0000e] in D:\project\Dwar\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Entities\EntityManager.cs:162
    11.   at Unity.Entities.World..ctor (System.String name) [0x00050] in D:\project\Dwar\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Entities\World.cs:115
    12.   at Unity.Entities.DefaultWorldInitialization.Initialize (System.String defaultWorldName, System.Boolean editorWorld) [0x0002c] in D:\project\Dwar\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Entities.Hybrid\Injection\DefaultWorldInitialization.cs:127
    13.   at Unity.Entities.AutomaticWorldBootstrap.Initialize () [0x00001] in D:\project\Dwar\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Entities.Hybrid\Injection\AutomaticWorldBootstrap.cs:15
    14.  
    15. (Filename: Library/PackageCache/com.unity.burst@1.2.0-preview.9/Runtime/BurstCompiler.cs Line: 160)
    16.  
    17.  
    and when exiting play
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2.   at Unity.Entities.World.Dispose () [0x00080] in D:\project\Dwar\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Entities\World.cs:146
    3.   at Unity.Entities.World.DisposeAllWorlds () [0x00003] in D:\project\Dwar\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Entities\World.cs:164
    4.   at Unity.Entities.DefaultWorldInitialization.DomainUnloadOrPlayModeChangeShutdown () [0x0000f] in D:\project\Dwar\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Entities.Hybrid\Injection\DefaultWorldInitialization.cs:87
    5.   at Unity.Entities.DefaultWorldInitializationProxy.OnDisable () [0x0000b] in D:\project\Dwar\Library\PackageCache\com.unity.entities@0.2.0-preview.18\Unity.Entities.Hybrid\Injection\DefaultWorldInitializationProxy.cs:28
    manifest looked like this:
    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.     "com.unity.2d.sprite": "1.0.0",
    4.     "com.unity.2d.tilemap": "1.0.0",
    5.     "com.unity.addressables": "1.1.10",
    6.     "com.unity.ads": "2.0.8",
    7.     "com.unity.analytics": "3.3.4",
    8.     "com.unity.burst": "1.2.0-preview.9",
    9.     "com.unity.cloud.userreporting": "0.2.4-preview",
    10.     "com.unity.collections": "0.2.0-preview.13",
    11.     "com.unity.entities": "0.2.0-preview.18",
    12.     "com.unity.ext.nunit": "1.0.0",
    13.     "com.unity.ide.rider": "1.1.4",
    14.     "com.unity.ide.visualstudio": "1.0.11",
    15.     "com.unity.jobs": "0.2.0-preview.13",
    16.     "com.unity.mathematics": "1.1.0",
    17.     "com.unity.memoryprofiler": "0.1.0-preview.7",
    18.     "com.unity.performance.profile-analyzer": "0.4.0-preview.6",
    19.     "com.unity.polybrush": "1.0.1",
    20.     "com.unity.rendering.hybrid": "0.2.0-preview.18",
    21.     "com.unity.test-framework": "1.1.8",
    22.     "com.unity.textmeshpro": "2.0.1",
    23.     "com.unity.timeline": "1.2.6",
    24.     "com.unity.ugui": "1.0.0",
    25.     "com.unity.modules.ai": "1.0.0",
    26.     "com.unity.modules.androidjni": "1.0.0",
    27.     "com.unity.modules.animation": "1.0.0",
    28.     "com.unity.modules.assetbundle": "1.0.0",
    29.     "com.unity.modules.audio": "1.0.0",
    30.     "com.unity.modules.cloth": "1.0.0",
    31.     "com.unity.modules.director": "1.0.0",
    32.     "com.unity.modules.imageconversion": "1.0.0",
    33.     "com.unity.modules.imgui": "1.0.0",
    34.     "com.unity.modules.jsonserialize": "1.0.0",
    35.     "com.unity.modules.particlesystem": "1.0.0",
    36.     "com.unity.modules.physics": "1.0.0",
    37.     "com.unity.modules.physics2d": "1.0.0",
    38.     "com.unity.modules.screencapture": "1.0.0",
    39.     "com.unity.modules.terrain": "1.0.0",
    40.     "com.unity.modules.terrainphysics": "1.0.0",
    41.     "com.unity.modules.tilemap": "1.0.0",
    42.     "com.unity.modules.ui": "1.0.0",
    43.     "com.unity.modules.uielements": "1.0.0",
    44.     "com.unity.modules.umbra": "1.0.0",
    45.     "com.unity.modules.unityanalytics": "1.0.0",
    46.     "com.unity.modules.unitywebrequest": "1.0.0",
    47.     "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    48.     "com.unity.modules.unitywebrequestaudio": "1.0.0",
    49.     "com.unity.modules.unitywebrequesttexture": "1.0.0",
    50.     "com.unity.modules.unitywebrequestwww": "1.0.0",
    51.     "com.unity.modules.vehicles": "1.0.0",
    52.     "com.unity.modules.video": "1.0.0",
    53.     "com.unity.modules.vr": "1.0.0",
    54.     "com.unity.modules.wind": "1.0.0"
    55.   }
    56. }
    57.  
     
    fahimkamal63 and TheVirtualMunk like this.
  2. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    Have you started to install a newer version of burst on top of your existing/loaded project?
    If it is the case, the project will be in an unbalanced state. You need to restart the editor (and potentially remove the Library folder)
    It is a known issue unfortunately. The rule is that if you have burst installed on your project and you want to install a newer version, you need to close and re-open the editor after updating it.
     
  3. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Personally, I feel like it's totally acceptable if you're updating your compiler to require a restart.
    But it would be really nice if it triggered a popup telling you to restart.
    Especially for when you don't directly update burst and instead it's updated due to a dependency of another package you updated.
     
    ademord, Nyanpas and elcionap like this.
  4. xoofx

    xoofx

    Unity Technologies

    Joined:
    Nov 5, 2016
    Posts:
    417
    I agree. We will check if we have a way to access some notifications. I don't know if it is possible with the current API of PackageManager.
     
    ademord and GilCat like this.
  5. elcionap

    elcionap

    Joined:
    Jan 11, 2016
    Posts:
    138
    The new input system (package) does this. It used (I'm not sure if still does) to trigger a "must restart editor" alert when installing the package or changing the input system in the Project Settings window.

    []'s
     
  6. Nyanpas

    Nyanpas

    Joined:
    Dec 29, 2016
    Posts:
    406
    Sorry for bumping this necro, but I am getting "Burst error BC1064: structs cannot be passed to or returned from external functions in burst. To fix this issue, use a reference or pointer."

    It seems it is coming from using float3 as parameters without the "ref" or "out" keywords in a separate class that has [BurstCompile] add'd to it like done here:
    https://github.com/keijiro/BurstDirectCallTest/blob/main/Assets/NoiseTexture.cs

    If you add a "float3 test" as a parameter like
    GetPixel(int x, int y, float t, float test)
    , it will complain. Otherwise it will not.

    However I haven't had this issue in the past, and it just seemed to happen as I moved a the .cs-file I was working on into a new project. I can still run the project and test things out, though. It doesn't seem to prevent me from playing back the scene.
     
  7. TheVirtualMunk

    TheVirtualMunk

    Joined:
    Sep 6, 2019
    Posts:
    150
    The restart unity did it for me after these errors appeared when I upgraded burst. Thanks for the quick fix!
     
  8. yifanchu183

    yifanchu183

    Joined:
    Jul 4, 2019
    Posts:
    41
    I got the same error
     
    Last edited: Feb 12, 2023