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

Setting, accessing empty environmental variables causes an error #11170

Closed
simonbyrne opened this issue May 6, 2015 · 2 comments
Closed

Setting, accessing empty environmental variables causes an error #11170

simonbyrne opened this issue May 6, 2015 · 2 comments
Labels
system:windows Affects only Windows

Comments

@simonbyrne
Copy link
Contributor

julia> ENV["R_DOC_DIR"] = ""
""

julia> ENV["R_DOC_DIR"]
ERROR: system error getenv: R_DOC_DIR 1-1 != 0: The wait operation timed out.
 in error at error.jl:21 (repeats 2 times)

julia> versioninfo()
Julia Version 0.3.8
Commit 79599ad (2015-04-30 23:40 UTC)
Platform Info:
  System: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Xeon(R) CPU E5-2660 0 @ 2.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
@simonbyrne simonbyrne added the system:windows Affects only Windows label May 6, 2015
@StefanKarpinski
Copy link
Member

Seems to be Windows-only (as indicated).

@tkelman
Copy link
Contributor

tkelman commented May 7, 2015

This ccall

ret=ccall(:GetEnvironmentVariableW,stdcall,UInt32,(Cwstring,Ptr{UInt16},UInt32),s,val,len)
returns 0 for an environment variable set to empty, but len there is 1 (only counting the terminating null). Ref https://msdn.microsoft.com/en-us/library/windows/desktop/ms683188%28v=vs.85%29.aspx

Maybe we change the error condition there to something like if (ret==0 && len!=1) || ret != len-1 || val[end] != 0 ?

tkelman added a commit that referenced this issue May 9, 2015
backporting note: need different syntax for this on release-0.3
vtjnash added a commit that referenced this issue May 11, 2015
Fix #11170, accessing empty env var on Windows
tkelman added a commit that referenced this issue May 11, 2015
backporting note: need different syntax for this on release-0.3
tkelman added a commit that referenced this issue May 14, 2015
(cherry picked from commit 2a86ef1)
ref PR #11210

Conflicts:
	base/env.jl
tkelman added a commit that referenced this issue May 14, 2015
backporting note: need different syntax for this on release-0.3

(cherry picked from commit bf784a5)

Conflicts:
	test/sysinfo.jl
mbauman pushed a commit to mbauman/julia that referenced this issue Jun 6, 2015
mbauman pushed a commit to mbauman/julia that referenced this issue Jun 6, 2015
backporting note: need different syntax for this on release-0.3
tkelman added a commit to tkelman/julia that referenced this issue Jun 6, 2015
tkelman added a commit to tkelman/julia that referenced this issue Jun 6, 2015
backporting note: need different syntax for this on release-0.3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:windows Affects only Windows
Projects
None yet
Development

No branches or pull requests

3 participants