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

Searching for symbol in big binary lags UI. #6847

Closed
teropentis64 opened this issue Aug 23, 2024 · 11 comments
Closed

Searching for symbol in big binary lags UI. #6847

teropentis64 opened this issue Aug 23, 2024 · 11 comments

Comments

@teropentis64
Copy link

teropentis64 commented Aug 23, 2024

Is your feature request related to a problem? Please describe.
Trying to search for a symbol in a big binary freezes / heavily lags UI.

Describe the solution you'd like
Add option to make search field ("Filter" field to be precise) do it's action on some user feedback. For example clicking "enter" key. Sometimes updating results on every key input makes it extremely slow.

@dragonmacher
Copy link
Collaborator

dragonmacher commented Aug 23, 2024

Which search feature are you using? We have quite a few. Please list the steps you used to exhibit the behavior.

Most searching is done in the background. This leaves the UI free to paint without being sluggish. It's possible there is a a bug, but it could also be that your system is running into a resource issue, like not enough RAM.

@teropentis64
Copy link
Author

teropentis64 commented Aug 23, 2024

The stuck feature is "Symbol Tree" on the left side. If it's stuck, it's always with "Expanding nodes..." text. I just encountered it. Ghidra is not responding, there is 13GB of memory left, and CPU usage is at 50% total.
To add, I'm using the latest Ghidra and MacOS Sonoma 14.6.1 on Intel CPU.

@dragonmacher
Copy link
Collaborator

I see. A thread dump will help us determine what is happening when you get into this state.

From a terminal you can run these commands:

jps
jstack <Ghidra pid>

@teropentis64
Copy link
Author

teropentis64 commented Aug 23, 2024

Sure thing. As previously, Ghidra is stuck on (*was, by the time I wrote that, extracted log, and took screenshot, it unfroze itself, approx 3-4 min.) Expanding nodes...
log.txt
log2

@dragonmacher
Copy link
Collaborator

Something to try: before you open your binary, you can open the Code Browser and then close the Symbol Tree. After re-opening your binary, see if the issue persists. I'd like to isolate the Symbol Tree to verify that is the issue.

@dragonmacher
Copy link
Collaborator

The issue appears to be an infinite loop inside of the Mac AppKit Thread:

	at sun.lwawt.macosx.LWCToolkit.doAWTRunLoopImpl([email protected]/Native Method)
	at sun.lwawt.macosx.LWCToolkit.doAWTRunLoop([email protected]/LWCToolkit.java:938)
	at sun.lwawt.macosx.LWCToolkit.invokeAndWait([email protected]/LWCToolkit.java:740)
	at sun.lwawt.macosx.LWCToolkit.invokeAndWait([email protected]/LWCToolkit.java:685)
	at sun.lwawt.macosx.CAccessibility.invokeAndWait([email protected]/CAccessibility.java:136)
	at sun.lwawt.macosx.CAccessibility.invokeAndWait([email protected]/CAccessibility.java:129)
	at sun.lwawt.macosx.CAccessibility.getChildrenAndRolesRecursive([email protected]/CAccessibility.java:764)

We been working on accessibility over the last year. It's possible we have introduce code that can trigger this infinite loop. We will investigate this.

@dragonmacher
Copy link
Collaborator

This may be related this:

corretto/corretto-17#132

@teropentis64
Copy link
Author

The issue only appears when the Filter field is populated with something. I can try using CMD+T symbol menu and report back, but I think it's highly related to revealing these trees. I don't have any accessibility options enabled but I can try the solution provided in linked issue.

@teropentis64
Copy link
Author

teropentis64 commented Aug 23, 2024

Also, is there any recommended JDK version for Ghidra ? I was using the newest one before, and switched to mentioned JBR17 and I already can see difference in snappiness of Ghidra (maybe just a placebo though).

@dragonmacher
Copy link
Collaborator

This is the link we provide on the main github page (jdk 21): https://adoptium.net/temurin/releases/

You can always try different implementations as needed. I don't have a personal recommendation for what is best on the Mac.

@teropentis64
Copy link
Author

Seems like JDK 17 fixed my issue. Even more, Ghidra feels a lot snappier, now I'm certain thats the case. Thanks!

@ryanmkurtz ryanmkurtz removed the Status: Triage Information is being gathered label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants