frida-java-bridge icon indicating copy to clipboard operation
frida-java-bridge copied to clipboard

Java API only partially available?

Open tr33s opened this issue 5 years ago • 14 comments

Error: Java API only partially available; please file a bug. Missing: _ZN6Method4sizeEb, _ZN6Method19set_native_functionEPhb, _ZN6Method21clear_native_functionEv, _ZN6Method24restore_unshareable_infoEP6Thread, _ZN6Method10jmethod_idEv, _ZN20ClassLoaderDataGraph10classes_doEP12KlassClosure, _ZN10JavaThread27thread_from_jni_environmentEP7JNIEnv_ at m (frida/node_modules/frida-java-bridge/lib/jvm.js:84:1) at u (frida/node_modules/frida-java-bridge/lib/jvm.js:10:1) at f._tryInitialize (frida/node_modules/frida-java-bridge/index.js:17:1) at new f (frida/node_modules/frida-java-bridge/index.js:9:1) at Object.4../lib/android (frida/node_modules/frida-java-bridge/index.js:308:1) at o (frida/node_modules/browser-pack/_prelude.js:1:1) at frida/node_modules/browser-pack/_prelude.js:1:1 at Object.19.frida-java-bridge (frida/runtime/java.js:1:1) at o (frida/node_modules/browser-pack/_prelude.js:1:1) at r (frida/node_modules/browser-pack/_prelude.js:1:1)

To be clear, I am running frida on a (HotSpot) java instance.

If this is an issue on my end please let me know.

tr33s avatar Jun 30 '20 14:06 tr33s

Which JDK version and OS are you using?

0xra avatar Jul 01 '20 13:07 0xra

I'm on Windows 10 x64, and I tested Oracle JDK8/JDK11/JDK14 (x64) and also with OpenJDK (Hotspot, x64) 8, 11, 14.

Possibility of architecture issue, or none of those are compiled with symbols? Will build the JDK manually if I need to.

tr33s avatar Jul 01 '20 14:07 tr33s

Yes, you need symbols. To test you can use Module.enumerateSymbolsSync('jvm.dll'). Try DebugSymbol.load(path) on a pdb

0xra avatar Jul 01 '20 15:07 0xra

Loading a PDB doesn't seem to work with any of these path specs:

  • /d/tools/sdk/jdk-8u262/bin/java.pdb
  • D:\\tools\\sdk\\jdk-8u262\\bin\\java.pdb
  • D:/tools/sdk/jdk-8u262/bin/java.pdb
[Local::PID::12092]-> Error: unable to load symbols
    at /subtask1.js:1

Using https://github.com/ojdkbuild/ojdkbuild/releases's java-1.8.0-openjdk-1.8.0.265-1.b01-x86 doesn't work on Windows.

Error: Java API only partially available; please file a bug. Missing: _ZN6Method4sizeEb, _ZN6Method19set_native_functionEPhb, _ZN6Method21clear_native_functionEv, _ZN6Method24restore_unshareable_infoEP6Thread, _ZN6Method10jmethod_idEv, _ZN20ClassLoaderDataGraph10classes_doEP12KlassClosure, _ZN10JavaThread27thread_from_jni_environmentEP7JNIEnv_, _ZN8VMThread7executeEP12VM_Operation, _ZN11OopMapCache22flush_obsolete_entriesEv, _ZN14NMethodSweeper16sweep_code_cacheEv, JVM_Sleep, _ZTV18VM_RedefineClasses, _ZN18VM_RedefineClasses4doitEv, _ZN18VM_RedefineClasses13doit_prologueEv, _ZN18VM_RedefineClasses13doit_epilogueEv, _ZNK18VM_RedefineClasses26allow_nested_vm_operationsEv, _ZN19Abstract_VM_Version19jre_release_versionEv, _ZN14NMethodSweeper11_traversalsE, _ZN14NMethodSweeper13_should_sweepE
    at K (frida/node_modules/frida-java-bridge/lib/jvm.js:267)
    at O (frida/node_modules/frida-java-bridge/lib/jvm.js:34)
    at frida/node_modules/frida-java-bridge/index.js:53
    at e (frida/node_modules/frida-java-bridge/index.js:36)
    at frida/node_modules/frida-java-bridge/index.js:564
    at o (frida/node_modules/browser-pack/_prelude.js:1)
    at frida/runtime/java.js:1
    at o (/_java.js:1)
    at r (/_java.js:1)

pandasauce avatar Jul 31 '20 15:07 pandasauce

any solution for this?

londek avatar Oct 19 '20 01:10 londek

I encountered the same problem, is it solved?

stefan00lpf avatar Nov 25 '20 02:11 stefan00lpf

@liupingfang you have to use JDK with symbols on (Unix-like system, Windows is currently not supported by Frida)

londek avatar Nov 25 '20 11:11 londek

As @Londek already mentioned, you need to use JDK with debug symbols, see https://adoptopenjdk.net/upstream.html?vmVariant=hotspot

no-sec-marko avatar Mar 18 '21 19:03 no-sec-marko

Windows is currently not supported by Frida

Is this true? I am having this issue and I have installed OpenJDK8 with debug symbols in the jvm.pdb file. And like @pandasauce, it does not load. The application I am testing is Windows only. Does this mean I cannot use Frida to test this Java app?

pinkLagoon avatar Nov 12 '21 08:11 pinkLagoon

I have confirmed the above to be the case, you need to use Linux and MacOS to be able to use Frida on a desktop Java app: https://www.ayrx.me/frida-hotspot-jvm/

pinkLagoon avatar Nov 17 '21 05:11 pinkLagoon

I ran into this issue, even with hostspot

sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                                 Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/java   1111      auto mode
* 1            /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/bin/java   1111      manual mode
  2            /usr/lib/jvm/java-11-openjdk-amd64/bin/java           1111      manual mode
nm /usr/lib/jvm/adoptopenjdk-11-hotspot-amd64/lib/server/libjvm.so

                 U abort@@GLIBC_2.2.5
000000000156d300 b AbortVMOnCompilationFailure
000000000156d370 b AbortVMOnException
000000000156d368 b AbortVMOnExceptionMessage
000000000156d43a b AbortVMOnSafepointTimeout
000000000156d439 b AbortVMOnVMOperationTimeout
00000000015250a0 d AbortVMOnVMOperationTimeoutDelay
0000000000ab2d68 t acb_CopyLeft
0000000000ab2cca t acb_CopyRight
                 U accept@@GLIBC_2.2.5
                 U access@@GLIBC_2.2.5
. . .
nm /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so 
nm: /usr/lib/jvm/java-11-openjdk-amd64/lib/server/libjvm.so: no symbols
frida --version
15.1.14

PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

teamblubee avatar Jan 19 '22 21:01 teamblubee

Any news? Still have issue.. Downloaded JDK 17 and still have issue.

depocoder avatar Jun 23 '23 09:06 depocoder

i have the same problem on android 12 when i run frida-server it give me an error

ImMohammad20000 avatar Dec 31 '23 08:12 ImMohammad20000