Skip to content

vamos: give each instance its own temp volume dir - #3

Merged
MBeijer merged 1 commit into
AmigaPorts:mainfrom
codewiz:temp-volume-mkdtemp
Aug 22, 2026
Merged

vamos: give each instance its own temp volume dir#3
MBeijer merged 1 commit into
AmigaPorts:mainfrom
codewiz:temp-volume-mkdtemp

Conversation

@codewiz

@codewiz codewiz commented Aug 21, 2026

Copy link
Copy Markdown

Temp volumes used the configured path directly and removed it recursively on exit, so concurrent vamos instances raced on the shared ~/.vamos/volumes/ram: one instance's teardown deleted the volume under the others, and startups died with 'error creating temp dir ... path setup failed!'.

This showed up while running the m68k-amigaos gcc testsuite with -j24 and vamos as the DejaGnu simulator: ~90 of 24k tests failed spuriously, differing from run to run. With this fix (mount a mkdtemp dir below the configured path; remove the base only when its last user exits) 20 parallel instances on the default config produce zero errors, and the tally became reproducible.

Also fixes dead code in _create_temp: an early return hid the not-a-directory check.

Files inside the volume are per-instance now, which is the right semantic for a scratch volume - nothing shared is lost. The unit tests (including path_volume_temp_test's 'gone after shutdown' expectation) pass unchanged.

Temp volumes used the configured path directly and removed it
recursively on exit, so concurrent vamos instances raced on the
shared ~/.vamos/volumes/ram: one instance's teardown deleted the
volume under the others, and startups failed with 'error creating
temp dir'.

Mount a mkdtemp dir below the configured path instead, and remove
the base only when empty.

Also fixes dead code in _create_temp: an early return hid the
not-a-directory check.
@codewiz
codewiz force-pushed the temp-volume-mkdtemp branch from 9da7404 to cca7023 Compare August 21, 2026 18:16
@MBeijer
MBeijer merged commit 9692fb8 into AmigaPorts:main Aug 22, 2026
10 checks passed
@codewiz
codewiz deleted the temp-volume-mkdtemp branch August 23, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants