Repository: flutter
Issue: The Vulkan spec states: If imageView is not VK_NULL_HANDLE, imageView must be a valid VkImageView 
Labels: c: crash,engine,P2,needs repro info,team-engine,triaged-engine

### Steps to reproduce

Not sure about why it happened.

### Expected results

App should crash

### Actual results

When tired to host-restart got the error which can be seen in the log and app crashed. 

### Code sample

<details open><summary>Code sample</summary>

```dart
[Paste your code here]
```

</details>


### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>

[Upload media here]

</details>


### Logs

<details open><summary>Logs</summary>

```console
Performing hot restart...
Syncing files to device vivo 1907...
E/flutter (29839): [ERROR:flutter/impeller/base/validation.cc(59)] Break on 'ImpellerValidationBreak' to inspect point of failure: 
E/flutter (29839): --- Vulkan Debug Report  ----------------------------------------
E/flutter (29839): |                Severity: Error
E/flutter (29839): |                    Type: { Validation }
E/flutter (29839): |                 ID Name: VUID-vkDestroyImageView-imageView-parameter
E/flutter (29839): |               ID Number: -534740842
E/flutter (29839): |       Queue Breadcrumbs: [NONE]
E/flutter (29839): |  CMD Buffer Breadcrumbs: [NONE]
E/flutter (29839): |         Related Objects: Instance [12970367411871542960] [UNNAMED]
E/flutter (29839): |                 Trigger: Validation Error: [ VUID-vkDestroyImageView-imageView-parameter ] Object 0: handle = 0xb4000070eee7eeb0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xe0208096 | vkDestroyImageView(): imageView Invalid VkImageView Object 0x22ef00000022ef. The Vulkan spec states: If imageView is not VK_NULL_HANDLE, imageView must be a valid VkImageView handle (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkDestroyImageView-imageView-parameter)
E/flutter (29839): -----------------------------------------------------------------
E/flutter (29839): [ERROR:flutter/impeller/base/validation.cc(59)] Break on 'ImpellerValidationBreak' to inspect point of failure: 
E/flutter (29839): --- Vulkan Debug Report  ----------------------------------------
E/flutter (29839): |                Severity: Error
E/flutter (29839): |                    Type: { Validation }
E/flutter (29839): |                 ID Name: UNASSIGNED-Threading-Info
E/flutter (29839): |               ID Number: 1567320034
E/flutter (29839): |       Queue Breadcrumbs: [NONE]
E/flutter (29839): |  CMD Buffer Breadcrumbs: [NONE]
E/flutter (29839): |         Related Objects: ImageView [9832932487209711] [UNNAMED]
E/flutter (29839): |                 Trigger: Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x22ef00000022ef, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x5d6b67e2 | vkDestroyImageView():  Couldn't find VkImageView Object 0x22ef00000022ef. This should not happen and may indicate a bug in the application.
E/flutter (29839): -----------------------------------------------------------------
E/flutter (29839): [ERROR:flutter/impeller/base/validation.cc(59)] Break on 'ImpellerValidationBreak' to inspect point of failure: 
E/flutter (29839): --- Vulkan Debug Report  ----------------------------------------
E/flutter (29839): |                Severity: Error
E/flutter (29839): |                    Type: { Validation }
E/flutter (29839): |                 ID Name: UNASSIGNED-Threading-Info
E/flutter (29839): |               ID Number: 1567320034
E/flutter (29839): |       Queue Breadcrumbs: [NONE]
E/flutter (29839): |  CMD Buffer Breadcrumbs: [NONE]
E/flutter (29839): |         Related Objects: ImageView [9832932487209711] [UNNAMED]
E/flutter (29839): |                 Trigger: Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x22ef00000022ef, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x5d6b67e2 | vkDestroyImageView():  Couldn't find VkImageView Object 0x22ef00000022ef. This should not happen and may indicate a bug in the application.
E/flutter (29839): -----------------------------------------------------------------
E/flutter (29839): [ERROR:flutter/impeller/base/validation.cc(59)] Break on 'ImpellerValidationBreak' to inspect point of failure: 
E/flutter (29839): --- Vulkan Debug Report  ----------------------------------------
E/flutter (29839): |                Severity: Error
E/flutter (29839): |                    Type: { Validation }
E/flutter (29839): |                 ID Name: VUID-vkDestroyImageView-imageView-parameter
E/flutter (29839): |               ID Number: -534740842
E/flutter (29839): |       Queue Breadcrumbs: [NONE]
E/flutter (29839): |  CMD Buffer Breadcrumbs: [NONE]
E/flutter (29839): |         Related Objects: Instance [12970367411871542960] [UNNAMED]
E/flutter (29839): |                 Trigger: Validation Error: [ VUID-vkDestroyImageView-imageView-parameter ] Object 0: handle = 0xb4000070eee7eeb0, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0xe0208096 | vkDestroyImageView(): imageView Invalid VkImageView Object 0x22ed00000022ed. The Vulkan spec states: If imageView is not VK_NULL_HANDLE, imageView must be a valid VkImageView handle (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkDestroyImageView-imageView-parameter)
E/flutter (29839): -----------------------------------------------------------------
E/flutter (29839): [ERROR:flutter/impeller/base/validation.cc(59)] Break on 'ImpellerValidationBreak' to inspect point of failure: 
E/flutter (29839): --- Vulkan Debug Report  ----------------------------------------
E/flutter (29839): |                Severity: Error
E/flutter (29839): |                    Type: { Validation }
E/flutter (29839): |                 ID Name: UNASSIGNED-Threading-Info
E/flutter (29839): |               ID Number: 1567320034
E/flutter (29839): |       Queue Breadcrumbs: [NONE]
E/flutter (29839): |  CMD Buffer Breadcrumbs: [NONE]
E/flutter (29839): |         Related Objects: ImageView [9830733463954157] [UNNAMED]
E/flutter (29839): |                 Trigger: Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x22ed00000022ed, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x5d6b67e2 | vkDestroyImageView():  Couldn't find VkImageView Object 0x22ed00000022ed. This should not happen and may indicate a bug in the application.
E/flutter (29839): -----------------------------------------------------------------
E/flutter (29839): [ERROR:flutter/impeller/base/validation.cc(59)] Break on 'ImpellerValidationBreak' to inspect point of failure: 
E/flutter (29839): --- Vulkan Debug Report  ----------------------------------------
E/flutter (29839): |                Severity: Error
E/flutter (29839): |                    Type: { Validation }
E/flutter (29839): |                 ID Name: UNASSIGNED-Threading-Info
E/flutter (29839): |               ID Number: 1567320034
E/flutter (29839): |       Queue Breadcrumbs: [NONE]
E/flutter (29839): |  CMD Buffer Breadcrumbs: [NONE]
E/flutter (29839): |         Related Objects: ImageView [9830733463954157] [UNNAMED]
E/flutter (29839): |                 Trigger: Validation Error: [ UNASSIGNED-Threading-Info ] Object 0: handle = 0x22ed00000022ed, type = VK_OBJECT_TYPE_IMAGE_VIEW; | MessageID = 0x5d6b67e2 | vkDestroyImageView():  Couldn't find VkImageView Object 0x22ed00000022ed. This should not happen and may indicate a bug in the application.
E/flutter (29839): -----------------------------------------------------------------
F/libc    (29839): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 30075 (DartWorker), pid 29839 (MyTrailPals.dev)
Restarted application in 4,909ms.
Softversion: PD1913F_EX_A_9.72.28
Time: 2024-07-03 12:11:42
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'vivo/1907/1907:12/SP1A.210812.003/compiler03091510:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2024-07-03 12:11:40.891010294+0530
Process uptime: 0s
Cmdline: com.mytrailpals.MyTrailPals.dev
pid: 29839, tid: 30075, name: DartWorker  >>> com.mytrailpals.MyTrailPals.dev <<<
uid: 10487
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
    x0  0000000000000018  x1  0022ea00000022ea  x2  0000000000000000  x3  0000010dfd85ad88
    x4  0000000000000000  x5  0000000000000000  x6  0000000000000000  x7  0000000000000000
    x8  0000000000000000  x9  0000000000000000  x10 b40000718ede6d88  x11 0000000000000000
    x12 0000000000000018  x13 000000006684f2a4  x14 001c4f6f193381b6  x15 000035e2c589e669
    x16 0000000000000001  x17 00000072a5261c78  x18 0000006f24cb2000  x19 b40000718ede6d60
    x20 b400006fe58403c8  x21 0000006f80e21410  x22 b40000714ee4e668  x23 0000006f82bf16b8
    x24 b40000712ed9e560  x25 0000006f82c3a61c  x26 0000006f8300df58  x27 00000000004c4b40
    x28 0000006f830ab000  x29 00000000000003e8
    lr  0000006f82bd31dc  sp  0000006f40cfae30  pc  0000000000000000  pst 0000000060001000
backtrace:
      #00 pc 0000000000000000  <unknown>
      #01 pc 000000000212c1d8  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #02 pc 00000000020fe8c0  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #03 pc 00000000020fe874  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #04 pc 00000000020fe840  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #05 pc 00000000020fe778  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #06 pc 00000000020fe8dc  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #07 pc 00000000020fe69c  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #08 pc 0000000001ce5948  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #09 pc 0000000002121874  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #10 pc 0000000001ce5948  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #11 pc 00000000020e77c4  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #12 pc 00000000020e77dc  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #13 pc 0000000001d715a4  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #14 pc 0000000001d714f4  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #15 pc 0000000001d715fc  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #16 pc 0000000002161e9c  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #17 pc 0000000002161eb4  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #18 pc 00000000024f0e8c  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #19 pc 00000000021faf74  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #20 pc 00000000021fc380  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #21 pc 00000000024f51c4  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #22 pc 000000000221da58  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #23 pc 0000000002314724  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #24 pc 0000000002314974  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #25 pc 00000000022a7d14  /data/app/~~uaE3gMGQZOmR1H1jYyeYag==/com.mytrailpals.MyTrailPals.dev-5p9j0hsMI4divZg8nOt1Mw==/base.apk!libflutter.so (BuildId: a9324a6da717dbf69a263f8b556567657f362c2f)
      #26 pc 00000000000b3900  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+312) (BuildId: 3cf600896578484f9ee24df4f1e36b7d)
      #27 pc 0000000000051a20  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 3cf600896578484f9ee24df4f1e36b7d)
Lost connection to device.

```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

```console
[!] Flutter (Channel beta, 3.22.0-0.3.pre, on Microsoft Windows [Version
    10.0.22631.3737], locale en-IN)
    • Flutter version 3.22.0-0.3.pre on channel beta at C:\Users\harsh\fvm\default
    ! Warning: `flutter` on your path resolves to
      C:\Users\harsh\fvm\versions\beta\bin\flutter, which is not inside your current
      Flutter SDK checkout at C:\Users\harsh\fvm\default. Consider adding
      C:\Users\harsh\fvm\default\bin to the front of your path.
    ! Warning: `dart` on your path resolves to
      C:\Users\harsh\fvm\versions\beta\bin\dart, which is not inside your current
      Flutter SDK checkout at C:\Users\harsh\fvm\default. Consider adding
      C:\Users\harsh\fvm\default\bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 87b652410d (2 months ago), 2024-04-23 21:41:18 -0500
    • Engine revision b4bfd45986
    • Dart version 3.4.0 (build 3.4.0-282.3.beta)
    • DevTools version 2.34.3
    • If those were intentional, you can disregard the above warnings; however it is
      recommended to use "git" directly to perform update checks and upgrades.

[✓] Windows Version (Installed version of Windows is version 10 or higher)

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\harsh\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)
    • All Android licenses accepted.

[!] Android Studio (version 2022.1)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    ✗ Unable to determine bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Android Studio (version 2023.1)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-b2043.56-10550314)

[✓] IntelliJ IDEA Community Edition (version 2023.2)
    • IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.2.1
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.90.2)
    • VS Code at C:\Users\harsh\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.56.0

[✓] Connected device (1 available)
    • vivo 1907 (mobile) • 8TBYBE6H7H55USFE • android-arm64 • Android 12 (API 31)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.
```

</details>