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

QScreenCapture crashes the application after a few seconds

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9
    • Multimedia
    • None
    • iOS/tvOS/watchOS
    • Multimedia, weeks 18-19

    Description

      Tested on FFmpeg backend on an iPad Air M2 running iPadOS 18.4.1.

      When running a basic QML application with only a ScreenCapture and a VideoOutput, the application crashes after a few seconds.

      The crash can be reproduced easily when using the QML manual test 'qml-screencapture-advanced' (https://codereview.qt-project.org/c/qt/qtmultimedia/+/648478).

      The console logs the following:

      CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      IOSurface creation failed: e00002bd parentID: 00000000 properties: {
          IOSurfaceAllocSize = 6242304;
          IOSurfaceBytesPerElement = 4;
          IOSurfaceBytesPerRow = 4064;
          IOSurfaceHeight = 1536;
          IOSurfaceName = UIKitCore;
          IOSurfacePixelFormat = 1111970369;
          IOSurfaceWidth = 1014;
      }
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceWidth
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceBytesPerElement
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfacePixelFormat
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceBytesPerRow
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceHeight
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceAllocSize
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceName
      CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      IOSurface creation failed: e00002bd parentID: 00000000 properties: {
          IOSurfaceAllocSize = 6242304;
          IOSurfaceBytesPerElement = 4;
          IOSurfaceBytesPerRow = 4064;
          IOSurfaceHeight = 1536;
          IOSurfaceName = UIKitCore;
          IOSurfacePixelFormat = 1111970369;
          IOSurfaceWidth = 1014;
      }
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceWidth
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceBytesPerElement
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfacePixelFormat
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceBytesPerRow
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceHeight
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceAllocSize
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceName
      CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      IOSurface creation failed: e00002bd parentID: 00000000 properties: {
          IOSurfaceAllocSize = 6242304;
          IOSurfaceBytesPerElement = 4;
          IOSurfaceBytesPerRow = 4064;
          IOSurfaceHeight = 1536;
          IOSurfaceName = UIKitCore;
          IOSurfacePixelFormat = 1111970369;
          IOSurfaceWidth = 1014;
      }
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceWidth
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceBytesPerElement
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfacePixelFormat
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceBytesPerRow
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceHeight
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceAllocSize
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceName
      CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      IOSurface creation failed: e00002bd parentID: 00000000 properties: {
          IOSurfaceAllocSize = 6242304;
          IOSurfaceBytesPerElement = 4;
          IOSurfaceBytesPerRow = 4064;
          IOSurfaceHeight = 1536;
          IOSurfaceName = UIKitCore;
          IOSurfacePixelFormat = 1111970369;
          IOSurfaceWidth = 1014;
      }
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceWidth
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceBytesPerElement
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfacePixelFormat
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceBytesPerRow
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceHeight
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceAllocSize
      IOSurface creation failed: e00002bd parentID: 00000000 property: IOSurfaceName
      CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextScaleCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextDrawImage: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable.
      QScreenCapture error string changed:
      QScreenCapture error changed: 0
      CGBitmapContextInfoCreate: unable to allocate 6242304 bytes for bitmap data
      *** Assertion failure in void _UIGraphicsBeginImageContextWithOptions(CGSize, BOOL, CGFloat, BOOL)(), UIGraphics.m:410
      *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={507, 768}, scale=2.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.'
      *** First throw call stack:
      (0x19e9192ec 0x19bda1a7c 0x19dc16040 0x1a120d348 0x100a32c04 0x1025d2e08 0x10212723c 0x10212b034 0x10212cf2c 0x10212cf04 0x10212cebc 0x10212ce38 0x10212cdd0 0x10237c718 0x102e7fd74 0x102e7e980 0x102e9d770 0x102e9c3a0 0x102e9c354 0x102e763a0 0x102df096c 0x102df03b4 0x102df0504 0x102579e18 0x102df0264 0x102df1088 0x1030a8b4c 0x1030b20c8 0x1030b3e9c 0x102e081ac 0x102e08410 0x102f83a58 0x10212c294 0x1030b1000 0x1030af034 0x1030aefbc 0x228ce3afc 0x228ce3a04)
      libc++abi: terminating due to uncaught exception of type NSException
      *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={507, 768}, scale=2.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.'
      *** First throw call stack:
      (0x19e9192ec 0x19bda1a7c 0x19dc16040 0x1a120d348 0x100a32c04 0x1025d2e08 0x10212723c 0x10212b034 0x10212cf2c 0x10212cf04 0x10212cebc 0x10212ce38 0x10212cdd0 0x10237c718 0x102e7fd74 0x102e7e980 0x102e9d770 0x102e9c3a0 0x102e9c354 0x102e763a0 0x102df096c 0x102df03b4 0x102df0504 0x102579e18 0x102df0264 0x102df1088 0x1030a8b4c 0x1030b20c8 0x1030b3e9c 0x102e081ac 0x102e08410 0x102f83a58 0x10212c294 0x1030b1000 0x1030af034 0x1030aefbc 0x228ce3afc 0x228ce3a04)
      terminating due to uncaught exception of type NSException
      Message from debugger: killed
      

      Attachments

        For Gerrit Dashboard: QTBUG-137245
        # Subject Branch Project Status CR V

        Activity

          People

            npskalerud Nils Petter Skålerud
            npskalerud Nils Petter Skålerud
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes