Skip to content

Force java.awt.headless=true on pyghidra's JVM#706

Open
ANogin wants to merge 2 commits into
masterfrom
feature/pyghidra_force_headless
Open

Force java.awt.headless=true on pyghidra's JVM#706
ANogin wants to merge 2 commits into
masterfrom
feature/pyghidra_force_headless

Conversation

@ANogin
Copy link
Copy Markdown
Contributor

@ANogin ANogin commented Feb 9, 2026

  • I have reviewed the OFRAK contributor guide and attest that this pull request is in accordance with it.
  • I have made or updated a changelog entry for the changes in this pull request.

One sentence summary of this PR (This should go in the CHANGELOG!)

Force java.awt.headless=true on pyghidra's JVM to prevent HeadlessException when DISPLAY is set but X11 is unreachable

Link to Related Issue(s)

N/A

Please describe the changes in your request.

PyGhidra's HeadlessPyGhidraLauncher initializes Ghidra in headless mode but does not set java.awt.headless at the JVM level. Ghidra's launch.properties loads AWT rendering flags unconditionally, so when DISPLAY is set but X11 is unreachable, any AWT code path fails with a HeadlessException.

Fix by pre-empting pyghidra.open_program()'s lazy JVM startup with an explicit HeadlessPyGhidraLauncher that injects the headless flag.

Anyone you think should look at this, specifically?

Not sure. @paulnoalhyt @whyitfor ?

@ANogin ANogin requested a review from paulnoalhyt February 9, 2026 02:18
@ANogin ANogin self-assigned this Feb 9, 2026
PyGhidra's HeadlessPyGhidraLauncher initializes Ghidra in headless mode
but does not set java.awt.headless at the JVM level. Ghidra's
launch.properties loads AWT rendering flags unconditionally, so when
DISPLAY is set but X11 is unreachable (Docker, CI, SSH, devcontainers),
any AWT code path fails with a HeadlessException.

Fix by pre-empting pyghidra.open_program()'s lazy JVM startup with an
explicit HeadlessPyGhidraLauncher that injects the headless flag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ANogin ANogin force-pushed the feature/pyghidra_force_headless branch from 03c3392 to 016b951 Compare February 9, 2026 02:21
ANogin pushed a commit that referenced this pull request Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant