skylot/jadx · error · JadxRuntimeException

Failed to process method to visitor:

Error message

Failed to process method to visitor: 

What it means

Thrown by ProcessClass.processMethodToVisitor when an exception occurs while running visitor passes on a single method up to a specified pass. The method unloads and reloads the method, then iterates through the passes list calling DepthTraversal.visit until lastPassToProcess is reached. Any exception during this iteration is wrapped in a JadxRuntimeException naming the target visitor.

Source

Thrown at jadx-core/src/main/java/jadx/core/ProcessClass.java:243

		if (foundPass == null) {
			return false;
		}
		return processMethodToVisitor(mth, foundPass);
	}

	public boolean processMethodToVisitor(MethodNode mth, IDexTreeVisitor lastPassToProcess) {
		synchronized (mth.getTopParentClass().getClassInfo()) {
			try {
				mth.unload();
				mth.load();
				for (IDexTreeVisitor pass : passes) {
					DepthTraversal.visit(pass, mth);
					if (pass == lastPassToProcess) {
						return true;
					}
				}
			} catch (Exception e) {
				throw new JadxRuntimeException("Failed to process method to visitor: " + lastPassToProcess, e);
			}
			return false;
		}
	}

	// TODO: make passes list private and not visible
	public List<IDexTreeVisitor> getPasses() {
		return passes;
	}
}

View on GitHub (pinned to e738a26571)

Solutions

  1. Examine getCause() to identify the failing visitor pass class and the root exception.
  2. Ensure the method node is in a valid state (loaded, not partially unloaded) before calling processMethodToVisitor.
  3. Catch JadxRuntimeException around the call and fall back to full class reprocessing (forceProcess + generateCode).
  4. Report reproducible single-method failures with the method signature and full cause to jadx maintainers.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    boolean ok = processClass.processMethodToVisitor(mth, lastPass);
    if (!ok) {
        LOG.warn("Pass {} not found for method {}", lastPass, mth);
    }
} catch (JadxRuntimeException e) {
    LOG.warn("Method pass {} failed for {}: {}", lastPass, mth, e.getCause().getMessage());
    // fall back to full class reprocessing
}

Prevention

When it happens

Trigger: Calling processMethodToVisitor(mth, lastPassToProcess) where a visitor pass throws during DepthTraversal.visit. This API is used for partial reprocessing of a method (e.g., interactive decompiler workflows that re-run passes after user edits). The exception occurs within a synchronized block on the top-parent class's ClassInfo, so it also signals a lock-held failure.

Common situations: Interactive or programmatic decompiler sessions that selectively re-run passes on individual methods. Reprocessing a method whose state was manually modified between passes. Obfuscated method bodies that trigger visitor-specific bugs (e.g., type inference, SSATransform).

Related errors


AI-assisted analysis of skylot/jadx@e738a26571 (2026-08-14). Data as JSON: /api/errors/4ca0d1062311e551. Report an issue: GitHub.