Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LSposed implementation failure, causes zygisk next to crash #2

Closed
1 task done
antoni0C0des opened this issue Feb 12, 2025 · 78 comments
Closed
1 task done

LSposed implementation failure, causes zygisk next to crash #2

antoni0C0des opened this issue Feb 12, 2025 · 78 comments
Assignees
Labels
bug Something isn't working

Comments

@antoni0C0des
Copy link

Steps to reproduce/复现步骤

  1. Have kernelsu next and zygsk next installed, while using an A15 device (crdroid 11.2, feb build)
  2. Attempt to use LSposed.

Expected behaviour/预期行为

LSposed should not cause zygisk next to crash.

Actual behaviour/实际行为

It will make zygote injection to crash. Removing LSposed fixes the failure and zygisk next works

Xposed Module List/Xposed 模块列表

Discord themer
Force screenshots

Magisk Module List/Magisk 模块列表

PIF, Universal GMS doze, Zygisk next, zygisk detach, strp x zram

LSPosed version/LSPosed 版本

1.10.1

Android version/Android 版本

15

Magisk version/Magisk 版本

KSU next 1.0.4

Riru version/Riru 版本

N/A

Version requirement/版本要求

  • I am using latest debug CI version of LSPosed and enable verbose log/我正在使用最新 CI 调试版本且启用详细日志

Logs/日志

I do not know how can I get these issue logs. LSposed UI doesn't even load. I believe the latest android security updates broke many android mods. LSposed broke after an update, before it worked just fine.

@antoni0C0des antoni0C0des added the bug Something isn't working label Feb 12, 2025
@JingMatrix
Copy link
Owner

Please read JingMatrix/LSPosed#123 and try the instructions there.

@LeeBinder
Copy link

LeeBinder commented Feb 12, 2025

Same here after the Feb. build update - official crDroid 11.2 for the Nokia 6.1. Error in KSU Manager > Modules after tapping onto the entry for the Zygisk Next:

Stop inject zygote due to crash
Zygote32 Skipped (0)

Was still fine with crDroid 11.1. Not sure if this also affects current LineageOS users, but all points to the latest Android security update(s) breaking something in regards to LSPosed and Zygisk/zygote.

Not just affected is KSU Next but also regular KSU (which the Nokia 6.1 crDroid ROM we're running uses) and Magisk as per posts here on reddit.

@JingMatrix : also affected is your NeoZygisk which crashes, too, so it's not a ZygiskNext issue, either. Also its dev 5ec1cff clarifies here that this needs to be tackled on the LSPosed side.

Funny enough mywalkb's old mod v.1.9.3 from 2024-03-08 does not crash Zygisk Next, LOL (hint by someone on reddit), [EDIT] and also (as you found out below), in real it stops working, too: only it's UI loads and reads "activated", but modules are not working, either, so that path is in vain because only cosmetic.

Just wanted to add my findings right now already. Will install the latest LSPosed-v1.10.1-7169-zygisk-debug from Actions and can provide a logcat as per your exemplary detailed instructions in a little bit.

@LeeBinder
Copy link

NeoZygisk-v1-0.0-232-0780ff5-debug
LSPosed-v1.10.1-7169-zygisk-debug
LSPosed manager installed via adb shell su.. and launched as an app via launcher
lsposed.log via adb logcat -s ..

@JingMatrix
Copy link
Owner

The log you provided is a bit too late to analyze.
Please upload new log that is recorded using adb once the device/Andorid logo is shown on screen during the booting.

@LeeBinder
Copy link

@JingMatrix
Copy link
Owner

In the logs, LSPlant cannot find symbols for the class linker.
The crucial part of logs is

[ 2025-02-12T22:37:15.089        0:  2056:  2056 I/Dobby           ] ================================
[ 2025-02-12T22:37:15.089        0:  2056:  2056 I/Dobby           ] Dobby
[ 2025-02-12T22:37:15.089        0:  2056:  2056 I/Dobby           ] dobby in debug log mode, disable with cmake flag "-DDOBBY_DEBUG=OFF"
[ 2025-02-12T22:37:15.089        0:  2056:  2056 I/Dobby           ] ================================
[ 2025-02-12T22:37:15.090        0:  2056:  2056 V/zygisk-core64   ] dl.cpp:56#void *DlopenMem(int, int): dlopen fd 81: 0xe9c0a972d54a3e71
[ 2025-02-12T22:37:15.092        0:   997:   997 V/zygiskd64       ] zygiskd::zygiskd: New daemon action SystemServerStarted
[ 2025-02-12T22:37:15.093        0:   979:   979 D/zygisk-core64   ] monitor.cpp:248#virtual void SocketHandler::HandleEvent(EventLoop &, uint32_t): system server started, module.prop updated
[ 2025-02-12T22:37:15.171        0:  1570:  1570 I/LSPosedService  ] service package is not started, wait 1s.
[ 2025-02-12T22:37:15.275     1000:  2056:  2056 V/zygisk-core64   ] module.cpp:393#void ZygiskContext::nativeForkSystemServer_post(): post forkSystemServer
[ 2025-02-12T22:37:15.278     1000:  2056:  2056 D/LSPosed         ] service.cpp:312#ScopedLocalRef<jobject> lspd::Service::RequestSystemServerBinder(JNIEnv *): Got binder for system server
[ 2025-02-12T22:37:15.278        0:  1570:  1811 D/LSPosedService  ] LSPSystemServerService.onTransact: code=1598837584
[ 2025-02-12T22:37:15.278        0:  1570:  1811 D/LSPosedService  ] ILSPApplicationService.requestApplicationService: 1000 2056 system android.os.BinderProxy@ba54e53
[ 2025-02-12T22:37:15.280        0:  1570:  1811 D/LSPosedService  ] register ProcessInfo{uid=1000, pid=2056, processName='system', heartBeat=android.os.BinderProxy@ba54e53}
[ 2025-02-12T22:37:15.281        0:  1570:  1811 D/LSPosedService  ] LSPSystemServerService.onTransact requestApplicationService granted: org.lsposed.lspd.service.LSPApplicationService@a71d390
[ 2025-02-12T22:37:15.281     1000:  2056:  2056 D/LSPosed         ] service.cpp:345#ScopedLocalRef<jobject> lspd::Service::RequestApplicationBinderFromSystemServer(JNIEnv *, const ScopedLocalRef<jobject> &): app_binder: 0x7779f8b059
[ 2025-02-12T22:37:15.281        0:  1570:  1811 D/LSPosedService  ] LSPApplicationService.onTransact: code=1310096052
[ 2025-02-12T22:37:15.283     1000:  2056:  2056 D/LSPosed         ] service.cpp:359#std::tuple<int, size_t> lspd::Service::RequestLSPDex(JNIEnv *, const ScopedLocalRef<jobject> &): fd=84, size=1128960
[ 2025-02-12T22:37:15.283        0:  1570:  1811 D/LSPosedService  ] LSPApplicationService.onTransact: code=724533732
[ 2025-02-12T22:37:15.284     1000:  2056:  2056 D/LSPosed         ] service.cpp:389#std::map<std::string, std::string> lspd::Service::RequestObfuscationMap(JNIEnv *, const ScopedLocalRef<jobject> &): android.app.AndroidApp => nA.amSx.NxqqaSqTv.tcs.
[ 2025-02-12T22:37:15.284     1000:  2056:  2056 D/LSPosed         ] service.cpp:389#std::map<std::string, std::string> lspd::Service::RequestObfuscationMap(JNIEnv *, const ScopedLocalRef<jobject> &): android.content.res.XModule => UdJSjmVAuNkAg.xDTCk.G.dnpT.
[ 2025-02-12T22:37:15.284     1000:  2056:  2056 D/LSPosed         ] service.cpp:389#std::map<std::string, std::string> lspd::Service::RequestObfuscationMap(JNIEnv *, const ScopedLocalRef<jobject> &): android.content.res.XRes => VfPA.Ed.bsH.fGr.QirGTuj.
[ 2025-02-12T22:37:15.284     1000:  2056:  2056 D/LSPosed         ] service.cpp:389#std::map<std::string, std::string> lspd::Service::RequestObfuscationMap(JNIEnv *, const ScopedLocalRef<jobject> &): de.robv.android.xposed. => XxsfynYuSr.R.divJ.bUtl.
[ 2025-02-12T22:37:15.284     1000:  2056:  2056 D/LSPosed         ] service.cpp:389#std::map<std::string, std::string> lspd::Service::RequestObfuscationMap(JNIEnv *, const ScopedLocalRef<jobject> &): org.lsposed.lspd.core. => KRa.DNwFF.JTWv.Hh.cQa.
[ 2025-02-12T22:37:15.284     1000:  2056:  2056 D/LSPosed         ] service.cpp:389#std::map<std::string, std::string> lspd::Service::RequestObfuscationMap(JNIEnv *, const ScopedLocalRef<jobject> &): org.lsposed.lspd.nativebridge. => D.uuh.Zi.X.cWl.VSJPiyV.mgZjoA.
[ 2025-02-12T22:37:15.284     1000:  2056:  2056 D/LSPosed         ] service.cpp:389#std::map<std::string, std::string> lspd::Service::RequestObfuscationMap(JNIEnv *, const ScopedLocalRef<jobject> &): org.lsposed.lspd.service. => Yn.nwvTdzJCrjPxC.joUeamn.
[ 2025-02-12T22:37:15.284     1000:  2056:  2056 D/LSPosed         ] context.cpp:40#lspd::Context::PreloadedDex::PreloadedDex(int, std::size_t): Context::PreloadedDex::PreloadedDex: fd=84, size=1128960
[ 2025-02-12T22:37:15.315     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:389#bool SandHook::ElfImg::findModuleBase(): found: 74ab491000-74ab608000 r--p 00000000 fc:04 83                             /apex/com.android.art/lib64/libart.so
[ 2025-02-12T22:37:15.315     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:395#bool SandHook::ElfImg::findModuleBase(): update path: /apex/com.android.art/lib64/libart.so
[ 2025-02-12T22:37:15.315     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:415#bool SandHook::ElfImg::findModuleBase(): get module base /apex/com.android.art/lib64/libart.so: 0x74ab491000
[ 2025-02-12T22:37:15.316     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:88#void SandHook::ElfImg::parse(Elf64_Ehdr *): dynsym header 0x2f8 size 60096
[ 2025-02-12T22:37:15.316     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:109#void SandHook::ElfImg::parse(Elf64_Ehdr *): strtab header 0x13650 size 142333
[ 2025-02-12T22:37:15.344     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:100#void SandHook::ElfImg::parse(Elf64_Ehdr *): symtab header 0xc030e8 size 1341120 found in orgin elf
[ 2025-02-12T22:37:15.345     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:359#Elf64_Addr SandHook::ElfImg::getSymbOffset(std::string_view, uint32_t, uint32_t) const: found _ZN3art9JNIEnvExt16SetTableOverrideEPK18JNINativeInterface 0x7cf55c in /apex/com.android.art/lib64/libart.so in dynsym by gnuhash
[ 2025-02-12T22:37:15.349     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:389#bool SandHook::ElfImg::findModuleBase(): found: 7744885000-77448cc000 r--p 00000000 103:31 2316                          /system/lib64/libbinder.so
[ 2025-02-12T22:37:15.349     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:395#bool SandHook::ElfImg::findModuleBase(): update path: /system/lib64/libbinder.so
[ 2025-02-12T22:37:15.349     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:415#bool SandHook::ElfImg::findModuleBase(): get module base /system/lib64/libbinder.so: 0x7744885000
[ 2025-02-12T22:37:15.349     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:88#void SandHook::ElfImg::parse(Elf64_Ehdr *): dynsym header 0x2f8 size 33672
[ 2025-02-12T22:37:15.349     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:109#void SandHook::ElfImg::parse(Elf64_Ehdr *): strtab header 0xafe0 size 71365
[ 2025-02-12T22:37:15.349     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:121#void SandHook::ElfImg::parse(Elf64_Ehdr *): gnu_debugdata header 0xb544c size 28784
[ 2025-02-12T22:37:15.355     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:100#void SandHook::ElfImg::parse(Elf64_Ehdr *): symtab header 0x25d91 size 32400 found in gnu_debugdata
[ 2025-02-12T22:37:15.355     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:359#Elf64_Addr SandHook::ElfImg::getSymbOffset(std::string_view, uint32_t, uint32_t) const: found _ZN7android14IPCThreadState10selfOrNullEv 0x6f1b0 in /system/lib64/libbinder.so in dynsym by gnuhash
[ 2025-02-12T22:37:15.355     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:359#Elf64_Addr SandHook::ElfImg::getSymbOffset(std::string_view, uint32_t, uint32_t) const: found _ZNK7android14IPCThreadState13getCallingPidEv 0x549e0 in /system/lib64/libbinder.so in dynsym by gnuhash
[ 2025-02-12T22:37:15.355     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:359#Elf64_Addr SandHook::ElfImg::getSymbOffset(std::string_view, uint32_t, uint32_t) const: found _ZNK7android14IPCThreadState13getCallingUidEv 0x4e4a4 in /system/lib64/libbinder.so in dynsym by gnuhash
[ 2025-02-12T22:37:15.355     1000:  2056:  2056 I/LSPosed         ] libbinder selfOrNull 0x77448f41b0 getCallingPid 0x77448d99e0 getCallingUid 0x77448d34a4
[ 2025-02-12T22:37:15.355     1000:  2056:  2056 D/LSPosed         ] service.cpp:252#void lspd::Service::HookBridge(const Context &, JNIEnv *): Done InitService
[ 2025-02-12T22:37:15.356     1000:  2056:  2056 D/LSPlant         ] art_method.cxx:221: ArtMethod size: 32
[ 2025-02-12T22:37:15.356     1000:  2056:  2056 D/LSPlant         ] art_method.cxx:275: ArtMethod::declaring_class offset: 0
[ 2025-02-12T22:37:15.356     1000:  2056:  2056 D/LSPlant         ] art_method.cxx:276: ArtMethod::entrypoint offset: 24
[ 2025-02-12T22:37:15.356     1000:  2056:  2056 D/LSPlant         ] art_method.cxx:277: ArtMethod::data offset: 16
[ 2025-02-12T22:37:15.356     1000:  2056:  2056 D/LSPlant         ] art_method.cxx:278: ArtMethod::access_flags offset: 4
[ 2025-02-12T22:37:15.421     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:337#Elf64_Addr SandHook::ElfImg::PrefixLookupFirst(std::string_view) const: found prefix _ZN3artL15GetMethodShortyEP7_JNIEnvP10_jmethodID of _ZN3artL15GetMethodShortyEP7_JNIEnvP10_jmethodID.__uniq.224004613612541769487030999398936232930 0x83f50c in /apex/com.android.art/lib64/libart.so in symtab by linear lookup
[ 2025-02-12T22:37:15.421     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:359#Elf64_Addr SandHook::ElfImg::getSymbOffset(std::string_view, uint32_t, uint32_t) const: found _ZN3art9ArtMethod12PrettyMethodEPS0_b 0x2597a8 in /apex/com.android.art/lib64/libart.so in dynsym by gnuhash
[ 2025-02-12T22:37:15.422     1000:  2056:  2056 D/LSPosed         ] elf_util.cpp:359#Elf64_Addr SandHook::ElfImg::getSymbOffset(std::string_view, uint32_t, uint32_t) const: found _ZN3art6Thread14CurrentFromGdbEv 0x86be18 in /apex/com.android.art/lib64/libart.so in dynsym by gnuhash
[ 2025-02-12T22:37:15.422     1000:  2056:  2056 E/LSPlant         ] Failed to init class linker
[ 2025-02-12T22:37:15.422     1000:  2056:  2056 E/LSPosed         ] Failed to init lsplant
[ 2025-02-12T22:37:15.422     1000:  2056:  2056 F/libc            ] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 2056 (system_server), pid 2056 (system_server)
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] crDroid Version: '11.2'
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] Build fingerprint: 'Nokia/Plate2_00WW/PL2_sprout:10/QKQ1.190828.002/00WW_4_15O:user/release-keys'
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] Revision: '0'
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] ABI: 'arm64'
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] Timestamp: 2025-02-12 22:37:15.503244057+0100
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] Process uptime: 2s
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] Cmdline: zygote64
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] pid: 2056, tid: 2056, name: system_server  >>> zygote64 <<<
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] uid: 1000
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000000
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ] Cause: null pointer dereference
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ]     x0  0000000000000000  x1  0000000000000002  x2  00000074a07b79f8  x3  0000000000000000
[ 2025-02-12T22:37:15.765     1000:  2087:  2087 F/DEBUG           ]     x4  00000000fffffffd  x5  0000000000000009  x6  0000000000000037  x7  00000000428b8000
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]     x8  0000000000000000  x9  f907696352578b48  x10 0000000000000007  x11 0000000000000080
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]     x12 0000007779f8b000  x13 0000000000000080  x14 0000007779f8b200  x15 000000000000000f
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]     x16 0000000000000000  x17 0000000000000000  x18 000000777a744000  x19 0000007779f8b065
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]     x20 00000076b242aa30  x21 00000074a07b79f8  x22 0000000000000001  x23 00000074a07b7000
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]     x24 0000000000000000  x25 0000007779f8b05d  x26 0000007fca69ced0  x27 0000007779f8b065
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]     x28 0000007779f8b061  x29 00000076b242aa30
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]     lr  00000074a07431f8  sp  0000007fca69ce20  pc  00000074a074320c  pst 0000000060000000
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ] 20 total frames
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ] backtrace:
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]   NOTE: Function names and BuildId information is missing for some frames due
  NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
  NOTE: found under the lib/ directory are readable.
  NOTE: On this device, run setenforce 0 to make the libraries readable.
  NOTE: Unreadable libraries:
  NOTE:   /data/adb/neozygisk/lib64/libzygisk.so
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       #00 pc 000000000008c20c  /memfd:jit-cache-zygisk (deleted)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#1 pc 0000000000071420  /memfd:jit-cache-zygisk (deleted)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#2 pc 000000000005b864  /memfd:jit-cache-zygisk (deleted)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#3 pc 00000000000705e4  /memfd:jit-cache-zygisk (deleted)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#4 pc 0000000000061f38  /data/adb/neozygisk/lib64/libzygisk.so
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#5 pc 00000000000636fc  /data/adb/neozygisk/lib64/libzygisk.so
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#6 pc 00000000000639a8  /data/adb/neozygisk/lib64/libzygisk.so
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#7 pc 0000000000063b68  /data/adb/neozygisk/lib64/libzygisk.so
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#8 pc 0000000000058318  /data/adb/neozygisk/lib64/libzygisk.so
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#9 pc 000000000033dba4  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (art_jni_trampoline+164)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#10 pc 0000000000cf5608  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.ZygoteInit.forkSystemServer+2280)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#11 pc 0000000000cf6b14  /data/misc/apexdata/com.android.art/dalvik-cache/arm64/boot.oat (com.android.internal.os.ZygoteInit.main+3492)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#12 pc 000000000029e460  /apex/com.android.art/lib64/libart.so (art_quick_invoke_static_stub+640) (BuildId: c9429d162dccbb24599c2d81e6c038bf)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#13 pc 0000000000257a48  /apex/com.android.art/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+132) (BuildId: c9429d162dccbb24599c2d81e6c038bf)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#14 pc 0000000000257e28  /apex/com.android.art/lib64/libart.so (art::JValue art::InvokeWithVarArgs<_jmethodID*>(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, std::__va_list)+588) (BuildId: c9429d162dccbb24599c2d81e6c038bf)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#15 pc 0000000000681858  /apex/com.android.art/lib64/libart.so (art::JNI<true>::CallStaticVoidMethodV(_JNIEnv*, _jclass*, _jmethodID*, std::__va_list)+156) (BuildId: c9429d162dccbb24599c2d81e6c038bf)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#16 pc 00000000000d937c  /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticVoidMethod(_jclass*, _jmethodID*, ...)+104) (BuildId: 1b4085da388e6c8cf2b2ba1bf0a7dcea)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#17 pc 00000000000ef1ec  /system/lib64/libandroid_runtime.so (android::AndroidRuntime::start(char const*, android::Vector<android::String8> const&, bool)+768) (BuildId: 1b4085da388e6c8cf2b2ba1bf0a7dcea)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#18 pc 000000000000242c  /system/bin/app_process64 (main+888) (BuildId: 9775d543ad0316ef761482a68321ca2b)
[ 2025-02-12T22:37:15.766     1000:  2087:  2087 F/DEBUG           ]       JingMatrix/LSPosed#19 pc 0000000000054e98  /apex/com.android.runtime/lib64/bionic/libc.so (__libc_init+116) (BuildId: 74597bf719b16863bd29bcdb336ad689)

@JingMatrix
Copy link
Owner

Please upload your libart.so pulled by the following adb command

adb pull /apex/com.android.art/lib64/libart.so

@LeeBinder
Copy link

libart.so.tar.xz.zip

@LeeBinder
Copy link

LeeBinder commented Feb 13, 2025

Do you in general think this can be fixed on LSPosed level, or would the LineageOS (/crDoid) devs need to adapt some code?

@JingMatrix
Copy link
Owner

JingMatrix commented Feb 13, 2025

I will try to fix it in LSPlant when I get more free time.
But surely, this is due to some changes in the custom OS.

@LeeBinder
Copy link

Gotcha.

I could extract and upload the previous libart.so if you think that could be helpful for further debugging

Also not sure if these links could be of any help at all, but posting them won't hurt, either:

@JingMatrix
Copy link
Owner

JingMatrix commented Feb 13, 2025

The symbol for method FixupStaticTrampolines is no longer in your libart.so.
We need to find out the changes of custom OSs related to this method.

@JingMatrix
Copy link
Owner

The command

readelf -wk --string-dump=.gnu_debuglink ./libart.so

gives output


String dump of section '.gnu_debuglink':
  [     0]  libart.so
  [     c]  v���

Contents of the .gnu_debuglink section:

  Separate debug info file: libart.so
  CRC value: 0x9ff9c276

It indicates that the debug_info data, which is supposed to be separated when the section .gnu_debuglink exists, is indeed inserted into libart.so. See Debugging Information in Separate Files for reference.

I don't understand this messy choice of using separated debug_info files.
Hence, LSPosed cannot find the debug_info section, which causes the failure of LSPlant.

@LeeBinder
Copy link

All that are really valuable findings. Searching both, LOS and crDroid issues sections and social media corners for all the keywords didn't yield anything. Haven't gone into IRC and Telegram yet.

So how to go on from here? All three - AOSP, LOS and crDroid are open source from what I know, so shouldn't it be possible to search the code base for FixupStaticTrampolines and find the file which now hosts this method?

Would you like me to do something specific to facilitate finding more information?

@JingMatrix
Copy link
Owner

The AOSP code base concerning FixupStaticTrampolines is not likely to be changed / removed by custom OSs.
The crucial changes might be the custom OS's modifications of the compilation configuration of libart.so.

You can help to find out if in previous builds of libart.so, one can find symbols containing the keyword FixupStaticTrampolines.

@JingMatrix
Copy link
Owner

By the way, you said the fork LSPosed_mod worked well with your OS.
Please flash a debug version of it and upload the logs generated by the LSPosed manager, this can also help the current issue.

@LeeBinder
Copy link

@LeeBinder
Copy link

You can help to find out if in previous builds of libart.so, one can find symbols containing the keyword FixupStaticTrampolines.

you indicate the path to the file as /apex/com.android.art/lib64/libart.so

I've dumped crDroid 11.1 payload.bin but there is no apex (image). Which image would I need to unpack to get libart.so - system?

@aviraxp
Copy link

aviraxp commented Feb 14, 2025

I think it is aggressive lto flags make symbol inlined

@JingMatrix
Copy link
Owner

JingMatrix commented Feb 14, 2025

The LSPosed_mod fork won't work as expected, in its log you find

[ 2025-02-14T00:29:41.331     1000:  1987:  1987 E/LSPlant         ] Hook Fails: _ZN3art11ClassLinker22FixupStaticTrampolinesEPNS_6ThreadENS_6ObjPtrINS_6mirror5ClassEEE
[ 2025-02-14T00:29:41.331     1000:  1987:  1987 E/LSPlant         ] Failed to init class linker
[ 2025-02-14T00:29:41.331     1000:  1987:  1987 E/LSPosed         ] Failed to init lsplant

LSPosed_mod simply chose not to crash when LSPlant fails, while current project doesn't allow slient failures.

@LeeBinder
Copy link

I see. One module app I tested complained it wasn't working because LSPosed is too old so I thought that's why.

Anyway, in the meantime I managed to extract crDroid 11.1 libart.so from payload.bin > system.img > /system/apex/com.android.art.capex > ..[even more hoops].. - here you go 😎:

crDroid 11.1 libart.so.7z.zip

@JingMatrix
Copy link
Owner

In your libart.so for crDroid 11.1, the symbol _ZN3art11ClassLinker22FixupStaticTrampolinesEPNS_6ThreadENS_6ObjPtrINS_6mirror5ClassEEE is found.

Hence, the cause of current issue is that crDroid removed this symbol in its recent update.

@LeeBinder
Copy link

.. or rather the downstream LineageOS which crDroid is based upon.

So what to do? Can this symbol be extracted, included into LSPosed and loaded internally if not found? Or do you think this symbol still exists in/ was moved into another file in crDroid 11.2 and would need to be accessed by LSPosed from there?

@LeeBinder
Copy link

BTW, searches for that symbol bring up quite a number of results, even in regards to LSPlant: bing | Google | Yandex

@JingMatrix
Copy link
Owner

JingMatrix commented Feb 14, 2025

Fortunately, the symbol for method MarkClassInitialized is still there, exported as symbol _ZN3art11ClassLinker20MarkClassInitializedEPNS_6ThreadENS_6HandleINS_6mirror5ClassEEE.
We can hook this method in LSPlant to deal with trampolines.
For references on trampolines of art method hooking, read the source codes of ClassLinker::MarkClassInitialized, Instrumentation::InitializeMethodsCode.

This issue will be thus transfered to JingMatrix/LSPlant.

@JingMatrix JingMatrix transferred this issue from JingMatrix/LSPosed Feb 14, 2025
@LeeBinder
Copy link

LeeBinder commented Feb 14, 2025

Wow, mighty cool, thank you. Resuscitated trampolines make me wanna jump for joy 🤘

I was just writing: when I searched the crDroid 11.1 lib64 folder for that symbol string and chose "file content" as search option, the search did find libart.so. So I could also search the crDroid 11.2 installation for that string to see if it indeed was moved to another file. But from what I conclude your findings, it's not necessary, right?

@JingMatrix JingMatrix self-assigned this Feb 14, 2025
@LeeBinder
Copy link

for completion the entire archive in case needed: LSPosed_2025-02-15T00_34_53.tar.xz.zip (1.8 MB)

@JingMatrix
Copy link
Owner

Thanks for providing the logs, please test the new build again and upload logs.

Only the (first) verbose log file is needed.
You maybe able to get this log easily as follows:

adb shell su -c 'cat "/data/adb/lspd/log/verbose_*" > /data/local/tmp/lsposed_verbose.log && chown shell:shell /data/local/tmp/lsposed_verbose.log' && adb pull /data/local/tmp/lsposed_verbose.log

@LeeBinder
Copy link

LSPosed-v1.10.1-7169-zygisk-debug form https://github.com/JingMatrix/LSPosed/actions/runs/13339510844 NOT working

Let me get the (first) log, hang on..

@LeeBinder
Copy link

lsposed_verbose.log.zip

@royweisfeld
Copy link

@JingMatrix I can confirm that it works again.

Many thanks for your effort!

I also confirm it seems to be working , I'm on Matrixx 11.2 (Based on CrDroid 11.2) using KSU-next

@Jenna-87
Copy link

@JingMatrix In the working version you returned callback, in the not working one you changed this behaviour.
In most cases callback was 0x0, but in some cases (159 of 10409) it returned a non-null-value.
Can this be the culprit why the latest version crashes again?
I mean the removed return?

I could place debug statements into class_linker.cc (of art.sources) if it helps.

@JingMatrix
Copy link
Owner

@Jenna-87 Could you paste the logs around the line that has non-zero returned value? I didn't know which file you are referring to.

@Jenna-87
Copy link

[ 2025-02-15T00:28:29.957     1000:  1732:  1732 D/LSPlant         ] class_linker.cxx:169: called orginal method
[ 2025-02-15T00:28:29.957     1000:  1732:  1732 D/LSPlant         ] class_linker.cxx:170: ... with returned value: 0xb4000071137ce010 
[ 2025-02-15T00:28:29.957     1000:  1732:  1732 D/LSPlant         ] class_linker.cxx:167: MarkClassInitialized_ called with: [0xb4000070737857b0, 

@Jenna-87
Copy link

@JingMatrix it crashes with a SIGSEV immediately after calling MarkClassInitialized_.
Could this be because the return value is uninitialized, due to not returning the callback (null or not).

Because, if it is not null it will be used in libart (from class_linker.cc):

  if (callback != nullptr) {
    callback->MakeVisible(self);
  }

@JingMatrix
Copy link
Owner

The hook of MarkVisiblyInitialized is removed in LSPosed#6.
I don't know how this decision is made, but now I am adding it back.

The reason for new crashs seems to a wrong parsing of the Handle class.

Please try the CI build and upload your logs.

@Jenna-87
Copy link

Here ist the log-file:
lsposed_verbose.log

@JingMatrix
Copy link
Owner

I give up parsing the class Handle.

Let us simply restore for the whole thread.

Please test the latest CI and upload logs again.

@LeeBinder
Copy link

Folks, urgently gotta catch some sleep - can join debugging some time tomorrow if necessary 🤘

@Jenna-87
Copy link

Here is the latest log.
lsposed_verbose.log

I will also go to bed now, but try to look into it again tomorrow.

@LeeBinder
Copy link

LeeBinder commented Feb 15, 2025

Is there enough data at this point already to summarize why on earth the crDroid dev team chose to go this unusual route which caused a lot of turmoil, and how much sense all this makes (for "increased crDroid 11.1 ROM security" or whatever)??

@CanerKaraca23 can you please find out from @aviraxp on "LSPosed IT" (no search results at all - is that a Telegram channel)?

JingMatrix added a commit that referenced this issue Feb 15, 2025
In issue #2, it is reported that when the symbol of method `FixupStaticTrampolines` is not found, the LSPlant failure will crash Zygisk.
We fix the logic of this workaround.
Note for the method `MarkClassInitialized`:
1. Its source code is at https://cs.android.com/android/platform/superproject/main/+/main:art/runtime/class_linker.cc;drc=31c794ed606da73e856a2c577ac270abd9c8b631;bpv=0;bpt=1;l=433 .
2. From the mangling name, MarkClassInitialized has no returned value, but in the AOSP code base, this method does return a pointer to ClassLinker::VisiblyInitializedCallback. In reality, this method does return a pointer.
3. In some repos, such as https://github.com/canyie/pine/blob/master/enhances/src/main/cpp/enhances.cpp and https://github.com/ElderDrivers/EdXposed/blob/master/edxp-core/src/main/cpp/main/include/art/runtime/class_linker.h, the handle to mirror::Class is treated simply as a pointer.
4. However, I haven't succeeded in parsing the Handle class.
5. From the logs for the tests with MarkClassInitialized hooked, we haven't found any entries added with effective calls of `RestoreBackup`, where we pass nullptr to its first parameter. Hence, it is (temporarily) unnecessary to hook MarkClassInitialized
JingMatrix added a commit to JingMatrix/LSPosed that referenced this issue Feb 15, 2025
1. Close #159 as fixed, though it points to the removal of warning `Unsupported class loader`, for which we can do later.
2. Take the commit from JingMatrix/LSPlant to fix the bug JingMatrix/LSPlant#2.
JingMatrix added a commit to JingMatrix/LSPosed that referenced this issue Feb 15, 2025
1. Close #159 as fixed, though it points to the removal of warning `Unsupported class loader`, for which we can do later.
2. Take the commit from JingMatrix/LSPlant to fix the bug JingMatrix/LSPlant#2.
@JingMatrix
Copy link
Owner

Commit merged into the master branch of JingMatrix/LSPosed.
See commit messages for more details.

P.S.: crDroid dev team might have made the choice of inline optimization out of perfermance consideration.

@LeeBinder
Copy link

Grüß dich @Jenna-87 out of pure curiosity: which phone (make & model) do you have crDroid 11.2 installed on?

@Jenna-87
Copy link

Grüß dich @Jenna-87 out of pure curiosity: which phone (make & model) do you have crDroid 11.2 installed on?

Samsung A52 4G, self-build, with KernelSU

@LeeBinder
Copy link

cool 👍

@antoni0C0des
Copy link
Author

When's the fix going to be reflected into lsposed?

@LeeBinder
Copy link

You mean https://github.com/JingMatrix/LSPosed/releases - latest official release Oct 16, 2024?

@JingMatrix can you share your goal post(s) which you want to be satisfied/ fulfilled before issuing a new release?

@JingMatrix
Copy link
Owner

I will put a new release if one of the following events happens:

  1. Android 16 is released.
  2. Add documentation for contributors in the future LSPosed#124 is done.
  3. I release a stable version of NeoZygisk.

This is purely a personal decision, and except the first event, it depends heavily on my progress.
Since I am preparing my PhD defense, I am afraid that finally the first event to going to happen first.

@Jenna-87
Copy link

Jenna-87 commented Feb 17, 2025

When's the fix going to be reflected into lsposed?

You can use one of the automatic-builds from https://github.com/JingMatrix/LSPosed/actions
But be aware, that they might be work-in-progress, so you do it on your own risk.
I do it on my device and it works.

@LeeBinder
Copy link

@JingMatrix good luck with and 👍 for your viva voce! Can you share what you are doing your doctorate's degree in - IT-related, I assume?

Contributing documentation: I've been editing/ updating Troubleshooting.md - will upload once I'm done.

@JingMatrix
Copy link
Owner

@LeeBinder You are welcome to contributing to the docs, and I am glad to hear that since the perspective from a normal user instead of involved developers might be easier to follow.
Please notice that, when you make your pull-request, choose your target branch to docs.

My research career has nothing to do with IT. You can find my research CV here. I am doing researches in the intersections of probability and geometry, precisely a domain called optimal transport, see my first preprint for a basic introduction of my focus.

@LeeBinder
Copy link

LeeBinder commented Feb 19, 2025

<OT>Impressive, Jianyu, both your CV and your preprint. I do hope your Thesis defense didn't get delayed an extra year due to maintaining LSPosed.

Needless to say I only understand the basic frame. However in that context I've been wondering about the probability of the Earth-Moon barycenter with the moon being locked around Earth the way it is, additionally at a distance exactly covering the sun during lunar eclipses, could've come about naturally by known cosmic forces. Maybe you and Prof. Vaseršteĭn have thoughts of your own on that peculiarity, too 😉.

Thumbs 👍 you can convince everyone on the panel when the time comes!</OT>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants