Quick answer: Unity FunctionPointer compiled with Burst crashing when invoked from managed code? Burst function pointers must be invoked through Burst-compatible callers - wrap in a delegate or use Invoke.

Managed C# code calls a Burst-compiled FunctionPointer directly. AccessViolationException; no useful stack trace.

Use FunctionPointer.Invoke

fp.Invoke(arg1, arg2);

Invoke wraps the call with the right ABI. Direct call via cast is undefined.

Or call from another Burst job

Burst-to-Burst function calls work natively. Schedule a tiny Burst job that fans out to multiple function pointers.

Mark callbacks with MonoPInvokeCallback

For native code calling back into managed (audio, networking), the attribute pins the method so the JIT doesn't move it.

“Burst code has its own ABI. The boundary is real.”

If you find yourself fighting Burst function pointers, consider whether the same logic could live in a job. Jobs compose better than function pointers.

Related reading