Skip to content

[flutter 3.27] crashlytics reports many ANR io.flutter.embedding.engine.FlutterJNI.nativeSurfaceDestroyed #160357

Closed

Description

@peterweb2005

Steps to reproduce

Random in production

Expected results

no report the issue

Actual results

crashlytics report ANR

Code sample

Code sample
No sample

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
          main (native):tid=1 systid=27661 
#00 pc 0x5e328 libc.so (syscall + 28)
#01 pc 0x63429 libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*) + 92)
#02 pc 0xaa373 libc.so (pthread_cond_wait + 32)
#03 pc 0x29d23f split_config.armeabi_v7a.apk!libflutter.so + 8454144
#04 pc 0x4dfe [anon:libc_malloc]
       at io.flutter.embedding.engine.FlutterJNI.nativeSurfaceDestroyed(FlutterJNI.java)
       at io.flutter.embedding.engine.FlutterJNI.onSurfaceDestroyed(FlutterJNI.java:667)
       at io.flutter.embedding.engine.renderer.FlutterRenderer.stopRenderingToSurface(FlutterRenderer.java:1125)
       at io.flutter.embedding.android.FlutterSurfaceView.disconnectSurfaceFromRenderer(FlutterSurfaceView.java:303)
       at io.flutter.embedding.android.FlutterSurfaceView.access$400(FlutterSurfaceView.java:36)
       at io.flutter.embedding.android.FlutterSurfaceView$1.surfaceDestroyed(FlutterSurfaceView.java:78)
       at android.view.SurfaceView.notifySurfaceDestroyed(SurfaceView.java:1842)
       at android.view.SurfaceView.updateSurface(SurfaceView.java:1130)
       at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:310)
       at android.view.View.dispatchWindowVisibilityChanged(View.java:14778)
       at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1616)
       at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1616)
       at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1616)
       at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2519)
       at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2038)
       at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8359)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
       at android.view.Choreographer.doCallbacks(Choreographer.java:796)
       at android.view.Choreographer.doFrame(Choreographer.java:731)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7974)
       at java.lang.reflect.Method.invoke(Native method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:603)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:948)

Flutter Doctor output

Doctor output
[Paste your output here]

Activity

  1. peterweb2005 commented on Dec 16, 2024

    @peterweb2005
    Author

    marked no related to another popular 3.27 issue #160228

  2. darshankawar commented on Dec 17, 2024

    @darshankawar
    Member

    @peterweb2005
    The stacktrace probably looks similar to #156728 that you can check for reference to see if it helps in your case or not.

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Dec 17, 2024
  4. peterweb2005 commented on Dec 17, 2024

    @peterweb2005
    Author

    @peterweb2005 The stacktrace probably looks similar to #156728 that you can check for reference to see if it helps in your case or not.

    don't know, only know that my apps load no gif

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Dec 17, 2024
  6. darshankawar commented on Dec 18, 2024

    @darshankawar
    Member
    at io.flutter.embedding.engine.FlutterJNI.nativeSurfaceDestroyed(FlutterJNI.java)
           at io.flutter.embedding.engine.FlutterJNI.onSurfaceDestroyed(FlutterJNI.java:667)
           at io.flutter.embedding.engine.renderer.FlutterRenderer.stopRenderingToSurface(FlutterRenderer.java:1125)
           at io.flutter.embedding.android.FlutterSurfaceView.disconnectSurfaceFromRenderer(FlutterSurfaceView.java:303)
           at io.flutter.embedding.android.FlutterSurfaceView.access$400(FlutterSurfaceView.java:36)
           at io.flutter.embedding.android.FlutterSurfaceView$1.surfaceDestroyed(FlutterSurfaceView.java:78)
    

    I will keep the issue open based on this stacktrace. Ideally we would need a reproducible case in order to analyze further.

  7. added
    c: crashStack traces logged to the console
    a: productionIssues experienced in live production apps
    needs repro infoAutomated crash report whose cause isn't yet known
    platform-androidAndroid applications specifically
    engineflutter/engine related. See also e: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Dec 18, 2024
  8. ashraf-patel-hs commented on Jan 3, 2025

    @ashraf-patel-hs

    @darshankawar I am facing the same issue, it happens when the activity tries to perform the stop at android.app.Activity.performStop(Activity.java:8771).

    The log is from the production user,

              main (native):tid=1 systid=2858 
    #00 pc 0x89af0 libc.so (syscall + 32) (BuildId: 449f781894033dce6346794a1ee593e0)
    #01 pc 0x8e4d8 libc.so (__futex_wait_ex + 148) (BuildId: 449f781894033dce6346794a1ee593e0)
    #02 pc 0xf489c libc.so (pthread_cond_wait + 80) (BuildId: 449f781894033dce6346794a1ee593e0)
    #03 pc 0x4629e8 libflutter.so (BuildId: ad074c0ef7b18624be1126cf4eb7343ec826e01c)
    #04 pc 0x475e8c libflutter.so (BuildId: ad074c0ef7b18624be1126cf4eb7343ec826e01c)
    #05 pc 0x7ac7e0 libflutter.so (BuildId: ad074c0ef7b18624be1126cf4eb7343ec826e01c)
    #06 pc 0x45c4c0 libflutter.so (BuildId: ad074c0ef7b18624be1126cf4eb7343ec826e01c)
    #07 pc 0x45eab0 libflutter.so (BuildId: ad074c0ef7b18624be1126cf4eb7343ec826e01c)
           at io.flutter.embedding.engine.FlutterJNI.nativeSurfaceDestroyed(FlutterJNI.java)
           at io.flutter.embedding.engine.FlutterJNI.onSurfaceDestroyed(FlutterJNI.java:667)
           at io.flutter.embedding.engine.renderer.FlutterRenderer.stopRenderingToSurface(FlutterRenderer.java:1087)
           at io.flutter.embedding.android.FlutterSurfaceView.disconnectSurfaceFromRenderer(FlutterSurfaceView.java:303)
           at io.flutter.embedding.android.FlutterSurfaceView.access$400(FlutterSurfaceView.java:36)
           at io.flutter.embedding.android.FlutterSurfaceView$1.surfaceDestroyed(FlutterSurfaceView.java:78)
           at android.view.SurfaceView.notifySurfaceDestroyed(SurfaceView.java:1934)
           at android.view.SurfaceView.updateSurface(SurfaceView.java:1111)
           at android.view.SurfaceView.setWindowStopped(SurfaceView.java:294)
           at android.view.SurfaceView.surfaceDestroyed(SurfaceView.java:1816)
           at android.view.ViewRootImpl.notifySurfaceDestroyed(ViewRootImpl.java:2293)
           at android.view.ViewRootImpl.setWindowStopped(ViewRootImpl.java:2207)
           at android.view.WindowManagerGlobal.setStoppedState(WindowManagerGlobal.java:699)
           at android.app.Activity.performStop(Activity.java:8771)
           at android.app.ActivityThread.callActivityOnStop(ActivityThread.java:5385)
           at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:5365)
           at android.app.ActivityThread.handleStopActivity(ActivityThread.java:5430)
           at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:235)
           at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
           at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
           at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2394)
           at android.os.Handler.dispatchMessage(Handler.java:106)
           at android.os.Looper.loopOnce(Looper.java:211)
           at android.os.Looper.loop(Looper.java:300)
           at android.app.ActivityThread.main(ActivityThread.java:8296)
           at java.lang.reflect.Method.invoke(Native method)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954)
    
  9. jonahwilliams commented on Jan 6, 2025

    @jonahwilliams
    Contributor

    @peterweb2005 is that all of the information from crashlytics? It looks like that thread might be parked waiting for something, but not sure what.

    If we could get symbols for the singular flutter frame in the issue that would be helpful

  10. added
    P3Issues that are less important to the Flutter project
    on Jan 6, 2025
  11. peterweb2005 commented on Jan 6, 2025

    @peterweb2005
    Author

    seems yes, but these numbers more often, i mean 00-07

              main (native):tid=1 systid=25337 
    #00 pc 0x86b8c libc.so (syscall + 28)
    #01 pc 0x8a938 libc.so (__futex_wait_ex(void volatile*, bool, int, bool, timespec const*) + 144)
    #02 pc 0xeab90 libc.so (pthread_cond_wait + 60)
    #03 pc 0x46e7ac split_config.arm64_v8a.apk!libflutter.so + 7634944
    #04 pc 0x482464 split_config.arm64_v8a.apk!libflutter.so + 7634944
    #05 pc 0x7c814c split_config.arm64_v8a.apk!libflutter.so + 7634944
    #06 pc 0x466be8 split_config.arm64_v8a.apk!libflutter.so + 7634944
    #07 pc 0x469300 split_config.arm64_v8a.apk!libflutter.so + 7634944
           at io.flutter.embedding.engine.FlutterJNI.nativeSurfaceDestroyed(FlutterJNI.java)
           at io.flutter.embedding.engine.FlutterJNI.onSurfaceDestroyed(FlutterJNI.java:667)
           at io.flutter.embedding.engine.renderer.FlutterRenderer.stopRenderingToSurface(FlutterRenderer.java:1125)
           at io.flutter.embedding.android.FlutterSurfaceView.disconnectSurfaceFromRenderer(FlutterSurfaceView.java:303)
           at io.flutter.embedding.android.FlutterSurfaceView.access$400(FlutterSurfaceView.java:36)
           at io.flutter.embedding.android.FlutterSurfaceView$1.surfaceDestroyed(FlutterSurfaceView.java:78)
           at android.view.SurfaceView.notifySurfaceDestroyed(SurfaceView.java:2025)
           at android.view.SurfaceView.updateSurface(SurfaceView.java:1245)
           at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:379)
           at android.view.View.dispatchWindowVisibilityChanged(View.java:15598)
           at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1632)
           at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1632)
           at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1632)
           at com.android.internal.policy.DecorView.dispatchWindowVisibilityChanged(DecorView.java:4221)
           at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3151)
           at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2618)
           at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9971)
           at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1010)
           at android.view.Choreographer.doCallbacks(Choreographer.java:809)
           at android.view.Choreographer.doFrame(Choreographer.java:744)
           at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:995)
           at android.os.Handler.handleCallback(Handler.java:938)
           at android.os.Handler.dispatchMessage(Handler.java:99)
           at android.os.Looper.loop(Looper.java:246)
           at android.app.ActivityThread.main(ActivityThread.java:8653)
           at java.lang.reflect.Method.invoke(Native method)
           at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
    
  12. peterweb2005 commented on Jan 6, 2025

    @peterweb2005
    Author

    wondered that only another one person report production ANRs, or the issue fixed in 3.27.1

  13. peterweb2005 commented on Jan 24, 2025

    @peterweb2005
    Author

    seems the error no reported in 3.27.3

    Flutter Doctor output

    Doctor output
    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 3.27.3, on Microsoft Windows [Version 10.0.22631.4751], locale en-US)
    [√] Windows Version (Installed version of Windows is version 10 or higher)
    [√] Android toolchain - develop for Android devices (Android SDK version 35.0.1)
    [√] Chrome - develop for the web
    [X] Visual Studio - develop Windows apps
        X Visual Studio not installed; this is necessary to develop Windows apps.
          Download at https://visualstudio.microsoft.com/downloads/.
          Please install the "Desktop development with C++" workload, including all of its default components
    [√] Android Studio (version 2024.2)
    [√] IntelliJ IDEA Community Edition (version 2024.3)
    [√] VS Code, 64-bit edition (version 1.96.2)
    [√] Connected device (3 available)
    [√] Network resources
    
    ! Doctor found issues in 1 category.
  14. github-actions commented on Feb 11, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: productionIssues experienced in live production appsc: crashStack traces logged to the consoleengineflutter/engine related. See also e: labels.needs repro infoAutomated crash report whose cause isn't yet knownplatform-androidAndroid applications specificallyr: solvedIssue is closed as solvedteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions