Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-138922

Consistent Qt caused crash when navigating with Jetpack Compose

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1: Critical P1: Critical
    • 6.8.5, 6.9.2, 6.9.3, 6.10.0 Beta3, 6.11.0 FF
    • 6.9.1
    • QPA: Android, Quick: 3D
    • Android
    • 8194e979f (dev), e205d6b2a (6.10), e893262b0 (6.9), b7f112c8d (tqtc/lts-6.8), 6f0d27d2e (6.9.2)

      Running into the following error when attempting to navigate within a Composable screen, or backing out from an Activity to another Activity:

      Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x8 in tid 13762 (qtMainLoopThrea), pid 13736 (le.quickcompose)
      fatalSignal11SIGSEGV.txt

       

      In all instances mentioned below, navigation is done with Jetpack's navigation library, and each instance of QtQuickView is displayed like this in code:

       

      If the factory has an XML layout inflated on it instead, the crash does not occur

       

      The crash can and will occur when:

      • User moves from starting activity to new activity, interacts with QtQuickView content and then returns to original activity
      • User interacts with QtQuickView, then navigates to another Composable screen inside same activity

       

      The crash never happens if QtQuickViews are not interacted with (Might crash with a different crash log inconsistently due to failed initialization of graphics backend for OpenGL, different bug)

       

      Steps to reproduce activity-to-activity crash:

      1. Open app
      2. Click "Pure Compose Example"
      3. Interact with the QtQuickView on the top of the page
      4. Back out using the Android back button
      5. EXPECTED: The previous screen is navigated to successfully
      6. ACTUAL: App crashes with Fatal Signal 11, code 1

      Steps to reproduce compose navigation caused crash:

      1. Open app
      2. Click "Pure Compose Example"
      3. Interact with the QtQuickView on the top of the page
      4. Click "Second screen"
      5. EXPECTED: Second composable screen opens
      6. ACTUAL: App crashes with Fatal Signal 11, code 1

       

      Full debug log from beginning to end of these steps:
      fullDebugStacktrace.txt

       

      Problem possibly related to Compose destroying Surfaces when they're not needed, and the Qt end not being designed to survive the constant destroying and recomposition since QtQuickView and Compose are not supported.

      Example video:

      example-video.mkv

      Example project:
      QTBUG-138922.7z
      (Note: replace QtBuild file directories in build.gradle with your local installations)

       

        1. fatalSignal11SIGSEGV.txt
          9 kB
          Tino Marttila
        2. fullDebugStacktrace.txt
          68 kB
          Tino Marttila
        3. image-2025-08-05-11-19-53-586.png
          11 kB
          Tino Marttila
        4. QTBUG-138922.7z
          91 kB
          Tino Marttila
        5. example-video.mkv
          5.25 MB
          Tino Marttila
        For Gerrit Dashboard: QTBUG-138922
        # Subject Branch Project Status CR V

            qtandroidteam Qt Android Team
            tinomarttila Tino Marttila
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: