Skip to content

fix(linux): improve Hopper reliability and CachyOS support - #963

Merged
N0zoM1z0 merged 5 commits into
morluto:mainfrom
Namnarak:fix/linux-hopper-reliability
Oct 7, 2026
Merged

N0zoM1z0 merged 5 commits into
morluto:mainfrom
Namnarak:fix/linux-hopper-reliability

Conversation

@Namnarak

@Namnarak Namnarak commented Oct 7, 2026

Copy link
Copy Markdown

Summary

This PR improves the reliability of REA's Linux Hopper integration based on failures reproduced and tested on CachyOS.

It includes four related fixes:

  • detect Hopper's demo Registration dialog semantically instead of matching one exact window geometry
  • keep Hopper child cleanup bounded instead of waiting indefinitely after SIGTERM
  • make runtime Hopper launcher discovery consistent with rea doctor for the legacy user-local installation
  • explicitly support CachyOS without implicitly marking every Arch-derived distribution as supported

Test environment

Tested locally on:

  • CachyOS Linux (ID=cachyos, ID_LIKE=arch)
  • Wayland desktop host
  • REA private Xvfb/X11 Hopper session
  • Hopper 6.4.2 demo build
  • Hopper launcher at ~/.local/share/rea/hopper/bin/Hopper

Real-world testing so far has been performed on one machine/environment, so I do not want to claim universal compatibility yet.

Hopper demo dialog detection

The helper currently expects the Registration dialog to have one exact geometry:

EXPECTED_DIALOG = (189, 370, 901, 284)
DEMO_CLICK = (305, 632)

On the tested system, the actual Registration dialog was 930x284, causing exit code 76 (unsupported_demo_dialog) even though the Hopper binary matched the supported digest.

The dialog exposes useful X11 metadata:

WM_NAME = "Registration"
_NET_WM_NAME = "Registration — Hopper Disassembler"
WM_CLASS = "Hopper", "Hopper"
WM_TRANSIENT_FOR = <Hopper Disassembler window>

This change identifies the Registration window and verifies that its WM_TRANSIENT_FOR parent is the Hopper Disassembler window. The Demo click is then calculated relative to the detected dialog instead of using an absolute screen coordinate.

I also tested moving and resizing the dialog to 1200x284, outside the previous exact geometry, and the helper still detected and dismissed it correctly.

Hopper launcher path consistency

rea doctor already checks the legacy user-local path:

~/.local/share/rea/hopper/bin/Hopper

but normal REA commands default to:

/opt/hopper/bin/Hopper

This can produce a state where Doctor reports Hopper healthy while analysis commands fail with executable_missing.

The runtime selection now keeps explicit configuration authoritative and otherwise uses:

  1. HOPPER_LAUNCHER_PATH
  2. executable /opt/hopper/bin/Hopper
  3. executable user-local Hopper
  4. the existing system path as the diagnostic fallback

An explicitly configured launcher path is never overridden.

CachyOS support

CachyOS reports:

ID=cachyos
ID_LIKE=arch

REA already classifies its package family as Arch, but the host support check only accepts id === "arch".

This change explicitly admits cachyos rather than accepting every ID_LIKE=arch distribution.

Validated classification:

Arch      -> supported
CachyOS   -> supported
Manjaro   -> unsupported
Garuda    -> unsupported

Bounded Hopper cleanup

One error cleanup path used:

child.terminate()
child.wait()

with no timeout.

The helper already has a bounded stop_process() implementation, so the child cleanup now reuses it.

A test process intentionally ignoring SIGTERM was terminated via SIGKILL after the existing ~2 second timeout, as expected.

Validation

Targeted tests:

  • src/application/LinuxHopper.test.ts
  • tests/composition/hopperConfig.test.ts
  • tests/boundary/providers/hopper/linuxPrivateDisplay.test.ts

Result: 45/45 passed

Additional checks passed:

  • typecheck
  • lint
  • format check
  • knip
  • build
  • Python syntax checks

I also ran the built branch against real Hopper without setting HOPPER_LAUNCHER_PATH.

The following completed successfully:

  • rea analyze
  • rea search
  • rea function
  • rea decompile

A small ELF fixture with a known main -> alpha -> beta call graph and known string was also used during testing.

No leftover Hopper/Xvfb analysis processes were observed after the completed runs.

Testing limitation

The fixes appear correct for the reproduced failure modes and the tested environment, but broader Linux/Hopper/X11 coverage would still be useful before considering the behavior universally verified.

AI assistance disclosure

This investigation, patch preparation, and testing were performed with assistance from ChatGPT.

ChatGPT was given access to my local development environment through tools connected to my account and was used to inspect REA, reproduce the failures, prepare the patches, run tests, and compare the local implementation against upstream.

This PR was prepared and submitted through my connected GitHub account by ChatGPT on my behalf, with my explicit approval. I reviewed the results before authorizing the upstream submission.

Existing upstream fix not included

During debugging I also encountered a Hopper bridge issue involving list_strings / list_names, but that issue is already fixed in newer REA code, so it is intentionally not included here.

@Namnarak Namnarak changed the title Improve Linux Hopper reliability and CachyOS support fix(linux): improve Hopper reliability and CachyOS support Oct 7, 2026

N0zoM1z0 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Follow-up on the latest head (9fe3714): the two blocking/should-fix items from review are still present.

I prepared follow-up commit d8288ef1c8bb06e5b35823c5c9c0186abd5d05f8 (fix(linux): align Hopper defaults and support docs) based exactly on that head. It:

  • removes the host-filesystem-dependent /opt/hopper/bin/Hopper assertion from src/config.test.ts; the new injected launcher-default tests remain the deterministic coverage for precedence/fallback
  • synchronizes CachyOS support wording across Doctor/Setup diagnostics, tests, user-visible error inventory, CONTRIBUTING, and README translations
  • documents Linux launcher discovery as /opt/hopper/bin/Hopper -> executable ~/.local/share/rea/hopper/bin/Hopper -> /opt diagnostic fallback, while keeping explicit HOPPER_LAUNCHER_PATH authoritative
  • adds a README conformance assertion for CachyOS

I intentionally left the _NET_WM_NAME point unchanged: the current WM_NAME + WM_TRANSIENT_FOR logic fixes the reproduced failure, so I still consider _NET_WM_NAME support a non-blocking robustness follow-up rather than a merge blocker.

The maintainer-side GitHub integration can write the upstream repo but not the fork head (Namnarak/rea), so I could not fast-forward this commit directly onto fix/linux-hopper-reliability. It is ready to cherry-pick:

git fetch upstream chatgpt/pr-963-followup
git cherry-pick d8288ef1c8bb06e5b35823c5c9c0186abd5d05f8

CI was triggered against this exact commit via temporary CI-only PR #979 (already closed to avoid leaving a duplicate PR open): https://github.com/morluto/rea/actions/runs/37635992965

@N0zoM1z0

N0zoM1z0 commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Applied d8288ef1c8bb06e5b35823c5c9c0186abd5d05f8 to this PR branch; the PR head now includes both review follow-ups.

  • Aligned launcher-default documentation and tests with executable system/user-local fallback.
  • Updated CachyOS support/remediation text across doctor, setup, docs and localized READMEs.
  • Local focused verification: 102 tests / 7 files passed, including launcher selection, Linux setup/doctor, private-display/dialog and cleanup fixtures, and README consistency. docs:check and pre-push typecheck/lint passed.

Fresh CI is running for this PR head. I will check its final results and reviews before merging. These local checks do not claim a live Hopper session on CachyOS.

@N0zoM1z0 N0zoM1z0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the final head d8288ef, including the follow-up fixes for host-dependent launcher expectations and Linux/CachyOS documentation and diagnostics.

Verification: 102 focused tests across 7 files passed; docs:check and typecheck/lint passed. The fresh CI run for this fork PR (37638890681) completed successfully with all 22 jobs passing, including Linux, Windows, and Darwin lanes.

No remaining blocking findings in the reviewed changes. My local verification covers configuration, private-display helper behavior, and bounded cleanup; it does not add a new live CachyOS/Hopper GUI verification claim beyond the contributor's reported testing.

@morluto

morluto commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Thanks, @Namnarak, for your work on “fix(linux): improve Hopper reliability and CachyOS support.” I appreciate your contribution to REA.

darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
* fix(linux): support CachyOS Hopper hosts

* fix(config): reuse user-local Hopper launcher

* fix(hopper): harden Linux demo dialog handling

* chore: retrigger CI after PR title fix

* fix(linux): align Hopper defaults and support docs

---------

Co-authored-by: Ysopwnable <[email protected]>
@morluto morluto added bug Something isn't working area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
@morluto morluto added the provider: hopper Analysis provider / engine: hopper label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior bug Something isn't working provider: hopper Analysis provider / engine: hopper

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants