Skip to content

Crash when building the kernel cache plugin and enabling it #6743

Open
@fuzyll

Description

@fuzyll

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.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions