binaryninja-api
binaryninja-api copied to clipboard
Warning spew on SharedCache initial open
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.
Steps To Reproduce:
- Open a SharedCache
Expected Behavior: We could probably try to delay loading of the auto-loaded binaries till after BinaryView finalization is done.
Related to https://github.com/Vector35/binaryninja-api/issues/6901
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.
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
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.