App crash while pasting an image from clipboard

Testing version: Version 1.0 (922)

What were you doing: Pasting (Command + V) an image that I had copied from Slack (right click “Copy Image”) into a Panda doc

What feature did you use: The editor?

What happened: The app crashed and an Apple error report window showed up. Reopening the app and the specific document i was in did not have the image in it. i.e. the paste action did not succeed

What did you expect to happen: The image should successfully paste into the document where it can then be manipulated. Obviously the app shouldn’t crash.

Here is the first sections of the text that shows up in the Apple error report window that shows up after the app crash … (i hit the 32 000 character limit for posts)

Process: Panda [79709]
Path: /Applications/Panda.app/Contents/MacOS/Panda
Identifier: net.shinyfrog.panda
Version: 1.0 (922)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Panda [79709]
User ID: 502

Date/Time: 2020-11-18 11:36:14.416 -0500
OS Version: Mac OS X 10.15.7 (19H15)
Report Version: 12
Bridge OS Version: 3.0 (14Y908)
Anonymous UUID: 68EBC698-4CD5-401A-A569-F3B9D9183C76

Time Awake Since Boot: 450000 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [79709]

Application Specific Information:
Crashing on exception: NSMutableRLEArray objectAtIndex:effectiveRange:: Out of bounds

Application Specific Backtrace 1:
0 CoreFoundation 0x00007fff3648cb57 __exceptionPreprocess + 250
1 libobjc.A.dylib 0x00007fff6f13f5bf objc_exception_throw + 48
2 Foundation 0x00007fff38ab7c36 blockForLocation + 0
3 Foundation 0x00007fff38ad058e -[NSAttributedString attribute:atIndex:effectiveRange:] + 33
4 Foundation 0x00007fff38ab86e3 -[NSAttributedString attribute:atIndex:longestEffectiveRange:inRange:] + 155
5 MDTextKit 0x00000001012e3b1a -[MDLayoutManager(Drawing) drawInlineCodeBackgroundForGlyphRange:atPoint:] + 410
6 MDTextKit 0x00000001012c77b3 -[MDLayoutManager drawBackgroundForGlyphRange:atPoint:] + 194
7 AppKit 0x00007fff3385296b -[NSTextView drawRect:] + 1509
8 Panda 0x00000001010575f5 Panda + 54773
9 AppKit 0x00007fff3380c59f _NSViewDrawRect + 139
10 AppKit 0x00007fff3380b8ae -[NSView(NSInternal) _recursive:displayRectIgnoringOpacity:inContext:stopAtLayerBackedViews:] + 2170
11 AppKit 0x00007fff3380acaa -[NSView(NSLayerKitGlue) drawViewBackingLayer:inContext:drawingHandler:] + 1271
12 QuartzCore 0x00007fff41f0586d CABackingStoreUpdate
+ 595
13 QuartzCore 0x00007fff41f654ad ___ZN2CA5Layer8display_Ev_block_invoke + 53
14 QuartzCore 0x00007fff41f04d86 -[CALayer _display] + 2103
15 AppKit 0x00007fff3380a69a -[_NSBackingLayer display] + 537
16 AppKit 0x00007fff3376c187 -[_NSViewBackingLayer display] + 800
17 QuartzCore 0x00007fff41f03e09 _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 757
18 QuartzCore 0x00007fff41ee2106 _ZN2CA7Context18commit_transactionEPNS_11TransactionEd + 334
19 QuartzCore 0x00007fff41ee0cf0 _ZN2CA11Transaction6commitEv + 644
20 AppKit 0x00007fff33820da1 __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 266
21 AppKit 0x00007fff33f40080 ___NSRunLoopObserverCreateWithHandler_block_invoke + 41
22 CoreFoundation 0x00007fff36410335 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
23 CoreFoundation 0x00007fff36410267 __CFRunLoopDoObservers + 457
24 CoreFoundation 0x00007fff3640f805 __CFRunLoopRun + 874
25 CoreFoundation 0x00007fff3640ee3e CFRunLoopRunSpecific + 462
26 HIToolbox 0x00007fff3503babd RunCurrentEventLoopInMode + 292
27 HIToolbox 0x00007fff3503b6f4 ReceiveNextEventCommon + 359
28 HIToolbox 0x00007fff3503b579 _BlockUntilNextEventMatchingListInModeWithFilter + 64
29 AppKit 0x00007fff33681039 _DPSNextEvent + 883
30 AppKit 0x00007fff3367f880 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
31 AppKit 0x00007fff3367158e -[NSApplication run] + 658
32 AppKit 0x00007fff33643396 NSApplicationMain + 777
33 Panda 0x000000010104ef8e Panda + 20366
34 libdyld.dylib 0x00007fff702e7cc9 start + 1

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.AppKit 0x00007fff33a63373 -[NSApplication _crashOnException:] + 106
1 com.apple.AppKit 0x00007fff33820fbc __62+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayLink]_block_invoke + 805
2 com.apple.AppKit 0x00007fff33f40080 ___NSRunLoopObserverCreateWithHandler_block_invoke + 41
3 com.apple.CoreFoundation 0x00007fff36410335 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23
4 com.apple.CoreFoundation 0x00007fff36410267 __CFRunLoopDoObservers + 457
5 com.apple.CoreFoundation 0x00007fff3640f805 __CFRunLoopRun + 874
6 com.apple.CoreFoundation 0x00007fff3640ee3e CFRunLoopRunSpecific + 462
7 com.apple.HIToolbox 0x00007fff3503babd RunCurrentEventLoopInMode + 292
8 com.apple.HIToolbox 0x00007fff3503b6f4 ReceiveNextEventCommon + 359
9 com.apple.HIToolbox 0x00007fff3503b579 _BlockUntilNextEventMatchingListInModeWithFilter + 64
10 com.apple.AppKit 0x00007fff33681039 _DPSNextEvent + 883
11 com.apple.AppKit 0x00007fff3367f880 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
12 com.apple.AppKit 0x00007fff3367158e -[NSApplication run] + 658
13 com.apple.AppKit 0x00007fff33643396 NSApplicationMain + 777
14 net.shinyfrog.panda 0x000000010104ef8e 0x10104a000 + 20366
15 libdyld.dylib 0x00007fff702e7cc9 start + 1

Thread 1:
0 libsystem_kernel.dylib 0x00007fff70428dfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff70429170 mach_msg + 60
2 net.shinyfrog.panda 0x00000001010a70da 0x10104a000 + 381146
3 libsystem_pthread.dylib 0x00007fff704ec109 _pthread_start + 148
4 libsystem_pthread.dylib 0x00007fff704e7b8b thread_start + 15

Thread 2:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x00007fff70428dfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff70429170 mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff36410ef5 __CFRunLoopServiceMachPort + 247
3 com.apple.CoreFoundation 0x00007fff3640f9c2 __CFRunLoopRun + 1319
4 com.apple.CoreFoundation 0x00007fff3640ee3e CFRunLoopRunSpecific + 462
5 com.apple.AppKit 0x00007fff33822954 _NSEventThread + 132
6 libsystem_pthread.dylib 0x00007fff704ec109 _pthread_start + 148
7 libsystem_pthread.dylib 0x00007fff704e7b8b thread_start + 15

Thread 3:: com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x00007fff70428dfa mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff70429170 mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff36410ef5 __CFRunLoopServiceMachPort + 247
3 com.apple.CoreFoundation 0x00007fff3640f9c2 __CFRunLoopRun + 1319
4 com.apple.CoreFoundation 0x00007fff3640ee3e CFRunLoopRunSpecific + 462
5 com.apple.CFNetwork 0x00007fff34c46e32 0x7fff34bfc000 + 306738
6 com.apple.Foundation 0x00007fff38aa27a2 NSThread__start + 1064
7 libsystem_pthread.dylib 0x00007fff704ec109 _pthread_start + 148
8 libsystem_pthread.dylib 0x00007fff704e7b8b thread_start + 15

Thread 4:
0 libsystem_pthread.dylib 0x00007fff704e7b68 start_wqthread + 0

Thread 5:
0 libsystem_pthread.dylib 0x00007fff704e7b68 start_wqthread + 0

Thread 6:
0 libsystem_pthread.dylib 0x00007fff704e7b68 start_wqthread + 0

Thread 7:
0 libsystem_pthread.dylib 0x00007fff704e7b68 start_wqthread + 0

Thread 8:
0 libsystem_pthread.dylib 0x00007fff704e7b68 start_wqthread + 0

Thread 9:
0 libsystem_pthread.dylib 0x00007fff704e7b68 start_wqthread + 0

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x00007faf191e8200 rbx: 0x000060000185e430 rcx: 0x7ad679254205001e rdx: 0x0000000000000101
rdi: 0x00007ffeeebb3f10 rsi: 0x0000000000000df6 rbp: 0x00007ffeeebb4380 rsp: 0x00007ffeeebb4370
r8: 0x0000000000000c00 r9: 0x00007faf191e8ff6 r10: 0x00000000000001f6 r11: 0x00007ffeeebb3dfc
r12: 0x00007faf19009078 r13: 0x0000000000000002 r14: 0x00007fff6f132800 r15: 0x000060000275fe80
rip: 0x00007fff33a63373 rfl: 0x0000000000010202 cr2: 0x00000001013297e1

Logical CPU: 0
Error Code: 0x00000000
Trap Number: 6

External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 4705
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 13946086
thread_create: 0
thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=751.9M resident=0K(0%) swapped_out_or_unallocated=751.9M(100%)
Writable regions: Total=809.0M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=809.0M(100%)

                            VIRTUAL   REGION 

REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Accelerate framework 640K 5
Activity Tracing 256K 1
CG backing stores 4232K 5
CG image 1068K 17
CG raster data 120K 15
CoreAnimation 132.0M 75
CoreGraphics 8K 1
CoreImage 128K 15
CoreUI image data 1564K 16
Foundation 224K 3
Image IO 1176K 2
Kernel Alloc Once 8K 1
MALLOC 272.6M 118
MALLOC guard page 48K 10
MALLOC_NANO (reserved) 384.0M 1 reserved VM address space (unallocated)
SQLite page cache 64K 1
STACK GUARD 56.0M 10
Stack 12.6M 10
VM_ALLOCATE 1416K 32
__DATA 49.5M 463
__DATA_CONST 277K 18
__FONT_DATA 4K 1
__LINKEDIT 390.0M 25
__OBJC_RO 32.3M 1
__OBJC_RW 1908K 2
__TEXT 361.9M 455
__UNICODE 564K 1
libnetwork 128K 8
mapped file 302.5M 127
shared memory 664K 21
=========== ======= =======
TOTAL 2.0G 1460
TOTAL, minus reserved VM space 1.6G 1460

Model: MacBookPro14,3, BootROM 428.0.0.0.0, 4 processors, Quad-Core Intel Core i7, 2.8 GHz, 16 GB, SMC 2.45f4
Graphics: kHW_IntelHDGraphics630Item, Intel HD Graphics 630, spdisplays_builtin
Graphics: kHW_AMDRadeonPro560Item, Radeon Pro 560, spdisplays_pcie_device, 4 GB
Memory Module: BANK 0/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x80AD, 0x483943434E4E4E434C47414C41522D4E5644
Memory Module: BANK 1/DIMM0, 8 GB, LPDDR3, 2133 MHz, 0x80AD, 0x483943434E4E4E434C47414C41522D4E5644
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x173), Broadcom BCM43xx 1.0 (7.77.111.1 AirPortDriverBrcmNIC-1615.2)
Bluetooth: Version 7.0.6f7, 3 services, 27 devices, 1 incoming serial ports
Network Service: Thunderbolt Ethernet Slot 1, Ethernet, en7
Network Service: Wi-Fi, AirPort, en0
PCI Card: pci1b73,1100, sppci_usbxhci, Thunderbolt@197,0,0
PCI Card: pci1b73,1100, sppci_usbxhci, Thunderbolt@196,0,0
PCI Card: pci1b21,1242, sppci_usbxhci, Thunderbolt@195,0,0
PCI Card: ethernet, sppci_ethernet, Thunderbolt@194,0,0
USB Device: USB 3.0 Bus
USB Device: Plantronics BT600
USB Device: Apple T1 Controller
USB Device: USB 3.0 Bus
USB Device: CalDigit Thunderbolt 3 Audio
USB Device: USB 3.0 Bus
USB Device: Card Reader
USB Device: EagleEye Mini Camera
USB Device: USB 3.1 Bus
Thunderbolt Bus: MacBook Pro, Apple Inc., 41.4
Thunderbolt Bus: MacBook Pro, Apple Inc., 41.4
Thunderbolt Device: TS3 Plus, CalDigit, Inc., 3, 35.1