Burst Error

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

Unexpected exception Burst.Options.OptionException: Unexpected arguments: `--is-for-function-pointer --managed-function-pointer=0x00000197DF2C17F0`

  at Burst.Compiler.IL.Jit.JitCompilerService.Compile (Burst.Compiler.IL.Jit.JitCompilerService+CompileJob job) [0x0012a] in <3179d4839c86430ca331f2949f40ede5>:0

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)
InvalidOperationException: Burst failed to compile the function pointer `Void AddComponentEntitiesBatchExecute(Unity.Entities.EntityComponentStore*, Unity.Collections.LowLevel.Unsafe.UnsafeList*, Int32)`
  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
  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
  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
  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
  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
  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
  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

(Filename: Library/PackageCache/com.unity.burst@1.2.0-preview.9/Runtime/BurstCompiler.cs Line: 160)

and when exiting play

NullReferenceException: Object reference not set to an instance of an object
  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
  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
  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
  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:

{
  "dependencies": {
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.2d.tilemap": "1.0.0",
    "com.unity.addressables": "1.1.10",
    "com.unity.ads": "2.0.8",
    "com.unity.analytics": "3.3.4",
    "com.unity.burst": "1.2.0-preview.9",
    "com.unity.cloud.userreporting": "0.2.4-preview",
    "com.unity.collections": "0.2.0-preview.13",
    "com.unity.entities": "0.2.0-preview.18",
    "com.unity.ext.nunit": "1.0.0",
    "com.unity.ide.rider": "1.1.4",
    "com.unity.ide.visualstudio": "1.0.11",
    "com.unity.jobs": "0.2.0-preview.13",
    "com.unity.mathematics": "1.1.0",
    "com.unity.memoryprofiler": "0.1.0-preview.7",
    "com.unity.performance.profile-analyzer": "0.4.0-preview.6",
    "com.unity.polybrush": "1.0.1",
    "com.unity.rendering.hybrid": "0.2.0-preview.18",
    "com.unity.test-framework": "1.1.8",
    "com.unity.textmeshpro": "2.0.1",
    "com.unity.timeline": "1.2.6",
    "com.unity.ugui": "1.0.0",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0"
  }
}
2 Likes

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.

8 Likes

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.

3 Likes

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.

2 Likes

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

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.

The restart unity did it for me after these errors appeared when I upgraded burst. Thanks for the quick fix!

I got the same error

Has anyone managed to successfully submit an asset store asset with a Burst dependency? This error seems to make it impossible to get approved.