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

Warning spew on SharedCache initial open

Open 0cyn opened this issue 5 months ago • 1 comments

Version and Platform (required):

  • Binary Ninja Version: 5.1.7579
  • Edition: Ultimate
  • OS: macOS
  • OS Version: 15
  • CPU Architecture: M1

Bug Description:

SharedCache plugin creates a set of sections before bv finalization which causes warning spew in logger.

Image

Steps To Reproduce:

  1. Open a SharedCache

Expected Behavior: We could probably try to delay loading of the auto-loaded binaries till after BinaryView finalization is done.

0cyn avatar Jun 06 '25 17:06 0cyn

Related to https://github.com/Vector35/binaryninja-api/issues/6901

emesare avatar Jun 06 '25 17:06 emesare

Deferring would sidestep the issue, but doesn't feel right to me. I'm not sure what it means to allow a user to undo these automatic actions performed by the shared cache view.

Fundamentally, the auto / user distinction made in the API is not sufficient to represent the cases that we care about. There's at least two dimensions involved here: 1) should it be persisted, and 2) should it create an undo entry. For sections "auto" means don't persist and don't create an undo entry, while "user" means persist and create an undo entry. There's no way to represent persist the section but don't create an undo entry.

One option would be to add a flag parameter to AddUserSection to control whether it creates an undo entry. Another would be to add an entirely separate entrypoint for the persistent section without undo case.

bdash avatar Jul 08 '25 02:07 bdash

Yea seeing as https://github.com/Vector35/binaryninja-api/issues/6742 will probably not be slated for next release something short term like a flag seems OK

emesare avatar Jul 08 '25 02:07 emesare

For now I'm going to downgrade the warning log to a debug log since it's not actionable and it doesn't indicate something that must be fixed. I've filed a follow-up to track moving the shared cache / kernel cache views off AddUserSection when a suitable alternative becomes available: #7069.

bdash avatar Jul 09 '25 18:07 bdash