blitz-foundation / monkey2

zlib License
3 stars 0 forks source link

Android ToUpper() ToLower() overflow #71

Closed Pharmhaus-2 closed 5 years ago

Pharmhaus-2 commented 5 years ago

Original Author: Difference

my android app crashes at mystring.ToUpper() and mystring.ToLower()

Tried removing the offending code, then it just happens another place, app runs fine until it meets ToLower() or ToUpper()


A/art: art/runtime/indirect_reference_table.cc:116] JNI ERROR (app bug): local reference table overflow (max=512)
       art/runtime/indirect_reference_table.cc:116] local reference table dump:
       art/runtime/indirect_reference_table.cc:116]   Last 10 entries (of 512):
       art/runtime/indirect_reference_table.cc:116]       511: 0x2ac5f7c0 java.lang.String "f"
       art/runtime/indirect_reference_table.cc:116]       510: 0x2ac5f7a8 java.lang.String "F"
       art/runtime/indirect_reference_table.cc:116]       509: 0x2ac5f790 java.lang.String "f"````

last readable mx2 call is 
      ``` art/runtime/runtime.cc:441]   native: #09 pc 00c4cb05  /data/app/com.monkey2.monkey2game-2/lib/arm/libmx2_main.so (_ZN7_JNIEnv12NewStringUTFEPKc+38)
       art/runtime/runtime.cc:441]   native: #10 pc 00cb502d  /data/app/com.monkey2.monkey2game-2/lib/arm/libmx2_main.so (???)
       art/runtime/runtime.cc:441]   native: #11 pc 00cb5087  /data/app/com.monkey2.monkey2game-2/lib/arm/libmx2_main.so (_ZNK8bbString7toLowerEv+78)````

or 
```art/runtime/runtime.cc:441]   native: #10 pc 00cb503b  /data/app/com.monkey2.monkey2game-1/lib/arm/libmx2_main.so (_ZN7_JNIEnv22CallStaticObjectMethodEP7_jclassP10_jmethodIDz+66)
       art/runtime/runtime.cc:441]   native: #11 pc 00cb4e7f  /data/app/com.monkey2.monkey2game-1/lib/arm/libmx2_main.so (_ZNK8bbString7toUpperEv+94)```
Pharmhaus-2 commented 5 years ago

@Difference Do you have some example code to reproduce the issue?

Difference commented 5 years ago

As I recall, this was fixed , but I do remember how or what the cause turned out to be. Please close.