binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

Crash when building the kernel cache plugin and enabling it

Open fuzyll opened this issue 7 months ago • 0 comments

Version and Platform (required):

  • Binary Ninja Version: 5.0.7290
  • OS: macOS

Bug Description:

If I build the kernel cache plug-in from source and disable the built-in kernel cache view, I get a crash when loading a kernel cache. Specifically RecognizePlatform is returning nullptr at https://github.com/Vector35/binaryninja-api/blob/dev/view/kernelcache/core/KCView.cpp#L110-L112.

It looks like the issue may stem from https://github.com/Vector35/binaryninja-api/blob/dev/view/kernelcache/HeadlessPlugin.cpp being linked into both libkernelcache.dylib and libkernelcacheui.dylib. It results in InitKernelcache being called by each of those plug-ins as they’re loaded. If I tweak the kernelcacheui dependencies to not pull that file in then the crash goes away.

Expected Behavior: No crashes.

Additional Information: Reported by a user on Slack.

fuzyll avatar Apr 28 '25 20:04 fuzyll