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

Debugger: java.lang.IndexOutOfBoundsException: Index: 10, Size: 9 #1981

Open
syxxjujing opened this issue Aug 3, 2023 · 2 comments
Open

Comments

@syxxjujing
Copy link

Please describe what you did before the error occurred.
IMPORTANT! If the error occurs with a specific APK file please attach or provide link to apk file!

  • Jadx version: 1.4.7
  • Java version: 1.8.0_144
  • Java VM: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM
  • Platform: Mac OS X (10.16 x86_64)
  • Max heap size: 32768 MB
  • Program args: -Xms128M -Xmx32g -XX:+UseG1GC -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Djava.util.Arrays.useLegacyMergeSort=true
java.lang.IndexOutOfBoundsException: Index: 10, Size: 9
	at java.util.ArrayList.rangeCheck(ArrayList.java:653)
	at java.util.ArrayList.get(ArrayList.java:429)
	at jadx.gui.device.debugger.RegisterObserver.merge(RegisterObserver.java:41)
	at jadx.gui.device.debugger.DebugController.lambda$null$15(DebugController.java:878)
	at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
	at jadx.gui.device.debugger.DebugController.lambda$updateAllInfo$16(DebugController.java:877)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

@jpstotz
Copy link
Collaborator

jpstotz commented Aug 3, 2023

There is an issue which is very similar (not identical) #1841. Not sure if both issues are really related. May be the changes implemented for v1.4.7 make the difference. If both problems have the same source, in the end the problem seems to be still present.

At a first glace this looks like a multi-threading/synchronization problem, but that is impossible as the affected ArrayList is created directly in the affected merge method.

Therefore it seems like the arguments supplied to merge: rtRegs and smaliRegs seem to contain compatible lists of registers. rtRegs seems to contain a reference to a register that does not exist in the smaliRegs list.

What would be possible is that the list of smali registers is not correct in the dex code or the dex code did not matched the executed APK on the phone?
@syxxjujing can you provide the APK file you was loaded in Jadx and that you were debugging?

@syxxjujing
Copy link
Author

apk.zip

@jpstotz jpstotz changed the title java.lang.IndexOutOfBoundsException: Index: 10, Size: 9 Debugger: java.lang.IndexOutOfBoundsException: Index: 10, Size: 9 Aug 3, 2023
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

No branches or pull requests

2 participants