Skip to content

Fix incorrect ART class spec offsets#359

Merged
oleavr merged 4 commits into
frida:mainfrom
AeonLucid:fix/art-class-spec
Jul 18, 2025
Merged

Fix incorrect ART class spec offsets#359
oleavr merged 4 commits into
frida:mainfrom
AeonLucid:fix/art-class-spec

Conversation

@AeonLucid

@AeonLucid AeonLucid commented Jul 11, 2025

Copy link
Copy Markdown
Contributor

This PR requires a new Frida build because it affects the internal system_server agent.

Closes


As you can see this is a widespread issue.

The issue is that the current code only accounts for the ART class layout based on the android sdk.
However, libart.so is shipped with the google security updates, that way you can have an Android 16 layout on Android 15.
This is why pm uninstall com.google.android.art is a "fix", although temporarily.

I fixed this by automatically detecting the offsets for the art class spec. By using a known class java/lang/Integer we can search for known fields / methods and find the necessary offsets that way.

@AeonLucid AeonLucid changed the title Fix system_server crashes - automatically detect offsets for ART class spec Fix incorrect ART class spec offsets Jul 11, 2025
AeonLucid

This comment was marked as duplicate.

Comment thread lib/android.js
@ExternalAddress4401

ExternalAddress4401 commented Jul 17, 2025

Copy link
Copy Markdown

Unrelated to the code changes but just a heads up that I built a gadget based off this PR and still get the same looking crash as #360

This happens on 16.6.6 as well so it's unrelated to Frida 17 changes. There are still unresolved ART issues somewhere. This affected device is unrootable otherwise I would do more digging into it.

@AeonLucid

Copy link
Copy Markdown
Contributor Author

Unrelated to the code changes but just a heads up that I built a gadget based off this PR and still get the same looking crash as #360

This happens on 16.6.6 as well so it's unrelated to Frida 17 changes. There are still unresolved ART issues somewhere. This affected device is unrootable otherwise I would do more digging into it.

Hello! Since Frida 17.2.0 the shims, such as frida-java-bridge are bundled in your scripts. Did you apply the patch to there as well? Can you give some more details on when the crash happens?

@ExternalAddress4401

ExternalAddress4401 commented Jul 17, 2025

Copy link
Copy Markdown

Unrelated to the code changes but just a heads up that I built a gadget based off this PR and still get the same looking crash as #360
This happens on 16.6.6 as well so it's unrelated to Frida 17 changes. There are still unresolved ART issues somewhere. This affected device is unrootable otherwise I would do more digging into it.

Hello! Since Frida 17.2.0 the shims, such as frida-java-bridge are bundled in your scripts. Did you apply the patch to there as well? Can you give some more details on when the crash happens?

Nope! I did not. I did indeed manage to get a simple gadget sanity check to run with these changes successfully after also applying it to my script.

import Java from "frida-java-bridge";

Java.perform(() => {
    var Log = Java.use("android.util.Log");
    Log.v("test", "Hello!");
})

adb logcat -s "test"
--------- beginning of main
07-17 09:42:23.960 19528 19528 V test: Hello!

@oleavr oleavr merged commit 534d8d0 into frida:main Jul 18, 2025
1 of 11 checks passed
@oleavr

oleavr commented Jul 18, 2025

Copy link
Copy Markdown
Member

Thanks! 🙌

@ExternalAddress4401

ExternalAddress4401 commented Jul 18, 2025

Copy link
Copy Markdown

There might be a slight problem here that I didn't get around to testing. I don't know if it's better to put it here or as a new issue but I figured you'd see it here.

I run a script through an eval as part of my project to let it download and execute new versions and such and it seems to crash when it attempts to use frida-java-bridge with an error that sounds like it originates from this change. The code I'm running would basically be:

import Java from 'frida-java-bridge';

eval("import Java from 'frida-java-bridge'; var Log = Java.use('android.util.Log');"); <-- this is an actual compiled script of course

07-18 08:55:35.593 22684 22684 F DEBUG : Abort message: 'No pending exception expected: java.lang.NoSuchFieldError: no "I" field "value" in class "Ljava/lang/Integer;" or its superclasses

Which I think matches https://github.com/frida/frida-java-bridge/pull/359/files#diff-127e99379196fef4dc63a69846f5adbcf81a12eb24557f9b1850b85a9f4f78dfR1026

Full crash log

-18 08:55:35.304 22580 22649 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 22649 (UnityMain), pid 22580 (egames.beatstar)
07-18 08:55:35.342 22684 22684 I crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstoneProto
07-18 08:55:35.342   768   768 I tombstoned: received crash request for pid 22649
07-18 08:55:35.342 22684 22684 I crash_dump64: performing dump of process 22580 (target tid = 22649)
07-18 08:55:35.343  1233 22578 I HYPER-HAL: [RequestManager.cpp]releaseLocked(): Released ID : 9890145
07-18 08:55:35.419  1233 22597 I HYPER-HAL: [ResourceManager.cpp]removeResource(): [CPUMaxFreq] RemoveResource Request ID : 9867915
07-18 08:55:35.419  1233 22597 I HYPER-HAL: [RequestManager.cpp]releaseLocked(): Released ID : 9867915
07-18 08:55:35.593 22684 22684 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-18 08:55:35.593 22684 22684 F DEBUG   : Build fingerprint: 'samsung/r8qcsx/r8q:13/TP1A.220624.014/G781WVLSJHYC2:user/release-keys'
07-18 08:55:35.593 22684 22684 F DEBUG   : Revision: '6'
07-18 08:55:35.593 22684 22684 F DEBUG   : ABI: 'arm64'
07-18 08:55:35.593 22684 22684 F DEBUG   : Processor: '7'
07-18 08:55:35.593 22684 22684 F DEBUG   : Timestamp: 2025-07-18 08:55:35.347428592-0700
07-18 08:55:35.593 22684 22684 F DEBUG   : Process uptime: 2s
07-18 08:55:35.593 22684 22684 F DEBUG   : Cmdline: com.spaceapegames.beatstar
07-18 08:55:35.593 22684 22684 F DEBUG   : pid: 22580, tid: 22649, name: UnityMain  >>> com.spaceapegames.beatstar <<<
07-18 08:55:35.593 22684 22684 F DEBUG   : uid: 10341
07-18 08:55:35.593 22684 22684 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
**07-18 08:55:35.593 22684 22684 F DEBUG   : Abort message: 'No pending exception expected: java.lang.NoSuchFieldError: no "I" field "value" in class "Ljava/lang/Integer;" or its superclasses**
07-18 08:55:35.593 22684 22684 F DEBUG   :   at boolean com.unity3d.player.UnityPlayer.nativeRender() (SourceFile:-2)
07-18 08:55:35.593 22684 22684 F DEBUG   :   at boolean com.unity3d.player.UnityPlayer.x(com.unity3d.player.UnityPlayer) (SourceFile:1)
07-18 08:55:35.593 22684 22684 F DEBUG   :   at boolean com.unity3d.player.B0.handleMessage(android.os.Message) (SourceFile:123)
07-18 08:55:35.593 22684 22684 F DEBUG   :   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
07-18 08:55:35.593 22684 22684 F DEBUG   :   at boolean android.os.Looper.loopOnce(android.os.Looper, long, int) (Looper.java:226)
07-18 08:55:35.593 22684 22684 F DEBUG   :   at void android.os.Looper.loop() (Looper.java:313)
07-18 08:55:35.593 22684 22684 F DEBUG   :   at void com.unity3d.player.C0.run() (SourceFile:25)'
07-18 08:55:35.593 22684 22684 F DEBUG   :     x0  0000000000000000  x1  0000000000005879  x2  0000000000000006  x3  000000754b6137e0
07-18 08:55:35.593 22684 22684 F DEBUG   :     x4  000000769434f000  x5  000000769434f000  x6  000000769434f000  x7  0000000000bbe9c0
07-18 08:55:35.593 22684 22684 F DEBUG   :     x8  00000000000000f0  x9  0000007683ab5bf0  x10 0000000000000001  x11 0000007683b2a3ec
07-18 08:55:35.594 22684 22684 F DEBUG   :     x12 000000754b22b430  x13 0000000005f6fc08  x14 0000000005f6fac8  x15 0000400b0f6a41bd
07-18 08:55:35.594 22684 22684 F DEBUG   :     x16 0000007683b95a58  x17 0000007683b6e120  x18 0000000000000000  x19 0000000000005834
07-18 08:55:35.594 22684 22684 F DEBUG   :     x20 0000000000005879  x21 00000000ffffffff  x22 00000075e9a0d000  x23 00000075e9a0ee20
07-18 08:55:35.594 22684 22684 F DEBUG   :     x24 b4000075dfb76400  x25 0000000000fffff9  x26 000000005a000000  x27 000000754b61f000
07-18 08:55:35.594 22684 22684 F DEBUG   :     x28 0000000000000000  x29 000000754b613860
07-18 08:55:35.594 22684 22684 F DEBUG   :     lr  0000007683b1b368  sp  000000754b6137c0  pc  0000007683b1b394  pst 0000000000001000
07-18 08:55:35.594 22684 22684 F DEBUG   : backtrace:
07-18 08:55:35.594 22684 22684 F DEBUG   :       #00 pc 000000000008d394  /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) (BuildId: 1bcad8bca80d38bceb9089f70d394e33)
07-18 08:55:35.594 22684 22684 F DEBUG   :       #01 pc 00000000008a14a4  /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+476) (BuildId: d57befa204d91d200485ace46c3b8814)
07-18 08:55:35.594 22684 22684 F DEBUG   :       #02 pc 0000000000016188  /apex/com.android.art/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_0::__invoke(char const*)+80) (BuildId: 5e1c2a9a9b42ab6e6a3f44738913b9f7)
07-18 08:55:35.594 22684 22684 F DEBUG   :       #03 pc 0000000000015730  /apex/com.android.art/lib64/libbase.so (android::base::LogMessage::~LogMessage()+544) (BuildId: 5e1c2a9a9b42ab6e6a3f44738913b9f7)
07-18 08:55:35.594 22684 22684 F DEBUG   :       #04 pc 00000000002d2ed0  /apex/com.android.art/lib64/libart.so (art::Thread::AssertNoPendingException() const+572) (BuildId: d57befa204d91d200485ace46c3b8814)
07-18 08:55:35.594 22684 22684 F DEBUG   :       #05 pc 0000000000205270  /apex/com.android.art/lib64/libart.so (art::ClassLinker::FindClass(art::Thread*, char const*, unsigned long, art::Handle<art::mirror::ClassLoader>)+68) (BuildId: d57befa204d91d200485ace46c3b8814)
07-18 08:55:35.594 22684 22684 F DEBUG   :       #06 pc 00000000002bf130  /apex/com.android.art/lib64/libart.so (art::FindFieldJNI(art::ScopedObjectAccess const&, _jclass*, char const*, char const*, bool)+524) (BuildId: d57befa204d91d200485ace46c3b8814)
07-18 08:55:35.594 22684 22684 F DEBUG   :       #07 pc 000000000065fbc0  /apex/com.android.art/lib64/libart.so (art::JNI<false>::GetStaticFieldID(_JNIEnv*, _jclass*, char const*, char const*)+180) (BuildId: d57befa204d91d200485ace46c3b8814)
07-18 08:55:35.594 22684 22684 F DEBUG   :       #08 pc 0000000000ac1d5c  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #09 pc 0000000000ac17b8  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #10 pc 0000000000998a94  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #11 pc 0000000000998640  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #12 pc 000000000099859c  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #13 pc 0000000000b73c98  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #14 pc 0000000000b74c18  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #15 pc 0000000000b73a9c  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #16 pc 0000000000b87058  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #17 pc 0000000000b6aa9c  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #18 pc 0000000000b73c98  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #19 pc 0000000000b74d44  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #20 pc 0000000000b74d44  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #21 pc 0000000000b74c18  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #22 pc 0000000000b74d44  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #23 pc 0000000000b74c18  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #24 pc 0000000000b74c18  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #25 pc 0000000000b74c18  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #26 pc 0000000000b74d44  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #27 pc 0000000000b74d44  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #28 pc 0000000000b74d44  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #29 pc 0000000000b74d44  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #30 pc 0000000000b74c18  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #31 pc 0000000000b6ea24  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #32 pc 0000000000b7a71c  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #33 pc 0000000000b80830  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #34 pc 0000000000b7a8ac  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #35 pc 0000000000b8722c  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #36 pc 0000000000b75290  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #37 pc 0000000000b8af00  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #38 pc 0000000000b93e28  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #39 pc 0000000000b7fb14  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #40 pc 0000000000b73c98  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #41 pc 0000000000b74c18  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #42 pc 0000000000b8af00  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #43 pc 0000000000b93e28  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #44 pc 0000000000b7fb14  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #45 pc 0000000000b73c98  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #46 pc 0000000000b74c18  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #47 pc 0000000000b8af00  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #48 pc 0000000000b93e28  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #49 pc 0000000000b7fbb0  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #50 pc 0000000000b73c98  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #51 pc 0000000000b73a9c  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #52 pc 0000000000b8b7d0  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #53 pc 0000000000b6b0bc  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #54 pc 00000000009948bc  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #55 pc 000000000099457c  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #56 pc 00000000009b1c14  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #57 pc 00000000009767a4  /data/app/~~tukl2lWsbgaufxfL7H8Dvg==/com.spaceapegames.beatstar-wKqiPRCTJMC5frqrLs5Kgw==/lib/arm64/libfrida-gadget.so
07-18 08:55:35.594 22684 22684 F DEBUG   :       #58 pc 00000000000001f8  <anonymous:768d780000>

@AeonLucid

AeonLucid commented Jul 19, 2025

Copy link
Copy Markdown
Contributor Author

@ExternalAddress4401 Can you wrap the var Log = Java.use('android.util.Log'); code in a Java.perform callback inside the eval? Or does it happen on the import?

@d0td0tslash

Copy link
Copy Markdown

The soft reboot is still happening with frida-server-17.2.12 on my Pixel 6 running Android 15

How to replicate:

  1. adb push frida-server-17.2.12-android-arm64 /data/local/tmp
  2. adb shell
  3. su
  4. # chmod +x /data/local/tmp/frida-server-17.2.12-android-arm64
  5. # /data/local/tmp/frida-server-17.2.12-android-arm64

No errors showing during the execution

  1. Simply open Google Chrome on the phone, and it will soft-reboot.

logcat:

--------- beginning of crash
07-19 15:43:43.714   852   852 F libc    : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 852 (main), pid 852 (main)
07-19 15:43:43.797   852   852 F libc    : Crash due to signal: failed to wait for crash_dump helper: No child processes
07-19 15:43:44.003  7563  7563 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
07-19 15:43:44.003  7563  7563 F DEBUG   : Build fingerprint: 'google/oriole/oriole:15/BP1A.250505.005/13277524:user/release-keys'
07-19 15:43:44.003  7563  7563 F DEBUG   : Revision: 'MP1.0'
07-19 15:43:44.003  7563  7563 F DEBUG   : ABI: 'arm'
07-19 15:43:44.003  7563  7563 F DEBUG   : Timestamp: 2025-07-19 15:43:43.807587381+0100
07-19 15:43:44.003  7563  7563 F DEBUG   : Process uptime: 121s
07-19 15:43:44.003  7563  7563 F DEBUG   : Cmdline: zygote
07-19 15:43:44.003  7563  7563 F DEBUG   : pid: 852, tid: 852, name: main  >>> zygote <<<
07-19 15:43:44.003  7563  7563 F DEBUG   : uid: 0
07-19 15:43:44.003  7563  7563 F DEBUG   : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
07-19 15:43:44.003  7563  7563 F DEBUG   : Abort message: 'Failed to reach single-threaded state: wait_time = 4548'
07-19 15:43:44.003  7563  7563 F DEBUG   :     r0  00000000  r1  00000354  r2  00000006  r3  ffd82c10
07-19 15:43:44.003  7563  7563 F DEBUG   :     r4  ffd82c10  r5  00000354  r6  00000354  r7  0000016b
07-19 15:43:44.003  7563  7563 F DEBUG   :     r8  00000000  r9  ffffffff  r10 b622a720  r11 ebaa9200
07-19 15:43:44.003  7563  7563 F DEBUG   :     ip  ffd82c20  sp  ffd82c08  lr  f103a997  pc  f103a9aa
07-19 15:43:44.003  7563  7563 F DEBUG   : 2 total frames
07-19 15:43:44.003  7563  7563 F DEBUG   : backtrace:
07-19 15:43:44.003  7563  7563 F DEBUG   :       #00 pc 000399aa  /apex/com.android.runtime/lib/bionic/libc.so (abort+138) (BuildId: fbea3c3b8279f8e40f951dbd4844f9aa)
07-19 15:43:44.003  7563  7563 F DEBUG   :       #01 pc 00000507  <anonymous:f1979000>
--------- beginning of system

tombstone attached:
tombstone_crash_libc.so.txt

@AeonLucid

AeonLucid commented Jul 19, 2025

Copy link
Copy Markdown
Contributor Author

@d0td0tslash Hi, the crash you posted has a pending fix in this pull request frida/frida-core#1184.

You can see "Failed to reach single-threaded state: wait_time = 4548" in your crash report which has to do with the thread cloaker.

@d0td0tslash

Copy link
Copy Markdown

Looking forward to see it implemented in future releases. Thanks again for your work @AeonLucid !

@thinhbuzz

Copy link
Copy Markdown
Contributor

This PR sometimes causes problems with the error message: Unable to find fields in java/lang/Integer; please file a bug

@AeonLucid

Copy link
Copy Markdown
Contributor Author

This PR sometimes causes problems with the error message: Unable to find fields in java/lang/Integer; please file a bug

Please share a way to reproduce. You may also message me on telegram or discord.

@haris-musa

haris-musa commented Jul 20, 2025

Copy link
Copy Markdown

Hey, thank you for your work but sadly it's still crashing frida/frida#3525

@AeonLucid

Copy link
Copy Markdown
Contributor Author

Hey, thank you for your work but sadly it's still crashing frida/frida#3525

Do you have a crash log or error messages?

@haris-musa

Copy link
Copy Markdown

Hey, thank you for your work but sadly it's still crashing frida/frida#3525

Do you have a crash log or error messages?

This is full log, I am not sure what is useful.

Device: Pixel 6a
Android: 16
Frida Version: 17.2.12-android-arm64

crash_log.txt

@AeonLucid

Copy link
Copy Markdown
Contributor Author

@haris-musa Thanks, Ill have a look shortly. Can you also provide the command / script you are running so I can reproduce on my side?

@haris-musa

haris-musa commented Jul 20, 2025

Copy link
Copy Markdown

@haris-musa Thanks, Ill have a look shortly. Can you also provide the command / script you are running so I can reproduce on my side?

I am using this wrapper to start the server Frida Server

My phone freezes for a couple of seconds just as I hit "start server". Then the phone restarts

Seems a bit random also, in my last 4-5 attempts. It survived once and crashed in other attempts

@nyakokitsu

Copy link
Copy Markdown

I have crashes at latest frida, using java bridge.I think it has something to do with this.

08-12 15:13:02.115 21563 21563 F DEBUG   :       #00 pc 00000000002891ac  /apex/com.android.art/lib64/libart.so (artQuickGenericJniTrampoline+80) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #01 pc 00000000003444cc  /apex/com.android.art/lib64/libart.so (art_quick_generic_jni_trampoline+92) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #02 pc 000000000068af44  /apex/com.android.art/lib64/libart.so (nterp_helper+7636) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #04 pc 000000000068a0c4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #06 pc 000000000068a0c4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #08 pc 000000000068a0c4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #10 pc 000000000068a0c4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #12 pc 000000000068a0c4  /apex/com.android.art/lib64/libart.so (nterp_helper+3924) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #14 pc 000000000068aee4  /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #16 pc 000000000068aee4  /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #18 pc 00000000006891a4  /apex/com.android.art/lib64/libart.so (nterp_helper+52) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #22 pc 000000000068a120  /apex/com.android.art/lib64/libart.so (nterp_helper+4016) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #27 pc 000000000068af44  /apex/com.android.art/lib64/libart.so (nterp_helper+7636) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #29 pc 000000000068aee4  /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #31 pc 00000000006891a4  /apex/com.android.art/lib64/libart.so (nterp_helper+52) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #33 pc 000000000068aee4  /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #35 pc 000000000068aee4  /apex/com.android.art/lib64/libart.so (nterp_helper+7540) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #37 pc 0000000000c0fe74  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.view.View.performClick+468)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #38 pc 0000000000b4671c  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.view.View$PerformClick.run+476)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #39 pc 00000000009d2794  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Handler.dispatchMessage+68)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #40 pc 00000000009d9038  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loopOnce+1224)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #41 pc 00000000009d8acc  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.os.Looper.loop+684)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #42 pc 00000000007554bc  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (android.app.ActivityThread.main+2284)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #43 pc 000000000032d460  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #44 pc 00000000003273d0  /apex/com.android.art/lib64/libart.so (_jobject* art::InvokeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jobject*, _jobject*, unsigned long)+544) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #45 pc 00000000005c6f80  /apex/com.android.art/lib64/libart.so (art::Method_invoke(_JNIEnv*, _jobject*, _jobject*, _jobjectArray*) (.__uniq.165753521025965369065708152063621506277)+32) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #46 pc 0000000000f23a04  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+116)  
08-12 15:13:02.115 21563 21563 F DEBUG   :       #47 pc 0000000000d3e354  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run+116)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #48 pc 0000000000d4ae08  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.ZygoteInit.main+5256)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #49 pc 000000000032d460  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #50 pc 000000000032bfc8  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+800) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #51 pc 000000000064a488  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+156) (BuildId: 80d2ab18f9d259d8e546c1e6bae752b1)
08-12 15:13:02.115 21563 21563 F DEBUG   :       #53 pc 00000000000f7968  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+1008) (BuildId: 617a267daff0c7a0c9e79428f2f0fab9)

@AeonLucid

Copy link
Copy Markdown
Contributor Author

@nyakokitsu Can you create a minimal script to reproduce? So that I can look into it and fix it

@nyakokitsu

nyakokitsu commented Aug 17, 2025

Copy link
Copy Markdown

@nyakokitsu Can you create a minimal script to reproduce? So that I can look into it and fix it

@AeonLucid any function implementation hook. Absolutely any, using Java perform. Using oxygenos 15

@AeonLucid

Copy link
Copy Markdown
Contributor Author

@nyakokitsu Can you create a minimal script to reproduce? So that I can look into it and fix it

@AeonLucid any function implementation hook. Absolutely any, using Java perform. Using oxygenos 15

Can I still have a minimal script? Also please tell me which device you are using.

@nyakokitsu

nyakokitsu commented Aug 17, 2025

Copy link
Copy Markdown

@nyakokitsu Can you create a minimal script to reproduce? So that I can look into it and fix it

@AeonLucid any function implementation hook. Absolutely any, using Java perform. Using oxygenos 15

Can I still have a minimal script? Also please tell me which device you are using.

@AeonLucid i use oneplus nord 4
Minimal script:

import Java from 'frida-java-bridge';

rpc.exports = {
    init(): void {
        Java.perform(function() {
            var Class = Java.use('example.class');

            Class.a.implementation = function() {
                console.log("hello!") 
                return this.a.call(this);
                
            };
        });
    },
}

@AeonLucid

Copy link
Copy Markdown
Contributor Author

@nyakokitsu And is this function of yours called by java or from the native layer (jni)?

@nyakokitsu

nyakokitsu commented Aug 18, 2025

Copy link
Copy Markdown

@nyakokitsu And is this function of yours called by java or from the native layer (jni)?

@AeonLucid by java

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.

7 participants