NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
49.06k stars 5.65k forks source link

Fix initialization of OBJECT_HASHCODE in PrivatelyQueuedListener #6657

Closed 0x-Singularity closed 1 week ago

0x-Singularity commented 1 week ago

Description This patch fixes the initialization of OBJECT_HASHCODE in the ListenerHandler class. The variable OBJECT_HASHCODE was not initialized, causing a compilation error. By initializing it properly, we ensure that the build process completes successfully.

Context This issue was encountered when building Ghidra from source on Apple Silicon (M1) machines. The uninitialized OBJECT_HASHCODE caused a compilation error, preventing successful builds. This patch resolves the issue and allows Ghidra to be built on Apple Silicon systems.

nsadeveloper789 commented 1 week ago

What version of the JDK are you using? This doesn't appear to be an issue on my machine. In theory, it shouldn't matter that you're on an M1.

That said, the proposed change seems innocuous.

ryanmkurtz commented 1 week ago

FWIW, it works fine on my M1.

0x-Singularity commented 1 week ago

My JDK version: javac 22.0.1

These are the steps I took that gave me the error that wouldn't let me build Ghidra.

ryanmkurtz commented 1 week ago

Looks to be a JDK 22 thing. I upgraded from 21 to 22 on my M1 and am reproducing the issue.