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

android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0 #284

Closed
tianxiaogu opened this Issue Oct 30, 2017 · 10 comments

Comments

2 participants
@tianxiaogu

tianxiaogu commented Oct 30, 2017

Version: 3.4.2-foss (49) from F-Droid

This bug has been reported in #244 but not been fixed yet.

Here I can provide several reproduce steps.

  1. Open my website hosted in github.io
    https://testsataapp.github.io/sata-com.gelakinetic.mtgfam-ape-sata-running-time-15/vis-timeline.html

  2. Click button start to adjust the view.

  3. Input 196 and click select. You can see a highlighted event in the timeline. Click the highlighted event.

    • You can see a screenshot after clicking the event.
    • The reproduce steps start at step 196
    • The crash happens at step 203 (13:29:23)
  4. Click next events int the timeline

  5. Use Move right or drag the timeline for navigation.

Hope it is helpful.

// CRASH: com.gelakinetic.mtgfam (pid 2958) (elapsed nanos: 69786762416873)
// Short Msg: android.database.CursorIndexOutOfBoundsException
// Long Msg: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
// Build Label: google/hammerhead/hammerhead:6.0.1/M4B30Z/3437181:user/release-keys
// Build Changelist: 3437181
// Build Time: 1478203422000
// android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
// 	at android.database.AbstractCursor.checkPosition(AbstractCursor.java:460)
// 	at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
// 	at android.database.AbstractWindowedCursor.getString(AbstractWindowedCursor.java:50)
// 	at com.gelakinetic.mtgfam.helpers.CardHelpers.makeMtgCard(CardHelpers.java:736)
// 	at com.gelakinetic.mtgfam.fragments.TradeFragment.addCardToTrade(TradeFragment.java:232)
// 	at com.gelakinetic.mtgfam.fragments.TradeFragment.access$000(TradeFragment.java:53)
// 	at com.gelakinetic.mtgfam.fragments.TradeFragment$2.onClick(TradeFragment.java:163)
// 	at android.view.View.performClick(View.java:5204)
// 	at android.view.View$PerformClick.run(View.java:21153)
// 	at android.os.Handler.handleCallback(Handler.java:739)
// 	at android.os.Handler.dispatchMessage(Handler.java:95)
// 	at android.os.Looper.loop(Looper.java:148)
// 	at android.app.ActivityThread.main(ActivityThread.java:5417)
// 	at java.lang.reflect.Method.invoke(Native Method)
// 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
// 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
// 
@AEFeinstein

This comment has been minimized.

Owner

AEFeinstein commented Oct 31, 2017

This is incredibly helpful. The issue is replicated when one enters an invaild card name on either the wish or trade pages, checks off foil, and tries to add it to the deck. I'll investigate why.
Unfortunately, this exists in the just-released 3.4.3. Maybe I'll have a small 3.4.4.

@AEFeinstein AEFeinstein self-assigned this Oct 31, 2017

@AEFeinstein AEFeinstein added the bug label Oct 31, 2017

@AEFeinstein

This comment has been minimized.

Owner

AEFeinstein commented Oct 31, 2017

Also, how much random testing are you doing and what exactly is your website?

@tianxiaogu

This comment has been minimized.

tianxiaogu commented Oct 31, 2017

Thank you for your response!

I have built a tool based on monkey and uiautomator.
You can check it out at http://gutianxiao.com/sata/

Actually, I am not an application developer.
I am working on a research paper now, so I cannot share the source code of the tool with you at this moment.

There is an out-of-date version of my tool available. You can have a try.
http://gutianxiao.com/sata/ape-bin.zip

@AEFeinstein

This comment has been minimized.

Owner

AEFeinstein commented Oct 31, 2017

Nice. Good luck with your tool & paper. Do you use MTG Familiar normally, or is this just a lucky random app you were testing your tool with?

@tianxiaogu

This comment has been minimized.

tianxiaogu commented Oct 31, 2017

No, I just pick it from FDroid for evaluation. :)

@AEFeinstein

This comment has been minimized.

Owner

AEFeinstein commented Oct 31, 2017

Haha, well if you want to do more testing with MTG Familiar, I wouldn't complain!

@AEFeinstein

This comment has been minimized.

Owner

AEFeinstein commented Oct 31, 2017

Just a note, this is the same exception but a very different call stack than #244, so they are separate issues.

@AEFeinstein

This comment has been minimized.

Owner

AEFeinstein commented Nov 2, 2017

@tianxiaogu, when I run APE, every once in a while it prints this and restarts the activity. Is that normal behavior?

[APE] ERROR: null root node returned by UiTestAutomationBridge, generate throttle action...
[APE] Power Manager says we are interactive
[APE] ERROR: null root node returned by UiTestAutomationBridge, generate throttle action...
[APE] Power Manager says we are interactive
[APE] ERROR: null root node returned by UiTestAutomationBridge, generate throttle action...
[APE] Power Manager says we are interactive
[APE] ERROR: null root node returned by UiTestAutomationBridge, generate throttle action...
[APE] Power Manager says we are interactive
[APE] ERROR: null root node returned by UiTestAutomationBridge, generate throttle action...
[APE] Power Manager says we are interactive
[APE] ERROR: null root node returned by UiTestAutomationBridge, generate throttle action...
[APE] Power Manager says we are interactive
[APE] ERROR: null root node returned by UiTestAutomationBridge, generate throttle action...
[APE] Power Manager says we are interactive
[APE] ERROR: null root node returned by UiTestAutomationBridge, generate throttle action...
[APE] Power Manager says we are interactive
[APE] ERROR: null root node returned by UiTestAutomationBridge, generate throttle action...
[APE] Power Manager says we are interactive
[APE] ERROR: null root node returned by UiTestAutomationBridge, generate throttle action...
[APE] Power Manager says we are interactive
[APE] ERROR: null root node returned by UiTestAutomationBridge, generate throttle action...
[APE] Try to stop process com.gelakinetic.mtgfam.debug(31981)
[APE] Try to stop package com.gelakinetic.mtgfam.debug
[APE] Power Manager says we are interactive
[APE] Power Manager says we are interactive
[APE] *** WARNNING: the top activity package com.android.launcher3 is not allowed.
[APE] Generate activity event for activity ComponentInfo{com.gelakinetic.mtgfam.debug/com.gelakinetic.mtgfam.FamiliarActivity} from 0 of 1
@tianxiaogu

This comment has been minimized.

tianxiaogu commented Nov 2, 2017

@AEFeinstein This situation is normal. Sometimes APE may fail to fetch the GUI layout. It retries to get the layout for 10 times and then restarts the app in case of ANR. I am not sure whether it is proper to restart app here.

@AEFeinstein

This comment has been minimized.

Owner

AEFeinstein commented Nov 2, 2017

If it helps, my application still responding during those APE errors. I've found that if I manually interact with the app when those errors are occurring, APE will get a good root node and continue testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment