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

I found a crash issue! #75

Open
YYYSSSHHH opened this issue Aug 17, 2020 · 1 comment
Open

I found a crash issue! #75

YYYSSSHHH opened this issue Aug 17, 2020 · 1 comment

Comments

@YYYSSSHHH
Copy link

Environment Info:
APK:Version 2.0.8 (32)
AndroidOS Version = 6.0.1

Description information:
We find that mobile apps are prone to crashes due to a network issue, mainly because successful network API calls return unexpected or no data.
And we found that when this app's network returned data is null or some fields are null (JSON format), the app has crashed.

crash information:
Crash One:
crashActivity=fr.masciulli.drinks.ui.activity.MainActivity
:
java.lang.IllegalArgumentException: Path must not be empty.
at com.squareup.picasso.Picasso.load(Picasso.java:297)
at fr.masciulli.drinks.ui.adapter.LiquorsAdapter.onBindViewHolder(LiquorsAdapter.java:60)
at fr.masciulli.drinks.ui.adapter.LiquorsAdapter.onBindViewHolder(LiquorsAdapter.java:20)
at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6067)
at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6100)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5282)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5158)
at android.support.v7.widget.LayoutState.next(LayoutState.java:100)
at android.support.v7.widget.StaggeredGridLayoutManager.fill(StaggeredGridLayoutManager.java:1568)
at android.support.v7.widget.StaggeredGridLayoutManager.onLayoutChildren(StaggeredGridLayoutManager.java:678)
at android.support.v7.widget.StaggeredGridLayoutManager.onLayoutChildren(StaggeredGridLayoutManager.java:600)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3379)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3188)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3632)
at android.view.View.layout(View.java:16636)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16636)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1799)
at android.view.View.layout(View.java:16636)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1367)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:849)
at android.view.View.layout(View.java:16636)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16636)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
at android.view.View.layout(View.java:16636)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16636)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
at android.view.View.layout(View.java:16636)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
at android.view.View.layout(View.java:16636)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2165)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1925)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6007)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
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:5539)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)

Crash Two:

crashActivity=fr.masciulli.drinks.ui.activity.MainActivity

:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.toLowerCase(java.util.Locale)' on a null object reference
at fr.masciulli.drinks.ui.adapter.DrinksAdapter.filter(DrinksAdapter.java:113)
at fr.masciulli.drinks.ui.fragment.DrinksFragment.onQueryTextChange(DrinksFragment.java:144)
at android.support.v7.widget.SearchView.onTextChanged(SearchView.java:1237)
at android.support.v7.widget.SearchView$12.onTextChanged(SearchView.java:1767)
at android.widget.TextView.sendOnTextChanged(TextView.java:7988)
at android.widget.TextView.setText(TextView.java:4350)
at android.widget.TextView.setText(TextView.java:4204)
at android.widget.EditText.setText(EditText.java:84)
at android.widget.TextView.setText(TextView.java:4179)
at android.widget.EditText.performAccessibilityActionInternal(EditText.java:136)
at android.view.View.performAccessibilityAction(View.java:8889)
at android.view.AccessibilityInteractionController.performAccessibilityActionUiThread(AccessibilityInteractionController.java:668)
at android.view.AccessibilityInteractionController.-wrap6(AccessibilityInteractionController.java)
at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1194)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5539)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)

Finally:
The cause of the program crash may be that the network response data is not handled properly in the code, such as null or empty.
If you have confirmed or fixed this problem, please give me a reply, thank you!

@YYYSSSHHH
Copy link
Author

How do we test the APP?
We use the fuzzing method to simulate the network response data. For example, when the app receives network API response data from server or network, we will replace it with 404, null and random data.
#A very simple example:
normal data :Value=”hello” -----fuzzing-----> simulated data :Value=null or network request fails(404、503) or Value=”heee”(random data) or Value=""(empty) , etc.

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

1 participant