Open tpimh opened 2 months ago
Also tested with Coretto, same error.
Ghidra Version: 11.1.2
Ghidra Release: PUBLIC
Ghidra Build Date: 2024-Jul-09 1157 EDT
Ghidra Revision: 68cad06ddfae2b92c03054357c67c32f2d0553a8
Ghidra Development Mode: false
OS Name: Linux
OS Arch: amd64
OS Version: 6.9.3-76060903-generic
OS Pretty Name: Pop!_OS 22.04 LTS
Java Vendor: Amazon.com Inc.
Java Version: 17.0.12
openjdk 17.0.12 2024-07-16 LTS
OpenJDK Runtime Environment Corretto-17.0.12.7.1 (build 17.0.12+7-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.12.7.1 (build 17.0.12+7-LTS, mixed mode, sharing)
The default tools are inside of a jar file in the installation, specifically:
{root Ghidra install dir}Ghidra/Configurations/Public_Release/lib/Public_Release.jar
It sounds like your extraction did not work work correctly. The *.tool
files should be found on the classpath when Ghidra runs.
I can confirm that this jar exists, and there's defaultTools/CodeBrowser.tool
inside it. I can confirm with inotify that the file is being opened when I run Ghidra:
$ inotifywait ghidra_11.1.2_PUBLIC/Ghidra/Configurations/Public_Release/lib/Public_Release.jar
Setting up watches.
Watches established.
ghidra_11.1.2_PUBLIC/Ghidra/Configurations/Public_Release/lib/Public_Release.jar OPEN
The next thing to confirm is whether that jar is on the classpath when you run Ghidra. From the Front End's menu, press Help
-> Runtime Information
. Then select the Classpath
tab. You can then use the filter at the bottom to see if that jar is in the list.
Yes, full path to Public_Release.jar is shown in the list. Just in case, indexes go from 0 to 165, and the index of this jar is 57.
At this point I can't think of anything else for you to try, aside from debugging the issue. If you are interested in trying to debug the issue, let me know and I will offer source code locations to add breakpoints.
Thank you very much for your support! So I built Ghidra from source, and the error is gone. I don't know now how can I reproduce it. All I did was download the source for 11.1.2, download gradle, build the source.
I started Ghidra from the resulting ghidra_11.1.2_DEV
build, and it started with no error. So I tried starting ghidra_11.1.2_PUBLIC
again, and there was no error as well. I don't know how could it have fixed it, but it certainly did.
I will try to figure out what changed in my environment, but if I can not reproduce the error, this issue can be closed.
Glad to hear the issue is fixed for you now. We can investigate further if you encounter the issue again.
Curiously, I am still getting this error on 11.1.1, but not on 11.1.2.
I'll post some debugging tips here, in case you get the desire to debug the issue.
The code is loaded in ToolUtils.getDefaultApplicationTools()
:
public static synchronized Set<ToolTemplate> getDefaultApplicationTools() {
if (defaultTools != null) {
return defaultTools;
}
Set<ToolTemplate> set = new HashSet<>();
Set<String> toolNames = ResourceManager.getResourceNames("defaultTools", ".tool");
for (String toolName : toolNames) {
if (skipTool(toolName)) {
continue;
}
ToolTemplate tool = readToolTemplate(toolName);
if (tool != null) {
set.add(tool);
}
}
defaultTools = Collections.unmodifiableSet(set);
return defaultTools;
}
One of 2 steps in here is failing: either finding the tool templates or reading the tool templates that have been found. If you debug this method, then you can see if toolNames
is empty or if the reading of the tool template is returning null
.
If toolNames
is empty, then the next step is to debug why we are not able to find a URL in the call to ResourceManager.getResourceNames("defaultTools", ".tool")
. Otherwise, you can step into the call to readToolTemplate()
to see why that is not correctly reading any discovered template files.
Describe the bug On startup, default tools are not found, so this error is triggered: https://github.com/NationalSecurityAgency/ghidra/blob/2517a3234822de74e05e642a55f79d8f3b4c5198/Ghidra/Framework/Project/src/main/java/ghidra/framework/project/DefaultProjectManager.java#L338-L344
To Reproduce Steps to reproduce the behavior:
jdk_extract_location/bin:$PATH
and runghidra_extract_location/ghidraRun
Expected behavior Ghidra starts without errors.
Logs
Environment (please complete the following information):