Skip to content

[Impeller] ASurfaceTransactionStats_getPreviousReleaseFenceFd crashing mysteriously on some API 29 devices. #155877

Closed
flutter-team-archive/engine
#55708

Description

@iLoveDocs

Steps to reproduce

  1. Create a new Flutter project by running flutter create --project-name test -a java <path>
  2. Run the app.
  3. Click on the FAB multiple times quickly.

Expected results

The app shouldn't crash.

Actual results

The app crashes, and I’ve also tried beta channel, but I get the same result.

Code sample

The one used by flutter create.

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Flutter.bug.1.mov

Logs

Logs
Launching lib/main.dart on M2007J17I in profile mode...
Running Gradle task 'assembleProfile'...
✓ Built build/app/outputs/flutter-apk/app-profile.apk (13.5MB)
I/flutter ( 8452): [IMPORTANT:flutter/shell/platform/android/android_context_vk_impeller.cc(68)] Using the Impeller rendering backend (Vulkan).
Debug service listening on ws://127.0.0.1:54252/NPWC8Xd0lQs=/ws
F/        ( 8452): ASurfaceControl not found
F/libc    ( 8452): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 8473 (Binder:8452_2), pid 8452 (xample.test)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'Xiaomi/gauguininpro/gauguininpro:10/QKQ1.200628.002/V12.0.6.0.QJSINXM:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2024-09-28 13:19:00+0530
pid: 8452, tid: 8473, name: Binder:8452_2  >>> com.example.test <<<
uid: 10292
signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr --------
Abort message: 'ASurfaceControl not found'
    x0  0000000000000000  x1  0000000000002119  x2  0000000000000006  x3  000000704e629fe0
    x4  0000008000000000  x5  0000008000000000  x6  0000008000000000  x7  0000000080000000
    x8  00000000000000f0  x9  812e8237834b2e47  x10 0000000000000001  x11 0000000000000000
    x12 fffffff0fffffbdf  x13 0000000000000020  x14 ffffffffffffffff  x15 00004a7e6f3f85f3
    x16 00000071362048c0  x17 00000071361e0a50  x18 000000704e284000  x19 0000000000002104
    x20 0000000000002119  x21 00000000ffffffff  x22 0000007042190cb8  x23 000000704e62a7e0
    x24 00000070a2179040  x25 0000000000000000  x26 000000702972d380  x27 0000000000000000
    x28 0000000000000000  x29 000000704e62a080
    sp  000000704e629fc0  lr  00000071361920c4  pc  00000071361920f0
backtrace:
      #00 pc 00000000000830f0  /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: efe7913e9debfe2df8d421d91957bb90)
      #01 pc 0000000000008a14  /system/lib64/liblog.so (__android_log_assert+328) (BuildId: 1bac0e45e976db77074a6f84e94123a7)
      #02 pc 000000000001684c  /system/lib64/libandroid.so (ASurfaceTransactionStats_getPreviousReleaseFenceFd+276) (BuildId: 73389f93b4bf4a9c56c711a8980e8f25)
      #03 pc 0000000000b93128  /data/app/com.example.test-vS-Ec_9Mq0xv6iClXL9cKA==/lib/arm64/libflutter.so!libflutter.so (offset 0x823000) (BuildId: e5b34fb9d94053c1ffa3738426367d59f0ce61e2)
      #04 pc 0000000000000002  <unknown>
Lost connection to device.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.26.0-1.0.pre.15, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[!] Xcode - develop for iOS and macOS (Xcode 15.3)
    ! CocoaPods 1.12.1 out of date (1.13.0 is recommended).
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      To update CocoaPods, see https://guides.cocoapods.org/using/getting-started.html#updating-cocoapods
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] Android Studio (version 2024.1)
[✓] IntelliJ IDEA Community Edition (version 2022.3)
[✓] VS Code (version 1.91.1)
[✓] Connected device (4 available)
[✓] Network resources

! Doctor found issues in 1 category.

Activity

  1. jonahwilliams commented on Sep 28, 2024

    @jonahwilliams
    Contributor

    What kind of device is this running on? ASurfaceControl was added in API 29 (Android 10).

    I guess at this point nothing in Android will surprise me, but the version checks we ready have should really be sufficient

  2. iLoveDocs commented on Sep 28, 2024

    @iLoveDocs
    Author

    @jonahwilliams

    The issue is happening on all devices running Android 10. I tested this app on Xiaomi Mi 10i.

    but the version checks we ready have should really be sufficient

    Sorry I didn't quite get that. Is there already a fix that I am missing?

    I am seeing this crash in my production app, the app goes blank on those devices and Google Play Console reports the same error:
    Screenshot 2024-09-28 at 10 44 16 PM
    Screenshot 2024-09-28 at 10 43 51 PM
    Screenshot 2024-09-28 at 10 43 43 PM
    Screenshot 2024-09-28 at 10 41 50 PM

  3. jonahwilliams commented on Sep 28, 2024

    @jonahwilliams
    Contributor

    What I mean is that according to the Android documentation ( https://developer.android.com/ndk/reference/group/native-activity#asurfacetransactionstats_getpreviousreleasefencefd ) an Android 10 device must support these functions. We'll have to follow up with Android folks to see if we either misinterpreted the documentation or if there are known devices that shipped incomplete 29 support.

    EDIT: fixed method.

  4. added
    in triagePresently being triaged by the triage team
    on Sep 30, 2024
  5. huycozy commented on Sep 30, 2024

    @huycozy
    Member

    Hi @iLoveDocs, I don't have an Android 10 physical device so I can't check this issue on my end in profile mode (I don't see it on Android 10 emulator in debug mode).

    Here are some questions, can you help to check these?

  6. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Sep 30, 2024
  7. iLoveDocs commented on Oct 1, 2024

    @iLoveDocs
    Author

    @huycozy

    1. No, this issue is not happening on Flutter stable 3.24.3
    2. I didn't enable/disable Impeller myself so not sure about it. I think it's enabled by default.
  8. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 1, 2024
  9. iLoveDocs commented on Oct 1, 2024

    @iLoveDocs
    Author

    On Flutter stable 3.24.3, even when I run the app using flutter run --enable-impeller --profile, the app doesn’t crash. So, I’m not sure what changes in the later releases are causing the app to crash on Android 10 devices.

  10. jonahwilliams commented on Oct 1, 2024

    @jonahwilliams
    Contributor

    Like I mentioned before, the cause is the usage of these new APIs that seem to be malfunctioning on your devices. The current state is like I mentioned already, I need to follow up with Android folks to determine if there were devices shipped with incomplete 29 suppprt

  11. huycozy commented on Oct 2, 2024

    @huycozy
    Member

    Keeping this issue open for further information. Per Google Play Console reports above, this seems to occur on other devices as well, marking this as an OS-specific issue on Android 10, API 29.

  12. added
    c: regressionIt was better in the past than it is now
    c: crashStack traces logged to the console
    engineflutter/engine related. See also e: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Oct 2, 2024
  13. 4 remaining items

  14. changed the title [-]App crashes on Android 10 with the abort message: 'ASurfaceControl not found'.[/-] [+][Impeller] ASurfaceTransactionStats_getPreviousReleaseFenceFd missing from certain API 29 devices.[/+] on Oct 3, 2024
  15. jonahwilliams commented on Oct 4, 2024

    @jonahwilliams
    Contributor

    From more investigation, the API is there but we're getting a null surface transaction stats.

  16. deleted a comment from venky9885 on Oct 5, 2024
  17. changed the title [-][Impeller] ASurfaceTransactionStats_getPreviousReleaseFenceFd missing from certain API 29 devices.[/-] [+][Impeller] ASurfaceTransactionStats_getPreviousReleaseFenceFd crashing mysteriously on some API 29 devices.[/+] on Oct 7, 2024
  18. self-assigned this
    on Oct 7, 2024
  19. added
    P1High-priority issues at the top of the work list
    on Oct 7, 2024
  20. jonahwilliams commented on Oct 7, 2024

    @jonahwilliams
    Contributor

    @iLoveDocs before I completely disable SurfaceControl on all of these devices permanently, can you check out master channel and verify that the crashes are still occuring?

  21. iLoveDocs commented on Oct 8, 2024

    @iLoveDocs
    Author

    @jonahwilliams I'm sorry, but I’m out of town and won’t be able to check it at the moment. But thanks for fixing the issue quickly.

  22. github-actions commented on Oct 22, 2024

    @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.

  23. locked as resolved and limited conversation to collaborators on Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: crashStack traces logged to the consolec: regressionIt was better in the past than it is nowe: OS-version specificAffects only some versions of the relevant operating systeme: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.needs repro infoAutomated crash report whose cause isn't yet knownteam-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