Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2nd DB corrupted in a project #7534

Open
BaalNetbek opened this issue Feb 21, 2025 · 7 comments
Open

2nd DB corrupted in a project #7534

BaalNetbek opened this issue Feb 21, 2025 · 7 comments
Assignees
Labels
Feature: Database Status: Triage Information is being gathered

Comments

@BaalNetbek
Copy link

BaalNetbek commented Feb 21, 2025

Describe the bug
A clear and concise description of the bug.

To Reproduce
Steps to reproduce the behavior:

  1. Open Ghidra (I see default project open "Project1")
  2. From Project1/ open "Galaxy on Fire 2 Full HD~.x86" DB with default tool (CodeBrowser)
  3. See error message on top of tool window.
  4. Closing message pops antother and another. (They popup whenever I press on anthything using DB in the tool)

Expected behavior
I wanted to open the DB from "Ghidra: Project1" window. Browse and edit it which I'm unable to.

Screenshots

Image

Attachments
The broken DB 08.zip

Environment (please complete the following information):

  • OS: Windows 10 21H2
  • Java Version: 23.0
  • Ghidra Version: 11.2.1
  • Ghidra Origin: official GitHub distro (I don't remember but that's very likely)

Additional context
This is a second time a DB from this project got corrupted. (First time I had a recent backup so I didn't mind).
I don't know what causes DBs to corrupt. Ghidra never crashed for me. I always safe DBs before closing.

Error message

Unexpected Error
ghidra.util.exception.AssertException: Unexpected Error
	at db.buffers.BufferMgr.releaseCleanBuffer(BufferMgr.java:1076)
	at db.buffers.BufferMgr.releaseBuffer(BufferMgr.java:1037)
	at db.NodeMgr.releaseNodes(NodeMgr.java:175)
	at db.Table.getRecord(Table.java:705)
	at ghidra.program.database.code.InstDBAdapterV1.getRecord(InstDBAdapterV1.java:95)
	at ghidra.program.database.code.CodeManager.getInstructionDB(CodeManager.java:3108)
	at ghidra.program.database.code.CodeManager.getCodeUnitAt(CodeManager.java:865)
	at ghidra.program.database.code.CodeManager.getCodeUnitAt(CodeManager.java:850)
	at ghidra.program.database.code.CodeManager.getCodeUnitContaining(CodeManager.java:1020)
	at ghidra.program.database.ListingDB.getCodeUnitContaining(ListingDB.java:60)
	at ghidra.app.util.viewer.listingpanel.ProgramBigListingModel.getAddressAfter(ProgramBigListingModel.java:237)
	at ghidra.app.util.viewer.listingpanel.ListingModelAdapter.getIndexAfter(ListingModelAdapter.java:85)
	at ghidra.app.util.viewer.listingpanel.ListingModelAdapter.checkIndex(ListingModelAdapter.java:484)
	at ghidra.app.util.viewer.listingpanel.ListingModelAdapter.findUnviewableAddressRanges(ListingModelAdapter.java:477)
	at ghidra.app.util.viewer.listingpanel.ListingModelAdapter.removeUnviewableAddressRanges(ListingModelAdapter.java:457)
	at ghidra.app.util.viewer.listingpanel.ListingModelAdapter.<init>(ListingModelAdapter.java:53)
	at ghidra.app.util.viewer.listingpanel.ListingPanel.createLayoutModel(ListingPanel.java:200)
	at ghidra.app.util.viewer.listingpanel.ListingPanel.setListingModel(ListingPanel.java:245)
	at ghidra.app.util.viewer.listingpanel.ListingPanel.setProgram(ListingPanel.java:830)
	at ghidra.app.plugin.core.codebrowser.CodeViewerProvider.doSetProgram(CodeViewerProvider.java:431)
	at ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin.processEvent(CodeBrowserPlugin.java:140)
	at ghidra.framework.plugintool.Plugin.eventSent(Plugin.java:305)
	at ghidra.framework.plugintool.mgr.EventManager.sendEvents(EventManager.java:286)
	at ghidra.framework.plugintool.mgr.EventManager.lambda$new$3(EventManager.java:49)
	at ghidra.util.Swing.doRun(Swing.java:292)
	at ghidra.util.Swing.runNow(Swing.java:208)
	at ghidra.util.Swing.runNow(Swing.java:163)
	at ghidra.framework.plugintool.mgr.EventManager.fireEvent(EventManager.java:216)
	at ghidra.framework.plugintool.PluginTool.firePluginEvent(PluginTool.java:537)
	at ghidra.framework.plugintool.Plugin.firePluginEvent(Plugin.java:468)
	at ghidra.app.plugin.core.progmgr.MultiProgramManager.fireActivatedEvent(MultiProgramManager.java:272)
	at ghidra.app.plugin.core.progmgr.MultiProgramManager.setCurrentProgram(MultiProgramManager.java:249)
	at ghidra.app.plugin.core.progmgr.MultiProgramManager.setCurrentProgram(MultiProgramManager.java:191)
	at ghidra.app.plugin.core.progmgr.MultiProgramManager.addProgram(MultiProgramManager.java:101)
	at ghidra.app.plugin.core.progmgr.MultiProgramManager.addProgram(MultiProgramManager.java:80)
	at ghidra.app.plugin.core.progmgr.ProgramManagerPlugin.lambda$showProgram$6(ProgramManagerPlugin.java:488)
	at ghidra.util.Swing.doRun(Swing.java:292)
	at ghidra.util.Swing.runNow(Swing.java:208)
	at ghidra.util.Swing.runNow(Swing.java:163)
	at ghidra.app.plugin.core.progmgr.ProgramManagerPlugin.showProgram(ProgramManagerPlugin.java:494)
	at ghidra.app.plugin.core.progmgr.ProgramManagerPlugin.openProgramLocations(ProgramManagerPlugin.java:693)
	at ghidra.app.plugin.core.progmgr.ProgramManagerPlugin.openPrograms(ProgramManagerPlugin.java:660)
	at ghidra.app.plugin.core.progmgr.ProgramManagerPlugin.acceptData(ProgramManagerPlugin.java:158)
	at ghidra.framework.plugintool.PluginManager.acceptData(PluginManager.java:76)
	at ghidra.framework.plugintool.PluginTool.acceptDomainFiles(PluginTool.java:467)
	at ghidra.framework.project.tool.ToolServicesImpl.lambda$launchTool$3(ToolServicesImpl.java:239)
	at ghidra.framework.project.tool.ToolServicesImpl.defaultLaunch(ToolServicesImpl.java:214)
	at ghidra.framework.project.tool.ToolServicesImpl.launchTool(ToolServicesImpl.java:235)
	at ghidra.framework.main.ToolButton.openDomainFiles(ToolButton.java:510)
	at ghidra.framework.main.ToolButton$2.end(ToolButton.java:487)
	at ghidra.framework.main.ZoomImageRunner$1.end(ZoomImageRunner.java:54)
	at org.jdesktop.animation.timing.Animator.end(Animator.java:755)
	at org.jdesktop.animation.timing.Animator.stop(Animator.java:660)
	at org.jdesktop.animation.timing.Animator.timingEvent(Animator.java:732)
	at org.jdesktop.animation.timing.Animator.access$200(Animator.java:75)
	at org.jdesktop.animation.timing.Animator$TimerTarget.actionPerformed(Animator.java:1041)
	at java.desktop/javax.swing.Timer.fireActionPerformed(Timer.java:311)
	at java.desktop/javax.swing.Timer$DoPostEvent.run(Timer.java:243)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

---------------------------------------------------
Build Date: 2024-Nov-05 1643 EST
Ghidra Version: 11.2.1
Java Home: D:\Program Files\java\jdk-23
JVM Version: Oracle Corporation 23
OS: Windows 10 10.0 amd64
Workstation: OG-PIMP-ASS-COM

@astrelsky
Copy link
Contributor

astrelsky commented Feb 21, 2025

The cutoff "The Navigation History Plugin is using a close..." message is very suspicious.

@ghidra1
Copy link
Collaborator

ghidra1 commented Feb 21, 2025

Archive: 08.zip
skipping: 00000089.prp need PK compat. v6.3 (can do v4.6)
skipping: ~00000089.db/db.13.gbf need PK compat. v6.3 (can do v4.6)
skipping: ~00000089.db/db.14.gbf need PK compat. v6.3 (can do v4.6)
creating: junk/~00000089.db/

It appears you used a newer version than what I have on my system.

@ghidra1
Copy link
Collaborator

ghidra1 commented Feb 21, 2025

@BaalNetbek I was able to unpack with 7z

@BaalNetbek
Copy link
Author

Do you mean unable?
08.tar.gz

@ghidra1
Copy link
Collaborator

ghidra1 commented Feb 21, 2025

@BaalNetbek You still have the previous DB buffer file Save version 13 which seems OK. Do you recall what actions you may have taken within Ghidra for the file in question before the last Save that produced version 14?

BTW - While the project is not open, you can delete the version 14 buffer file (gbf) which will allow the previous version of the file state to be used. This is the only recovery in your situation.

@ghidra1
Copy link
Collaborator

ghidra1 commented Feb 21, 2025

It appears that a very large contiguous portion of the DB buffer file was completely cleared. While it happen to start at the end of a reference table it runs across many others. It's unclear what could have caused this. Any insight on the actions you performed before the final save would help.

@BaalNetbek
Copy link
Author

For sure I did renaming functions, very likely I did rename some variables in Decompile tool window and used Auto Create Struct. I may also have edited some struct or create namespaces and convert them to classes and I generaly inspected the file using:

  • Decompile,
  • Structure Editor,
  • Symbol Tree,
  • Data Type Manager,
  • Data Type Preview,
  • Function Call Trees,
  • Listing,
  • Bytes,
  • Program Trees,
  • Function Call Graph.

I also very likely used this script renaming functions and pdbgen but not upon this file but other in the same project which didn't suffer a bit and the scripts worked as inteded for them (the other files).
I might have used these scripts on the file having issue and forgot about it but its very unlikly that i did.

I could aswell have moved windows around in CodeBrowser tool around.

Also before the first DB corrupted I 100% didn't use any scripts. But I made a copy of that DB just casualy then I belive I edited (and did all the other things above, except using scripts) both original and copy and the next day original was already corrputed in similar way as this one (the second).

PS. Thank you for the recovery solution. I didn't know there is an older version kept as backup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Database Status: Triage Information is being gathered
Projects
None yet
Development

No branches or pull requests

4 participants