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

tempname ignores parent argument when environment variable TMPDIR is set #38873

Closed
vchuravy opened this issue Dec 14, 2020 · 4 comments
Closed

Comments

@vchuravy
Copy link
Member

compiler/validation                (31) |        started at 2020-12-14T10:40:17.674           
compiler/validation                (31) |     2.18 |   0.09 |  4.2 |      56.87 |   303.75
file                               (31) |        started at 2020-12-14T10:40:20.769                                                                                                                                  
file                               (31) |         failed at 2020-12-14T10:40:42.395
Test Failed at /nobackup/users/vchuravy/dev/julia/test/file.jl:72
  Expression: dirname(t) == d
   Evaluated: "/tmp" == "/tmp/jl_b8KtOh"

I tried isolating it, but I have not yet reproduced it outside the tests themselves. Running file tests on it's own succeeds as well, but running make testall this is always reproducible.

@vchuravy vchuravy added the system:powerpc PowerPC label Dec 14, 2020
@vchuravy vchuravy changed the title [PPC] Spurious failure in file.jl [PPC] Failure in file.jl when running tests under Slurm Dec 14, 2020
@vchuravy
Copy link
Member Author

The unaccounted for variable was running the tests under slurm vs on their own.

@vchuravy vchuravy removed the system:powerpc PowerPC label Dec 14, 2020
@vchuravy
Copy link
Member Author

julia> ENV["TMPDIR"]
"/tmp"

julia> unsafe_string(ccall(:tempnam, Cstring, (Cstring, Cstring), "/nobackup", "jl_"))
"/tmp/jlUwwz4t"

and in the docs for tempnam

/* Generate a unique temporary filename using up to five characters of PFX
   if it is not NULL.  The directory to put this file in is searched for
   as follows: First the environment variable "TMPDIR" is checked.
   If it contains the name of a writable directory, that directory is used.
   If not and if DIR is not NULL, that value is checked.  If that fails,
   P_tmpdir is tried and finally "/tmp".  The storage for the filename
   is allocated by `malloc'.  */

@vchuravy vchuravy changed the title [PPC] Failure in file.jl when running tests under Slurm tempname ignores parent argument when environment variable TMPDIR is set Dec 14, 2020
@StefanKarpinski
Copy link
Member

Seems like when parent is passed, we should ignore TMPDIR.

@KristofferC
Copy link
Member

Dup of #35785.

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

No branches or pull requests

3 participants