# Photoshop crashes with extension running

**URL:** <https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451>\
**Category:** UXP Plugin API\
**Created:** [August 5, 2021, 9:22am UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451 "2021-08-05T09:22:49Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![AAverin](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/aaverin/32/1368_2.png) [@AAverin](https://forums.creativeclouddeveloper.com/u/AAverin)\
**Post date:** [August 5, 2021, 9:22am UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/1 "2021-08-05T09:22:49Z")

</div>

Having my extension installed in running, Photoshop crashes after some time of use.  
Is there a way to find what could be causing the problem?

I can post other threads from the log if necessary.

```auto
Process: Adobe Photoshop 2021 [27978]
Path: /Applications/Adobe Photoshop 2021/Adobe Photoshop 2021.app/Contents/MacOS/Adobe Photoshop 2021
Identifier: com.adobe.Photoshop
Version: 22.4.3 (22.4.3)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Adobe Photoshop 2021 [27978]
User ID: 501
Date/Time: 2021-08-05 09:59:20.975 +0100
OS Version: macOS 11.4 (20F71)
Report Version: 12
Bridge OS Version: 5.4 (18P4663)
Anonymous UUID: AC36F74B-FF1A-4134-AFB3-5B95AB7EBE00
Sleep/Wake UUID: 7390FB04-1EC6-41FB-A8AD-0A6115A3141B
Time Awake Since Boot: 110000 seconds
Time Since Wake: 2300 seconds
System Integrity Protection: enabled
Crashed Thread: 10 Third Party - UXP JavaScript 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 [27978]
Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff205f32ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff205f362c mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff20721b5f __CFRunLoopServiceMachPort + 316
3 com.apple.CoreFoundation 0x00007fff2072023f __CFRunLoopRun + 1328
4 com.apple.CoreFoundation 0x00007fff2071f64c CFRunLoopRunSpecific + 563
5 com.apple.HIToolbox 0x00007fff2895dab3 RunCurrentEventLoopInMode + 292
6 com.apple.HIToolbox 0x00007fff2895d815 ReceiveNextEventCommon + 587
7 com.apple.HIToolbox 0x00007fff2895d5b3 _BlockUntilNextEventMatchingListInModeWithFilter + 70
8 com.apple.AppKit 0x00007fff22f206f2 _DPSNextEvent + 864
9 com.apple.AppKit 0x00007fff22f1eec5 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1364
10 com.adobe.Photoshop 0x000000011185dc62 0x10e87f000 + 50195554
11 com.apple.AppKit 0x00007fff22f11239 -[NSApplication run] + 586
12 com.adobe.Photoshop 0x000000011185f022 0x10e87f000 + 50200610
13 com.adobe.Photoshop 0x0000000111861580 0x10e87f000 + 50210176
14 com.adobe.Photoshop 0x000000011195e0ec 0x10e87f000 + 51245292
15 com.adobe.Photoshop 0x000000011140a068 0x10e87f000 + 45658216
16 com.adobe.Photoshop 0x000000010e884809 0x10e87f000 + 22537
17 libdyld.dylib 0x00007fff20643f5d start + 1

Thread 10 Crashed:: Third Party - UXP JavaScript Thread
0 com.adobe.uxp.macos.alpaca.v8 0x0000000121e11762 0x121209000 + 12617570
1 com.adobe.uxp.macos.alpaca.v8 0x0000000121e0cf40 0x121209000 + 12599104
2 com.adobe.uxp.macos.alpaca.v8 0x0000000121e245f1 0x121209000 + 12695025
3 com.adobe.uxp.macos.alpaca.v8 0x0000000121fdfd15 0x121209000 + 14511381
4 com.adobe.uxp.macos.alpaca.v8 0x0000000121fe2c55 0x121209000 + 14523477
5 com.adobe.uxp.macos.alpaca.v8 0x0000000121fdf8c4 0x121209000 + 14510276
6 com.adobe.uxp.macos.alpaca.v8 0x0000000121fdce57 0x121209000 + 14499415
7 com.adobe.uxp.macos.alpaca.v8 0x0000000122070f9f 0x121209000 + 15105951
8 com.adobe.uxp.macos.alpaca.v8 0x0000000121e19081 0x121209000 + 12648577
9 com.adobe.uxp.macos.alpaca.v8 0x00000001214cd728 0x121209000 + 2901800
10 com.adobe.uxp.macos.alpaca.v8 0x0000000121495874 0x121209000 + 2672756
11 com.adobe.uxp.macos.alpaca.v8 0x00000001212be873 0x121209000 + 743539
12 com.adobe.uxp.macos.alpaca.v8 0x00000001212c797b 0x121209000 + 780667
13 com.adobe.uxp.macos.alpaca.v8 0x00000001212c2a46 0x121209000 + 760390
14 com.adobe.uxp.macos.alpaca.v8 0x00000001212c20f1 0x121209000 + 758001
15 com.adobe.uxp.macos.alpaca.v8 0x00000001212c59ce 0x121209000 + 772558
16 libsystem_pthread.dylib 0x00007fff206288fc _pthread_start + 224
17 libsystem_pthread.dylib 0x00007fff20624443 thread_start + 15
Thread 11:: First Party - UXP JavaScript Thread
0 libsystem_kernel.dylib 0x00007fff205f5cde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20628e49 _pthread_cond_wait + 1298
2 libc++.1.dylib 0x00007fff20591e03 std:: __1::condition_variable::__ do_timed_wait(std:: __1::unique_lock<std::__ 1::mutex>&, std:: __1::chrono::time_point<std::__ 1::chrono::system_clock, std:: __1::chrono::duration<long long, std::__ 1::ratio<1l, 1000000000l> > >) + 93
3 com.adobe.uxp.macos.alpaca.v8 0x00000001212d63db 0x121209000 + 840667
4 com.adobe.uxp.macos.alpaca.v8 0x00000001212c2996 0x121209000 + 760214
5 com.adobe.uxp.macos.alpaca.v8 0x00000001212c20f1 0x121209000 + 758001
6 com.adobe.uxp.macos.alpaca.v8 0x00000001212c59ce 0x121209000 + 772558
7 libsystem_pthread.dylib 0x00007fff206288fc _pthread_start + 224
8 libsystem_pthread.dylib 0x00007fff20624443 thread_start + 15

```

---

<div class="post-metadata">

**Author:** ![Pierre\_G](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pierre_g/32/971_2.png) [@Pierre\_G](https://forums.creativeclouddeveloper.com/u/Pierre_G)\
**Post date:** [August 5, 2021, 9:59am UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/2 "2021-08-05T09:59:41Z")

</div>

Hey, have you tried to use the DevTools, console and debugger, usually these two are quite efficient to track down bugs…

---

<div class="post-metadata">

**Author:** ![AAverin](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/aaverin/32/1368_2.png) [@AAverin](https://forums.creativeclouddeveloper.com/u/AAverin)\
**Post date:** [August 5, 2021, 10:14am UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/3 "2021-08-05T10:14:07Z")

</div>

Yes, there is nothing in the logs that could indicate a problem.  
I also can’t reliably reproduce this, crash seems to happen somewhat randomly, but consistently. It doesn’t seem to be related to me using the plugin actively.

---

<div class="post-metadata">

**Author:** ![Pierre\_G](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pierre_g/32/971_2.png) [@Pierre\_G](https://forums.creativeclouddeveloper.com/u/Pierre_G)\
**Post date:** [August 5, 2021, 10:35am UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/4 "2021-08-05T10:35:16Z")

</div>

If you leave PS idling, will it crash eventually?

---

<div class="post-metadata">

**Author:** ![AAverin](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/aaverin/32/1368_2.png) [@AAverin](https://forums.creativeclouddeveloper.com/u/AAverin)\
**Post date:** [August 5, 2021, 10:56am UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/5 "2021-08-05T10:56:44Z")

</div>

Not sure, issue doesn’t reproduce every time and is difficult to catch.

---

<div class="post-metadata">

**Author:** ![Pierre\_G](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pierre_g/32/971_2.png) [@Pierre\_G](https://forums.creativeclouddeveloper.com/u/Pierre_G)\
**Post date:** [August 5, 2021, 11:04am UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/6 "2021-08-05T11:04:55Z")

</div>

Do you listen to events in your plugin, or manipulate file(s) ?

---

<div class="post-metadata">

**Author:** ![AAverin](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/aaverin/32/1368_2.png) [@AAverin](https://forums.creativeclouddeveloper.com/u/AAverin)\
**Post date:** [August 5, 2021, 11:36am UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/7 "2021-08-05T11:36:34Z")

</div>

No, I don’t listen to any events or do anything with files.

---

<div class="post-metadata">

**Author:** ![Pierre\_G](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pierre_g/32/971_2.png) [@Pierre\_G](https://forums.creativeclouddeveloper.com/u/Pierre_G)\
**Post date:** [August 5, 2021, 11:38am UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/8 "2021-08-05T11:38:34Z")

</div>

Ok, maybe you could try to split your code to isolate the crashing section?

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [August 5, 2021, 11:40am UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/9 "2021-08-05T11:40:25Z")

</div>

> [@AAverin](#):
>
> ```auto
> 2 com.apple.CoreFoundation 0x00007fff20721b5f __CFRunLoopServiceMachPort + 316
> 3 com.apple.CoreFoundation 0x00007fff2072023f __CFRunLoopRun + 1328
> 4 com.apple.CoreFoundation 0x00007fff2071f64c CFRunLoopRunSpecific + 563
> 
> ```

There’s definitely an infinite loop  
So it’s either:

- Ps causes a loop in some situations depending on the plugin actions
- Plugin itself causes some loop and Ps doesn’t handle such behaviour (why would it 🤔)

Got hint from [this thread](https://developer.apple.com/forums/thread/124633)

---

<div class="post-metadata">

**Author:** ![AAverin](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/aaverin/32/1368_2.png) [@AAverin](https://forums.creativeclouddeveloper.com/u/AAverin)\
**Post date:** [August 5, 2021, 12:09pm UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/10 "2021-08-05T12:09:20Z")

</div>

I am quite certain my plugin doesn’t cause any loops because there is debug logging everywhere and I would see a loop in logs then.

If it’s PS causing it internally it would be great to learn which actions that I call result in such PS behavior and why.

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [August 5, 2021, 12:43pm UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/11 "2021-08-05T12:43:47Z")

</div>

OK, maybe not definitely then 😅 But I’m pretty sure it’s the loop that causes the crash 🙂

---

<div class="post-metadata">

**Author:** ![kerrishotts](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kerrishotts/32/8_2.png) [@kerrishotts](https://forums.creativeclouddeveloper.com/u/kerrishotts)\
**Post date:** [August 6, 2021, 12:42am UTC](https://forums.creativeclouddeveloper.com/t/photoshop-crashes-with-extension-running/3451/12 "2021-08-06T00:42:48Z")

</div>

If you want to DM me your plugin, I can try to repro on my machine.
