dclane-code / ghidra-snap

snap of Ghidra from ghidra-sre.org
1 stars 6 forks source link

Unable to write to lock file: /var/tmp/<username>-ghidra/packed-db-cache/cache.ulock #4

Open spitfire55 opened 2 months ago

spitfire55 commented 2 months ago

I installed ghidra via snap install ghidra, and after creating a project and analyzing a couple files, I got the following error:

Permission denied
java.io.IOException: Permission denied
    at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
    at java.base/java.io.File.createNewFile(File.java:1043)
    at ghidra.framework.store.local.LockFile.createLockFileNoWait(LockFile.java:447)
    at ghidra.framework.store.local.LockFile.createLock(LockFile.java:379)
    at ghidra.framework.store.db.PackedDatabaseCache.getCachedDB(PackedDatabaseCache.java:329)
    at ghidra.framework.store.db.PackedDatabase.getPackedDatabase(PackedDatabase.java:283)
    at ghidra.program.database.data.DataTypeManagerDB.<init>(DataTypeManagerDB.java:284)
    at ghidra.program.model.data.StandAloneDataTypeManager.<init>(StandAloneDataTypeManager.java:183)
    at ghidra.program.model.data.FileDataTypeManager.<init>(FileDataTypeManager.java:71)
    at ghidra.program.model.data.FileDataTypeManager.openFileArchive(FileDataTypeManager.java:145)
    at ghidra.app.plugin.core.datamgr.archive.FileArchive.<init>(FileArchive.java:55)
    at ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler.openArchive(DataTypeManagerHandler.java:450)
    at ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler.openArchive(DataTypeManagerHandler.java:440)
    at ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler.openArchives(DataTypeManagerHandler.java:378)
    at ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler.restoreArchiveNames(DataTypeManagerHandler.java:939)
    at ghidra.app.plugin.core.datamgr.archive.DataTypeManagerHandler.restore(DataTypeManagerHandler.java:875)
    at ghidra.app.plugin.core.datamgr.DataTypeManagerPlugin.readConfigState(DataTypeManagerPlugin.java:271)
    at ghidra.framework.plugintool.PluginManager.readSaveState(PluginManager.java:553)
    at ghidra.framework.plugintool.PluginManager.initConfigStates(PluginManager.java:539)
    at ghidra.framework.plugintool.PluginManager.restorePluginsFromXml(PluginManager.java:321)
    at ghidra.framework.plugintool.PluginTool.restoreFromXml(PluginTool.java:629)
    at ghidra.framework.project.tool.GhidraTool.restoreFromXml(GhidraTool.java:137)
    at ghidra.framework.plugintool.PluginTool.<init>(PluginTool.java:141)
    at ghidra.framework.project.tool.GhidraTool.<init>(GhidraTool.java:67)
    at ghidra.framework.project.tool.GhidraToolTemplate.createTool(GhidraToolTemplate.java:200)
    at ghidra.framework.project.tool.ToolManagerImpl.getTool(ToolManagerImpl.java:539)
    at ghidra.framework.project.tool.WorkspaceImpl.restoreFromXml(WorkspaceImpl.java:203)
    at ghidra.framework.project.tool.ToolManagerImpl.restoreFromXml(ToolManagerImpl.java:322)
    at ghidra.framework.project.DefaultProject.restore(DefaultProject.java:483)
    at ghidra.framework.project.DefaultProjectManager.openProject(DefaultProjectManager.java:146)
    at ghidra.GhidraRun.doOpenProject(GhidraRun.java:191)
    at ghidra.GhidraRun.lambda$openProject$3(GhidraRun.java:184)
    at ghidra.util.Swing.lambda$runNow$2(Swing.java:227)
    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:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    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.pumpEventsForFilter(EventDispatchThread.java:117)
    at java.desktop/java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:191)
    at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:236)
    at java.desktop/java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:234)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
    at java.desktop/java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:234)
    at java.desktop/java.awt.Dialog.show(Dialog.java:1080)
    at java.desktop/java.awt.Component.show(Component.java:1728)
    at java.desktop/java.awt.Component.setVisible(Component.java:1675)
    at java.desktop/java.awt.Window.setVisible(Window.java:1036)
    at java.desktop/java.awt.Dialog.setVisible(Dialog.java:1016)
    at docking.DockingDialog.setVisible(DockingDialog.java:351)
    at docking.DockingWindowManager.lambda$doShowDialog$6(DockingWindowManager.java:1856)
    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 docking.DockingWindowManager.doShowDialog(DockingWindowManager.java:1860)
    at docking.DockingWindowManager.showDialog(DockingWindowManager.java:1809)
    at ghidra.util.task.TaskDialog.lambda$doShow$7(TaskDialog.java:373)
    at ghidra.util.Swing.runIfSwingOrRunLater(Swing.java:124)
    at ghidra.util.task.TaskDialog.doShow(TaskDialog.java:370)
    at ghidra.util.task.TaskDialog.doShowModal(TaskDialog.java:350)
    at ghidra.util.task.TaskDialog.show(TaskDialog.java:324)
    at ghidra.util.task.TaskRunner.lambda$showTaskDialog$1(TaskRunner.java:123)
    at ghidra.util.Swing.runIfSwingOrRunLater(Swing.java:124)
    at ghidra.util.task.TaskRunner.showTaskDialog(TaskRunner.java:120)
    at ghidra.util.task.TaskRunner.run(TaskRunner.java:54)
    at ghidra.util.task.TaskLauncher.<init>(TaskLauncher.java:221)
    at ghidra.util.task.TaskLauncher.<init>(TaskLauncher.java:203)
    at ghidra.util.task.TaskLauncher.launchModal(TaskLauncher.java:153)
    at ghidra.GhidraRun.openProject(GhidraRun.java:185)
    at ghidra.GhidraRun.openProject(GhidraRun.java:176)
    at ghidra.GhidraRun.lambda$launch$0(GhidraRun.java:90)
    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:399)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    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-Jun-14 1025 EDT
Ghidra Version: 11.1.1
Java Home: /snap/ghidra/25/usr/lib/jvm/java-17-openjdk-amd64
JVM Version: Ubuntu 17.0.11
OS: Linux 6.1.0-25-amd64 amd64

Now, every time I attempt to run Ghidra, I get the same error.

dclane-code commented 2 months ago

Hmm, I don't have the same issue. Are you able to provide specific steps to reproduce? What is the base OS you're running the snap on? The snap is not going to be able to write to /var, that's expected.

spitfire55 commented 2 months ago

I'm using Debian 12.

Haven't done anything complex. Just a simple snap install ghidra followed by snap run ghidra.

When I create a project, I also get this error in the User Log:

2024-09-17 | 17:15:15 | ERROR | (FileCache) Failed to get java FileStore for path /var/tmp/<username>-ghidra/fscache2, will be unable to check free/available space.

This is likely a similar issue re: write permissions for snap packages conflicting w/ Ghidra

I typically don't use snap, but I saw that Ghidra was available in the snap store, and figured I would give it a shot to make the installation process easier on my VM.

After uninstalling it and re-installing via sudo snap install ghidra to see if installing w/ sudo permissions would fix the issue, the errors are still present.