Aseprite seems to hang when run in parallel

I am not necessarily asking for a fix, but wanted to simply share this problem, in case someone maybe has an insight into what could be causing this, or how to work around it.

For a project I’m working on, I export 100 or so layers from a set of multiple Aseprite files by invoking Aseprite for each layer on all the files at the same time.

Because that takes a while, doing that one by one, I used GNU parallel to parallelise these calls. When I was doing that, I regularly saw my script hang, waiting for Aseprite to complete. When I check with ps, I can see several Aseprite processes hanging, with no CPU usage, and crash handlers running for each of them.

Telling parallel to only use one job (-j1) fixes the problem, but then I am back at slow speed again :). The more jobs I run in parallel, the higher the chance is that I end up with a hung shell. At 4 jobs it’s almost certain.

This is on MacOS, Aseprite 1.3.17.2-arm64

I’m happy to investigate further if someone has suggestions on what to look for/at.

More detailed info:

The command I run is something like:

"$ASEPRITE" -b \
    --layer "$layer" \
    --frame-range 0,11 “npc/1. Idle.aseprite” \
    --frame-range 0,17 “npc/2. Walk.aseprite” \
    --frame-range 0,23 “npc/3. Run.aseprite” \
    --frame-range 0,29 “npc/8. SwordAttack.aseprite” \
    --frame-range 0,11 “npc/10. Damage.aseprite” \
    --frame-range 0,11 “npc/11. Death.aseprite” \
    --sheet-type horizontal \
    --sheet “$tempfile” \
    --data “/dev/null”

When the shell script hangs, I can generally see one or more processes like:

501 22252 1 0 11:25p.m. ?? 0:00.01 /Applications/Aseprite.app/Contents/MacOS/aseprite_crashpad_handler --no-rate-limit --database=/Users/mgjv/Library/Application Support/Aseprite/crashdb --metrics-dir=/Users/mgjv/Library/Application Support/Aseprite/crashdb --url=https://o952035.ingest.sentry.io:443/api/5901269/minidump/?sentry_client=sentry.native/0.10.0&sentry_key=c5ddc970388d4c0a94db6e5d50d384ed --attachment=/Users/mgjv/Library/Application Support/Aseprite/crashdb/1cb972d1-f4f0-4044-7c44-7168bc9584bc.run/__sentry-event --attachment=/Users/mgjv/Library/Application Support/Aseprite/crashdb/1cb972d1-f4f0-4044-7c44-7168bc9584bc.run/__sentry-breadcrumb1 --attachment=/Users/mgjv/Library/Application Support/Aseprite/crashdb/1cb972d1-f4f0-4044-7c44-7168bc9584bc.run/__sentry-breadcrumb2 --handshake-fd=5

as well as the original Aseprite process:

501 22223 22218 0 11:25p.m. ttys003 0:00.08 /Applications/Aseprite.app/Contents/MacOS/aseprite -b --layer Hair/Josh/Black --frame-range 0,11 npc/1. Idle.aseprite --frame-range 0,17 npc/2. Walk.aseprite --frame-range 0,23 npc/3. Run.aseprite --frame-range 0,29 npc/8. SwordAttack.aseprite --frame-range 0,11 npc/10. Damage.aseprite --frame-range 0,11 npc/11. Death.aseprite --sheet-type horizontal --sheet tmp/Hair-Josh-Black.png --data /dev/null