Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path operations are not threadsafe on Windows #1436

Open
lefth opened this issue Jan 23, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@lefth
Copy link

commented Jan 23, 2018

I wrote a script which does many parallel file operations, and noticed that printing a IO::Path object's relative path would sometimes give an incorrect result, but the basename (and .Str) would still be correct.

The following test script demonstrates the problem. Two tests are run repeatedly, usually succeeding, but often failing. I am comparing the path's basename with the manual basename which is computed by looking at the relative path and removing everything up to "/" or "". The test fails when the relative path is incorrect. Example output is:

ok 1 -
ok 2 -
not ok 3 -
ok 4 -
# Failed test at testcase.p6 line 87
# expected: '0111'
#      got: '0999'
File path is C:\Projects\Testcase\files\40009\20032\0999 (relative: files\40001\20006\10002\0111)
...

A second failure mode is when a relative path is given as "." instead of an actual file path:

# Failed test at testcase.p6 line 87
# expected: '.'
#      got: '0999'
File path is C:\Projects\Testcase\files\40009\20032\0999 (relative: .)

The test case is: https://gist.github.com/lefth/8fefc16fa6de74a6c94ea21e84fbe461

Operating system: Windows 10
Rakudo version 2017.12 built on MoarVM version 2017.12-8-g3c1cea5cf

I cannot reproduce on Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.