Photoshop crashes with extension running

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.

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

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

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.

If you leave PS idling, will it crash eventually?

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

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

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

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

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 :thinking:)

Got hint from this thread

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.

OK, maybe not definitely then :sweat_smile: But I’m pretty sure it’s the loop that causes the crash :slight_smile:

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