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

Input dispatching timed out ANRs & ANR rate survey #29

Open
neuronix opened this issue Nov 30, 2017 · 726 comments
Open

Input dispatching timed out ANRs & ANR rate survey #29

neuronix opened this issue Nov 30, 2017 · 726 comments

Comments

@neuronix
Copy link

neuronix commented Nov 30, 2017

Hi guys,

I am mirorring my post from the Starling forum here with Daniel's permission.

We have ANRs on Android in all our apps and would like to know if it's maybe our apps particularly, or if it's AIR related.

Could you please check your Google Dev Console and go to "Android Vitals" > "Overview".

The first section is "Bad Behaviors".

Please share the following values (no need to mention the app, just pick the biggest app you have or the average of all your apps please):

  • ANR Rate (around 2.6% on our apps)
  • Crash Rate (1.1-1.8% on our apps)

The main ANR we are experiencing is "Input dispatching timed out" triggered by "com.adobe.air.customHandler.callTimeoutFunction". There are heaps of topics on it on the web, and they only proper response by Adobe is that we should avoid doing heavy calculations on user input.

But all our apps use Starling, and Starling defers all user inputs to next frame so this should not be an issue.

@skolesnyk
Copy link

App with Air 27, Starling 1.8, Feathers 2.x
ANR: 0.20%
Crash rate: 0.23%

@Seb-AS
Copy link

Seb-AS commented Nov 30, 2017

Hi,

Our App(Starling 1.8-AIR 26/21):

ANR Rate : 4%
Crash Rate: 5%

39 reports last 7 days:

Broadcast of Intent { act=android.intent.action.SCREEN_OFF flg=0x50000010 (has extras) }

"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 obj=0x74de5000 self=0xb7d81f78
| sysTid=21001 nice=-6 cgrp=bg_non_interactive sched=0/0 handle=0xb6f01bec
| state=S schedstat=( 883042412234 69541281861 500913 ) utm=83394 stm=4910 core=1 HZ=100
| stack=0xbe568000-0xbe56a000 stackSize=8MB
| held mutexes=
#00 pc 000000000000f9b0 /system/lib/libc.so (syscall+28)
#1 pc 00000000000138ab /system/lib/libc.so (pthread_join+90)
#2 pc 00000000001fa2a5 /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#3 pc 00000000001fa34b /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#4 pc 00000000001c98d5 /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#5 pc 00000000001c3901 /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#6 pc 00000000003477df /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#7 pc 00000000003cee7b /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#8 pc 00000000003d10ed /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#9 pc 000000000012ebeb /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#10 pc 0000000000130b27 /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#11 pc 00000000001349b1 /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#12 pc 00000000001215e3 /data/app/air.com.app1-1/lib/arm/libCore.so (Java_com_adobe_air_customHandler_callTimeoutFunction+10)
#13 pc 00000000001bbc1f /data/dalvik-cache/arm/data@app@air.com.app1-1@base.apk@classes.dex (Java_com_adobe_air_customHandler_callTimeoutFunction__II+90)
at com.adobe.air.customHandler.callTimeoutFunction (Native method)
at com.adobe.air.customHandler.handleMessage (customHandler.java:22)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:135)
at android.app.ActivityThread.main (ActivityThread.java:5912)
at java.lang.reflect.Method.invoke! (Native method)
at java.lang.reflect.Method.invoke (Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1200)

10 reports last 7 days:

Input dispatching timed out (Waiting because the touched window has not finished processing the input events that were previously delivered to it.)

"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x415a4ca8 self=0x414de570
| sysTid=22564 nice=-6 sched=0/0 cgrp=apps handle=1074331988
| state=S schedstat=( 0 0 0 ) utm=4477 stm=515 core=2
#00 pc 0000000000021910 /system/lib/libc.so (__futex_syscall3+8)
#1 pc 000000000000ef94 /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
#2 pc 000000000000eff4 /system/lib/libc.so (__pthread_cond_timedwait+64)
#3 pc 0000000000013007 /system/lib/libc.so (pthread_join+74)
#4 pc 00000000001fa2a5 /data/app-lib/air.com.app1-1/libCore.so
at com.adobe.air.customHandler.callTimeoutFunction (Native Method)
at com.adobe.air.customHandler.handleMessage (customHandler.java:22)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:136)
at android.app.ActivityThread.main (ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:595)
at dalvik.system.NativeStart.main (Native Method)

@neuronix
Copy link
Author

Thanks to both of you! Since both apps have such different rates, could you give a little extra info?

  • Do you have little or a lot of user inputs ?
  • Do you have any input intense situations like tapping or dragging on the screen?
  • Do you have ANEs included in the app (notably ads) ?

@Seb-AS
Copy link

Seb-AS commented Nov 30, 2017

Do you have little or a lot of user inputs ?
Yes, we have.
Do you have any input intense situations like tapping or dragging on the screen?
Yes, we have.
Do you have ANEs included in the app (notably ads) ?
Ads: AdCel, AdColony, SuperAwesome
Some District Anes.(Contacts/mediaPlayer/flurry/more)
Goviral
Custom Anes.

@neuronix
Copy link
Author

Thanks @Seb-AS, will be interesting to compare with @skolesnyk's app regarding the amount of user inputs.

@skolesnyk
Copy link

skolesnyk commented Nov 30, 2017

Scrolling lists, tapping on Sound Player play/pause buttons, text entry.
There's FacebookAPI ANE integration, so some users switch to Facebook native app or browser and then back to the app.
Using about 14 ANEs, mostly Distriqt, but also BranchIO, Fyber (with 2 ad networks): showing interstitials without user's action and showing Fyber Offerwall after user's interaction with UI.

@MathiasFabian
Copy link

App with Air 25, Starling 2.2
ANR: 7.5%
Crash rate: 4.0%

Broadcast of Intent { act=android.intent.action.SCREEN_ON flg=0x50000010 }
Broadcast of Intent { act=android.intent.action.SCREEN_OFF flg=0x50000010 }
Broadcast of Intent { act=org.herozero.NOTIFICATION_DELAYED
and a lot of Input dispatching timed out errors

App with Air 25, Starling 1.8
ANR: 2.6%
Crash rate: 2.2%

Broadcast of Intent { act=android.intent.action.SCREEN_ON flg=0x50000010 }
Broadcast of Intent { act=android.intent.action.SCREEN_OFF flg=0x50000010 }
and a lot of Input dispatching timed out and keyDispatchingTimedOut errors

Do you have little or a lot of user inputs ?
Yes, in both apps.
Do you have any input intense situations like tapping or dragging on the screen?
First app has more taps, second a lot of swiping.
Do you have ANEs included in the app (notably ads) ?
Both Apps use a lot of distriqt ANEs (Application, Billing, Facebook, ...) and for ads the Appodeal ANE.

@neuronix
Copy link
Author

neuronix commented Dec 1, 2017

Thank you @MathiasFabian for sharing!

@PrimaryFeather this issue seems to be plaguing a lot if not just about all AIR apps. Could you get someone from the AIR team to look into this?

@calibrae
Copy link

calibrae commented Dec 1, 2017

App with Air 22 and Starling 1.9
ANR: 2.79%
Crash 0.51%

Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 5. Wait queue head age: 5502.9ms.)

Do you have little or a lot of user inputs ?
No.
Do you have any input intense situations like tapping or dragging on the screen?
Yes, the app is an educational game for kids
Do you have ANEs included in the app (notably ads) ?
Distriqt Extension Files for Android app only.

@chichilatte
Copy link

chichilatte commented Dec 1, 2017

  • AIR 23 (we tried 27 but ANR frequency was similar)
  • Starling 1.8
  • Crashes: 1.35%
    Our main crash is "java.lang.NullPointerException" at com.adobe.air.AIRWindowSurfaceView.onKeyUp (AIRWindowSurfaceView.java:395)
  • ANRs: 0.6%
    We've had 49 ANRs recently, 39 of which were the same as your main one @neuronix:
    "Input dispatching timed out" at com.adobe.air.customHandler.callTimeoutFunction.
    The description for it:
    Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 2. Wait queue head age: 5926.5ms.)
    Actually, all of our ANRs are variations of "Input dispatching timed out". Not sure if that's normal.

EDIT: The Google Play Console was being extremely flakey – our most common ANR error was in fact Broadcast of Intent { act=android.intent.action.SCREEN_OFF ...
They accounted for 77% of all ANRs, the rest being Input dispatching timed out.
One thing to note is that the stack traces for both errors mention com.adobe.air.customHandler.callTimeoutFunction
EDIT2: The Play Console is definitely flakey for us – using the same filters and time period as i used previously it's saying 90% of our ANR errors are Input dispatching timed out, 10% Broadcast of Intent { act=android.intent.action.SCREEN_OFF ....
Could it be these are the same error? We've spoken to Google and they say their tech team are having a look.


  • We don't have a lot of user inputs, just a tap or drag once every few secs. No intense periods.
  • ANEs: GoViral, RateBox, Distriqt Firebase. No ads ANEs.

We can replicate the ANRs but it takes a while and they seem to happen randomly. We're completely flummoxed. The ANRs can happen on a completely static screen with only very occasional input. I suspected a memory leak but Scout says no.

@marchbold
Copy link
Collaborator

Concerned our ANEs are mentioned here, if this is related to us we will chase down the issue immediately, though I'm fairly confident it's not.

Is anyone having this issue without distriqt's ANEs?

@neuronix
Copy link
Author

neuronix commented Dec 1, 2017

@marchbold we use Milkman ANEs, I don’t think it’s related to your ANEs in particular, my gut feeling is an issue in the Android/AIR input handling.

@marchbold
Copy link
Collaborator

Yeah, that's my feeling too, just was a little concerned when saw our extensions mentioned several times. We did actually do a thorough review of our ANEs to identify any potential causes when we encountered this issue in our apps and couldn't find anything.

Our largest app:

  • ANR rate: 2.15%
  • Crash rate: 0.55%

ANRs are mainly due to two causes:

  • Broadcast of Intent { act=android.intent.action.SCREEN_OFF ...
  • Input dispatching timed out (Waiting because the touched window has not finished ...

Similar logs to the ones above.

We use Fyber Ads ANE

Crashes are mainly related to Fyber:

  • java.lang.NullPointerException com.fyber.ads.videos.a.b.a RewardedVideoClient.java
  • signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)

@chichilatte
Copy link

Our most common crashes over last 60 days:

  • 36% java.lang.NullPointerException at com.adobe.air.AIRWindowSurfaceView.onKeyUp (AIRWindowSurfaceView.java:395)
  • 28% java.lang.NullPointerException at com.adobe.air.AIRWindowSurfaceView.surfaceChanged
  • 23% variations of signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
  • 6% signal 11 (SIGSEGV), code 2 (SEGV_ACCERR)

@dcampano
Copy link

dcampano commented Dec 4, 2017

We are also seeing very similar ANR rates and similar causes:

  • Broadcast of Intent { act=android.intent.action.SCREEN_OFF ...
  • Broadcast of Intent { act=android.intent.action.SCREEN_ON ...
  • Input dispatching timed out (Waiting because the touched window has not finished ...

Here are some stats on our app:

  • ANR Rate: 3.4%
  • Crash Rate: 1.08% (some of these coming from a purchase extension so this could get lowered)
  • ~50k daily active users
  • AIR 27, Starling 1.6, Feathers 2.1.1
  • GoViral Facebook ANE, some Distriqt ANES. We ripped out all advertising ANEs as we thought these might be causing issues but it didn't help our ANR rate at all.

We also don't think that these ANRs are extension related. When we have had some other ANRs caused by extensions we were able to see a clear stacktrace to the extension code.

Do you have little or a lot of user inputs? Typically 1 or 2 taps every few seconds
Do you have any input intense situations like tapping or dragging on the screen? No
Do you have ANEs included in the app (notably ads) ? Answered above

@darriuk
Copy link

darriuk commented Dec 11, 2017

We're seeing ANRs and crashes above the bad behaviour thresholds in our app.
• ANR rate: 0.73%
• Crash rate: 1.47%
• Air 23.0, Starling 1.8.1, Feathers 2.2

Do you have little or a lot of user inputs ?
Not that much user input.

Do you have any input intense situations like tapping or dragging on the screen?
Tapping, yes, but never really intense tapping. Also dragging the screen on some pages. ANRs have happened when neither tapping nor dragging was being done by the user, and no intense computation was being done by our app.

Do you have ANEs included in the app (notably ads) ?
Yes, but no ads:
• Milkman GoViral, RateBox
• Distriqt – androidsupport.V4, Core, Firebase, Crash, GoogleIdentity, Notifications, playservices.Auth, playservices.Base, playservices.Identity, Resources
• pl.mateuszmackowiak.nativeANE.properties.SystemProperties.ane

Typical ANR reports:

Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago

Input dispatching timed out (Waiting because the touched window has not finished processing the input events that were previously delivered to it.)

Typical crash traces:

java.lang.NullPointerException: 
  at com.adobe.air.AIRWindowSurfaceView.onKeyUp (AIRWindowSurfaceView.java:395)
  at android.view.KeyEvent.dispatch (KeyEvent.java:2907)
  at android.view.View.dispatchKeyEvent (View.java:7543)
java.lang.NullPointerException: 
  at com.adobe.air.AIRWindowSurfaceView.surfaceChanged (AIRWindowSurfaceView.java:735)
  at android.view.SurfaceView.updateWindow (SurfaceView.java:731)
  at android.view.SurfaceView.onWindowVisibilityChanged (SurfaceView.java:322)

@Ankit-Adobe
Copy link

Hi,
Could you please a log a bug at http://tracker.adobe.com/ and attach a sample application where this issue is reproducible.

Thanks,
Ankit | Adobe AIR Engineering

@neuronix
Copy link
Author

Hi @Ankit-Adobe, Thanks for joining the conversation. There is already a bug in the tracker here: https://tracker.adobe.com/#/view/AIR-4198519

We have tried to reproduce the bug but without success so far. Could you give us more information on when/how this error is triggered? It always seems to originate from com.adobe.air.customHandler.callTimeoutFunction

@cgascons
Copy link

Hi guys, we are having the exact same errors on all our apps, we have also updated the forum topic (https://forum.starling-framework.org/topic/anrs-crash-rate-survey?replies=5#post-109884) and voted and commented on the tracker url provided.

ANR rate: 3.60%
Crash rate: 0.90%
• Air 26.0, Starling 2.2 (2017-06-27), Feathers 3.1.2 (January 2017)

Thanks,

@chichilatte
Copy link

Just a note to say i made an edit to my original post above (the main ANR error was wrong)

@PrimaryFeather
Copy link
Contributor

Just a thought (actually an idea of Robby Campano): could it be that the ANRs we are seeing are the result of users hitting the screen while the apps are restoring from a context loss? After all, this takes some time, and the textures are restored synchronously, i.e. all input will be blocked.

I could switch the texture restoration to being asynchronous, but it's been reported that this is not entirely reliable on some Android hardware. Could be worth a shot, though — this requires only a small change inside the AssetManager (I think). Then I could make this an "opt-in" flag.

Any comments?

@cgascons
Copy link

As a matter of fact I was just testing that, these are the results:

Turns out that, -when the user locks the device- the app has a harder time recovering from a context loss when the app is in foreground rather than in background. At least it took significantly more time on my device (Samsung Galaxy S6).

If I send the app to background, then lock the device, unlock it back, and bring it to foreground again the restoration is still visible, but it takes none to very short time.

When I try it the other way around (app was in foreground when the device got locked), while the app is restoring, I can still play around and click stuff when, according with what you just said, all the input should be blocked. I have to say though, that I can't really tell an exact restoration time for each example, since sometimes my device takes longer because, I don't know, it doesn't like my face :)

I'm not entirely sure if I'm missing something but I can definitely mess around with the app when recovering from the context loss. That said, I still haven't been able to reproduce the ANR itself on my phone while debugging.

@PrimaryFeather
Copy link
Contributor

Thanks for the additional info, Christian!

I'm not entirely sure if I'm missing something but I can definitely mess around with the app when recovering from the context loss.

You're totally right: it depends on the size of the textures being restored. I imagine it takes a while loading a 4k*4k texture, for example; and during that time, input will be blocked. Loading several smaller ones should not be that much of an issue, because there's a gap for AS3 to process stuff between each upload process.

@cgascons
Copy link

I see, perhaps what I'm about to suggest isn't doable, but what if the whole Stage was left untouchable as soon as the restoration begins, and it gets back to touchable as soon as the TEXTURES_RESTORED event gets dispatched? Could that be an option? I understant that during that restoration time no ANR's could be generated since the touch events would not be triggered, right?

@PrimaryFeather
Copy link
Contributor

Hm, no, that wouldn't help. Since it's a synchronous operation, all of AS3 stops accepting input — and that includes the mouse events of the classic Flash (which Starling otherwise queues). The only solution would be to avoid that synchronous (time consuming) operation.

Again, I don't know if that's really the issue — it's just a possibility.

@neuronix
Copy link
Author

I do not think this is related to context loss. ANRs occur during gameplay periods according to our user reports. However it seems to occur after a period without user inputs:

Case 1: match 3 game, users report freezing often after waiting to think on a move (5s maybe)
Case 2: timer based game, users report freezing always when about 4-5s left out of 15, so again probably a short pause between inputs.

@PrimaryFeather
Copy link
Contributor

ANRs occur during gameplay periods according to our user reports.

Aha, that's useful information — thanks!

@rewb0rn
Copy link

rewb0rn commented Aug 12, 2019

Cool. Have fun and goodbye :)

@rewb0rn
Copy link

rewb0rn commented Aug 15, 2019

By the way for everyone else: Air SDK 33 is available for distribution now directly from Harman. We are making good progress towards a 64 Bits release and did not find any errors so far. As soon as the last remaining ANE has been converted we plan to release 64 bits updates on Google Play.

@falcos
Copy link

falcos commented Aug 16, 2019

@rewb0rn that's good news. Did you also see any improvements in performance?

@rewb0rn
Copy link

rewb0rn commented Aug 21, 2019

Can't say anything about that honestly, we are in the middle of rewrites for the missing ANE and I haven't paid attention to performance before. I will update once I have some clarity.

@SHDgames
Copy link

Has anyone been able to submit to Google Play since August using Adobe AIR ?

I am currently dead in the water with a very large game (3 years in dev) and can't submit to Google Play due to the 64 bit requirements.

I have emailed Harman to get on the Beta for Air 33 (Which I am hoping supports 64 bit) and to be able to submit to Google Play.

Anybody successfully submit an Adobe Air game lately?

Thanks for any updates or help on this subject !!

@sweetnitro
Copy link

@SHDgames new games submitted have to support 64 bit since 1st August, so you'll have to use AIR 33.

Updates however are allowed with 32bit only until sometime 2020.

@SHDgames
Copy link

@sweetnitro Thanks -- but is AIR 33 available anywhere? I read Harman was supposed to have a beta out in June, and haven't found anything anywhere ...

The best I got was to email the adobe support team with Harman for a BETA (emailed 2 days ago) and I haven't heard back.. just wondering if this is the best practise at this point.

Thanks guys - I have high hopes still that this can be resolved!

@rewb0rn
Copy link

rewb0rn commented Aug 27, 2019

Yes Air SDK 33 is available already, but unfortunately only from the email address you have found. I guess they have problems catching up with all the emails they receive, but you should get access to the SDK after you have agreed to their terms and services (you have to write them an email where you state that you accept the terms of the SDK).

Hopefully they will have a website set up soon, so this whole thing becomes a bit more transparent.

@pkumargsngames
Copy link

Hi,

Our App(Starling 1.8-AIR 26/21):

ANR Rate : 4%
Crash Rate: 5%

39 reports last 7 days:

Broadcast of Intent { act=android.intent.action.SCREEN_OFF flg=0x50000010 (has extras) }

"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 obj=0x74de5000 self=0xb7d81f78
| sysTid=21001 nice=-6 cgrp=bg_non_interactive sched=0/0 handle=0xb6f01bec
| state=S schedstat=( 883042412234 69541281861 500913 ) utm=83394 stm=4910 core=1 HZ=100
| stack=0xbe568000-0xbe56a000 stackSize=8MB
| held mutexes=
#00 pc 000000000000f9b0 /system/lib/libc.so (syscall+28)
#1 pc 00000000000138ab /system/lib/libc.so (pthread_join+90)
#2 pc 00000000001fa2a5 /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#3 pc 00000000001fa34b /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#4 pc 00000000001c98d5 /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#5 pc 00000000001c3901 /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#6 pc 00000000003477df /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#7 pc 00000000003cee7b /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#8 pc 00000000003d10ed /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#9 pc 000000000012ebeb /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#10 pc 0000000000130b27 /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#11 pc 00000000001349b1 /data/app/air.com.app1-1/lib/arm/libCore.so (???)
#12 pc 00000000001215e3 /data/app/air.com.app1-1/lib/arm/libCore.so (Java_com_adobe_air_customHandler_callTimeoutFunction+10)
#13 pc 00000000001bbc1f /data/dalvik-cache/arm/data@app@air.com.app1-1@base.apk@classes.dex (Java_com_adobe_air_customHandler_callTimeoutFunction__II+90)
at com.adobe.air.customHandler.callTimeoutFunction (Native method)
at com.adobe.air.customHandler.handleMessage (customHandler.java:22)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:135)
at android.app.ActivityThread.main (ActivityThread.java:5912)
at java.lang.reflect.Method.invoke! (Native method)
at java.lang.reflect.Method.invoke (Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1405)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1200)

10 reports last 7 days:

Input dispatching timed out (Waiting because the touched window has not finished processing the input events that were previously delivered to it.)

"main" prio=5 tid=1 NATIVE
| group="main" sCount=1 dsCount=0 obj=0x415a4ca8 self=0x414de570
| sysTid=22564 nice=-6 sched=0/0 cgrp=apps handle=1074331988
| state=S schedstat=( 0 0 0 ) utm=4477 stm=515 core=2
#00 pc 0000000000021910 /system/lib/libc.so (__futex_syscall3+8)
#1 pc 000000000000ef94 /system/lib/libc.so (__pthread_cond_timedwait_relative+48)
#2 pc 000000000000eff4 /system/lib/libc.so (__pthread_cond_timedwait+64)
#3 pc 0000000000013007 /system/lib/libc.so (pthread_join+74)
#4 pc 00000000001fa2a5 /data/app-lib/air.com.app1-1/libCore.so
at com.adobe.air.customHandler.callTimeoutFunction (Native Method)
at com.adobe.air.customHandler.handleMessage (customHandler.java:22)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:136)
at android.app.ActivityThread.main (ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative (Native Method)
at java.lang.reflect.Method.invoke (Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:595)
at dalvik.system.NativeStart.main (Native Method)

We noticed that using Loader:loadBytes() instead of Loader:load() prevents the ANR caused by click during asset load.

@ajwfrost
Copy link
Collaborator

Thanks for those - can I please check the architecture and the exact version of AIR that you've got there? It looks 64-bit but didn't match the addresses in our binary for ARMv8..

@Gokulv617
Copy link

#519 (comment)

I have also mentioned this issue for some more information

@cgascons
Copy link

cgascons commented Dec 23, 2020

Hi, the following is also our top#1 ANR:

Input dispatching timed out (Waiting because the touched window's input channel is full. Outbound queue length: 1. Wait queue length: 52.)

Data from last 60 days:

**Occurrences**
32
Last 60 days

**Total occurrences**
33
Lifetime

**Impacted users**
24
Lifetime

**Last occurred**
2 days ago

  #00  pc 000000000091c81c  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000009331d4  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 0000000000914de8  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 0000000000943e34  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 0000000000925b08  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 0000000000925bbc  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000009666e4  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000006f3c70  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000006f3fd0  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007b31a8  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007b3d14  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007b0b0c  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007d07a0  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007b0b0c  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007d07a0  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007b0b0c  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007d07a0  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 0000000000726084  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007d5b5c  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007b0b0c  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007d07a0  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007b0b0c  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007d07a0  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007d46e4  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007b0b0c  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007d07a0  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000007b43dc  /data/app/air.com.xxx-hAJt8ONZ1mexuM8IjA89dg==/lib/arm64/libCore.so (???)
  #00  pc 00000000001a84d4  (???)
  at com.adobe.air.customHandler.callTimeoutFunction (Native method)
  at com.adobe.air.customHandler.handleMessage (customHandler.java:22)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:166)
  at android.app.ActivityThread.main (ActivityThread.java:6861)
  at java.lang.reflect.Method.invoke (Native method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:450)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:936)

Is anybody certain that this is indeed originated by playing sounds? If that's so I'd give @marchbold's Distriqt Multimedia ANE a try.

[Edit] Also, in case anybody missed it, here's the bug tracker url

@PhilCase
Copy link

PhilCase commented Jul 23, 2021

We've been seeing this issue increasingly since in the last 10 days. Our app is using version 33.1.1.476 of the Harmon/AIR SDK sdk. We're getting users reporting that the app freezes whilst showing the Launch screen and other crashes.

I'm not sure whether an anonymous function is missing to handle the timeout dispatcher or what is happening.

The errors I'm seeing are the same as other peoples.

They are more likely to occur on Android 11, then 10 and then 9. I don't know if this is reflective of the percentage of the audience using those devices.

@ajwfrost
Copy link
Collaborator

Hi @PhilCase - there's not a lot of changes that have gone into the Android side of things recently, just some simple changes to handle some null references that seem to be happening on some Android devices where the activity lifecycle model isn't working as we would expect... Do you have any call stacks or debug logs from any of these issues and we can look to see if there's an obvious root cause?

thanks

@PhilCase
Copy link

PhilCase commented Nov 4, 2021

Hi @ajwfrost

We're still getting ANRs unfortunately, with 33.1.1.575. We didn't try the 33.1.1.633 on Android.

ANR_LOG.zip

Is there any advice for tracking down what is causing them please?

Distriqt's Exception ANE looks like it might help if I can set an exception handler up for the entire app. I'm not sure what I can do if the error isn't starting in our code.

Their JobScheduler ANE references here saying that it was "developed for usage in resolution of the Adobe AIR Android ANR issue, as discussed" but I don't understand how if I'm not cancelling a scheduled job.

@ajwfrost
Copy link
Collaborator

ajwfrost commented Nov 5, 2021

Hi @PhilCase

ANR01: processing some ActionScript - within the interpreter, rather than as JITted code. Which may indicate it's a class initialiser, or it may just be the first time the function has run. Lack of "AS stuck" thread makes me think this might be during start-up?
ANR02: lots of bg rendering threads but can't really see what's happening on the main UI thread.
ANR03: main thread is just doing a 'getproperty' on an AS3 object. Lots of bg rendering threads are idle, but nothing there to suggest what is causing any delays.
ANR04: main thread doing byte array 'get' call, which made me wonder since we'd seen ANRs previously in this function, but (a) it's not stuck at a mutex lock, and (b) it's from .575 which doesn't have the mutexes there any more as we made it an atomic operation.

So from what we can see from these logs, the application doesn't actually seem to be 'stuck' in a static state i.e. no hint of deadlock/livelock problems caused by multithreading. So it may just be code that's taking too long to run: if you try running this with a connection to Adobe Scout, it would be worth seeing whether you spot any glitches i.e. frames where it suddenly took a lot longer to process.

If the problems are related to the start-up processing, then it may help if we can get AOT working for Android...

We'd started creating an ANE that could further work out where things may be getting stuck, but it's probably not the best idea to add extra code into the initialisation here - we'll look again at how best we can build in some metrics/diagnostics.

thanks

@PhilCase
Copy link

PhilCase commented Nov 9, 2021

Hi @ajwfrost ,

regarding the ANRs. Our users have indicated that the app gets slower over the days that they use it for. We've found (experimentally) that if they clear their Application Data (Sandbox) or just the "application storage directory" (which is still in the sandbox but isn't the full sandbox) that the app will return to full responsiveness.

Our application storage directory contains files like an sqllite database and files installed by the app to work against.
Over time the user will add photographs and "cached data to return via web services" to the directory.

I've done some research and have seen note that a fragmented sqllite database can cause an app to become less responsive and that on a flash based file system the database might not be copied to contiguous blocks of storage when it expands in size. We're wondering could that be a cause of the issue and whether it is something that you can see in the logs?

@PhilCase
Copy link

PhilCase commented Nov 9, 2021

Also - I've had little success in getting Adobe Scout to run. It mentions a "debug player". The app appears to be out of date and complains about running on an Android 11 device. the support pages on the Adobe web site for it have been archived and removed.

I've had no luck with the profiler in IntelliJ IDEA either. Is there any advice on getting either of these running please?

@ajwfrost
Copy link
Collaborator

ajwfrost commented Nov 9, 2021

For Scout; you should be able to download the Windows or MacOS client application, from the below link:
https://helpx.adobe.com/scout/kb/download-adobe-scout-cc.html

But the companion app for Android will no longer work because of the folder access changes.. so you would need to create a telemetry config file and include this as part of your APK file. If you open Scout, it will automatically generate a telemetry config file, in your home folder e.g. c:\users\username\.telemetry.cfg. If you copy this into the packaging area and put it in the 'root' of your package (normally the same folder your SWF file) called just telemetry.cfg, and edit the IP address so that this is the IP address of your computer.. then when you package apk-debug and start this up, it should reach out to the given IP address and try to connect to an instance of the Scout app running on the PC..

Not sure about the profiler in IDEA but again it would need the debug builds (apk-debug, or aab-debug) and potentially then it can connect to the debugger. You may be able to provide the IP address of the local/developer machine when the app first opens... I'll try to get details on all this stuff published onto the airsdk.dev website!

thanks

@PhilCase
Copy link

PhilCase commented Nov 9, 2021

Thanks Andrew. That's a massive help. I couldn't find any documentation at all on the Adobe web site for it.
I'd got it running with the app on an Android 8 phone. I found a "telemetry.cfg" file on stackoverflow and have edited that for my purposes. (I didn't have a local .telemetry.cfg file). :)

@PhilCase
Copy link

PhilCase commented Nov 10, 2021

@ajwfrost do you have any thoughts on my other thought about why clearing the ApplicationStorageArea would increase performance in the app?
Or regarding the assertion that "fragmented sqllite databases on a flash file system can cause device slowdown" please?

@ajwfrost
Copy link
Collaborator

@PhilCase sorry I'd missed those parts ... that's quite interesting, I can't see why the number of files within the application storage directory would have any effect on performance, it's not like there's a listing of these that happens during start-up.... we can have a look and do a bit of profiling here perhaps.

Plus - we will definitely look into this issue of a fragmented sqlite database, I'll see whether we can do something about that!

thanks

@PhilCase
Copy link

Thanks Andrew.

The "fragmented database" might not be what's causing our slowdown, so I can't say whether it's a dead end or not. Here's the article I found that mentioned it. (Sorry I don't have the hyperlink any more).

hotstorage16_ji.pdf

I know our database is encrypted also (which sounds like overkill if we're running in a secure sandbox folder).

I have seen a number of places that recommend clearing the cache or clearing the App's data directory as a step towards problem resolution.

Do you profile using Scout also?

Cheers.

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

No branches or pull requests