XCPreviewAgent crashed with some SwiftUI View

The steps to reproduce this issue are a bit complicated.

In my app, previewing View A in Package P works fine, but another view in the same package fails to preview.

The error message is shown below. It seems that the memory used for the preview is interfering with the shared memory area.

This is reported as FB18519266

Exception Subtype: KERN_PROTECTION_FAILURE at 0x00000003402d8900
Exception Codes: 0x0000000000000002, 0x00000003402d8900
VM Region Info: 0x3402d8900 is in 0x3402c8000-0x340a18000;  bytes after start: 67840  bytes before end: 7599871
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      mapped file                 3401dc000-3402c8000    [  944K] r-x/rwx SM=COW  Object_id=57e4ac
--->  shared memory               3402c8000-340a18000    [ 7488K] rw-/rw- SM=SHM  
      mapped file                 340a18000-340f38000    [ 5248K] r-x/rwx SM=COW  Object_id=1dc9a049
Termination Reason: ****** 10 Bus error: 10
Terminating Process: exc handler [94787]

Hi,

Thank you for filing the feedback. It looks like you are exposing a bug, but we are having trouble reproducing this. Would you be able to attach your/a project to the feedback that you see this issue in?

XCPreviewAgent crashed with some SwiftUI View
 
 
Q