-
-
Notifications
You must be signed in to change notification settings - Fork 578
Description
When an appimage is run with --appimage-extract-and-run, the path is calculated as $TMPDIR/appimage_extracted_$MD5DIGEST. This usually works, but it seems there are problems when the same appimage is run in parallel. Likely there is a race condition where one appimage is still running while the other one is removing its files already.
It seems this happened to me in this CI run: https://github.com/lalten/rules_appimage/actions/runs/3085571024/jobs/4989010345 where I added a testing matrix. I think that caused the same appimage to be run in parallel and led to really weird errors.
I wonder if it makes sense to include the date or maybe even just the pid of the process into the tempdir name as well.
Relevant places in the runtime code:
Line 587 in 90704a0
| strcpy(temp_base, getenv("TMPDIR")); |
Lines 690 to 696 in 90704a0
| hexlified_digest = appimage_hexlify(digest.bytes, sizeof(digest.bytes)); | |
| } | |
| char* prefix = malloc(strlen(temp_base) + 20 + strlen(hexlified_digest) + 2); | |
| strcpy(prefix, temp_base); | |
| strcat(prefix, "/appimage_extracted_"); | |
| strcat(prefix, hexlified_digest); |