java.lang.IndexOutOfBoundsException: setSpan (-26377 ... -26377) starts before 0

JIRA | bdedardel | 1 year ago
  1. 0

    cutting text at the end of textarea with big content crashed ============================================== Code to reproduce the bug + Logcat are on github: - https://github.com/bdedardel/cordova-test Description ----------- When I cut some text at the end of a textarea with big content, using android native copy/cut/paste, application crashes. - If I build android app with cordova, it seems ok. - If I build android app with crosswalk plugin, application crashes (IndexOutOfBoundsException). ### Steps - run ./bin/build.sh - install and open cordova-test-nok.apk on the android mobile phone - goto line 1951/2000 and cut it, everything is ok - close app and reopen it - goto line 1952/2000 and cut it, application crashes ### Environment - cordova 5.1.1 Tested on: - Wiko Darkmoon, android 4.2.2 - LG G2, android 5.0.2 Debug ------ ### Stack trace Trace (from Logcat, see: https://github.com/bdedardel/cordova-test/blob/master/bugs/BUG001.md) ``` W/System.err(18785): java.lang.IndexOutOfBoundsException: setSpan (-26377 ... -26377) starts before 0 W/System.err(18785): at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1021) W/System.err(18785): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:592) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:484) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:435) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:30) W/System.err(18785): at org.chromium.content.browser.input.AdapterInputConnection.updateState(AdapterInputConnection.java:184) W/System.err(18785): at org.chromium.content.browser.ContentViewCore.updateImeAdapter(ContentViewCore.java:2322) W/System.err(18785): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) W/System.err(18785): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53) W/System.err(18785): at android.os.Handler.dispatchMessage(Handler.java:107) W/System.err(18785): at android.os.Looper.loop(Looper.java:194) W/System.err(18785): at android.app.ActivityThread.main(ActivityThread.java:5391) W/System.err(18785): at java.lang.reflect.Method.invokeNative(Native Method) W/System.err(18785): at java.lang.reflect.Method.invoke(Method.java:525) W/System.err(18785): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) W/System.err(18785): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) W/System.err(18785): at dalvik.system.NativeStart.main(Native Method) F/chromium(18785): [FATAL:jni_android.cc(295)] Check failed: false. Please include Java exception stack in crash report F/libc (18785): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 18785 (del.CordovaTest) F/libc (18785): Send stop signal to pid:18785 in debugger_signal_handler ```

    JIRA | 1 year ago | bdedardel
    java.lang.IndexOutOfBoundsException: setSpan (-26377 ... -26377) starts before 0
  2. 0

    cutting text at the end of textarea with big content crashed ============================================== Code to reproduce the bug + Logcat are on github: - https://github.com/bdedardel/cordova-test Description ----------- When I cut some text at the end of a textarea with big content, using android native copy/cut/paste, application crashes. - If I build android app with cordova, it seems ok. - If I build android app with crosswalk plugin, application crashes (IndexOutOfBoundsException). ### Steps - run ./bin/build.sh - install and open cordova-test-nok.apk on the android mobile phone - goto line 1951/2000 and cut it, everything is ok - close app and reopen it - goto line 1952/2000 and cut it, application crashes ### Environment - cordova 5.1.1 Tested on: - Wiko Darkmoon, android 4.2.2 - LG G2, android 5.0.2 Debug ------ ### Stack trace Trace (from Logcat, see: https://github.com/bdedardel/cordova-test/blob/master/bugs/BUG001.md) ``` W/System.err(18785): java.lang.IndexOutOfBoundsException: setSpan (-26377 ... -26377) starts before 0 W/System.err(18785): at android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1021) W/System.err(18785): at android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:592) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:484) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:435) W/System.err(18785): at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:30) W/System.err(18785): at org.chromium.content.browser.input.AdapterInputConnection.updateState(AdapterInputConnection.java:184) W/System.err(18785): at org.chromium.content.browser.ContentViewCore.updateImeAdapter(ContentViewCore.java:2322) W/System.err(18785): at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) W/System.err(18785): at org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53) W/System.err(18785): at android.os.Handler.dispatchMessage(Handler.java:107) W/System.err(18785): at android.os.Looper.loop(Looper.java:194) W/System.err(18785): at android.app.ActivityThread.main(ActivityThread.java:5391) W/System.err(18785): at java.lang.reflect.Method.invokeNative(Native Method) W/System.err(18785): at java.lang.reflect.Method.invoke(Method.java:525) W/System.err(18785): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833) W/System.err(18785): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600) W/System.err(18785): at dalvik.system.NativeStart.main(Native Method) F/chromium(18785): [FATAL:jni_android.cc(295)] Check failed: false. Please include Java exception stack in crash report F/libc (18785): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 18785 (del.CordovaTest) F/libc (18785): Send stop signal to pid:18785 in debugger_signal_handler ```

    JIRA | 1 year ago | bdedardel
    java.lang.IndexOutOfBoundsException: setSpan (-26377 ... -26377) starts before 0
  3. 0

    IndexOutOfBoundsException

    GitHub | 1 year ago | msya
    java.lang.IndexOutOfBoundsException: replace (28 ... 36) ends beyond length 32
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    IndexOutOfBoundsException

    GitHub | 10 months ago | olegosipenko
    java.lang.IndexOutOfBoundsException: replace (15 ... 16) ends beyond length 15
  6. 0

    [BUG] IndexOutOfBoundsException in replace

    GitHub | 5 months ago | jgabrielfreitas
    java.lang.IndexOutOfBoundsException: replace (13 ... 14) ends beyond length 13

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IndexOutOfBoundsException

      setSpan (-26377 ... -26377) starts before 0

      at android.text.SpannableStringBuilder.checkRange()
    2. Android Platform
      SpannableStringBuilder.replace
      1. android.text.SpannableStringBuilder.checkRange(SpannableStringBuilder.java:1021)
      2. android.text.SpannableStringBuilder.setSpan(SpannableStringBuilder.java:592)
      3. android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:484)
      4. android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:435)
      5. android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:30)
      5 frames
    3. org.chromium.content
      ContentViewCore.updateImeAdapter
      1. org.chromium.content.browser.input.AdapterInputConnection.updateState(AdapterInputConnection.java:184)
      2. org.chromium.content.browser.ContentViewCore.updateImeAdapter(ContentViewCore.java:2322)
      2 frames
    4. org.chromium.base
      SystemMessageHandler.handleMessage
      1. org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
      2. org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:53)
      2 frames
    5. Android Platform
      ActivityThread.main
      1. android.os.Handler.dispatchMessage(Handler.java:107)
      2. android.os.Looper.loop(Looper.java:194)
      3. android.app.ActivityThread.main(ActivityThread.java:5391)
      3 frames
    6. Java RT
      Method.invoke
      1. java.lang.reflect.Method.invokeNative(Native Method)
      2. java.lang.reflect.Method.invoke(Method.java:525)
      2 frames
    7. Android
      ZygoteInit.main
      1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
      2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
      2 frames
    8. Android Platform
      NativeStart.main
      1. dalvik.system.NativeStart.main(Native Method)
      1 frame