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

fix _spawn_primitive to report error correctly #34716

Merged
merged 1 commit into from
Feb 12, 2020

Conversation

tanmaykm
Copy link
Member

Method _spawn_primitive in process.jl seems to be defining a local valiable that shadows the error method that it tries to use.
This renames the local variable to fix that.

Below are a few lines to simulate the condition.

Before:

julia> Base.rawhandle(s::String) = s

julia> Base._spawn_primitive("/tmp/xyx", `ls`, Any["abc"])
ERROR: UndefVarError: error not defined
Stacktrace:
 [1] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at ./process.jl:79
 [2] top-level scope at REPL[2]:1

With this fix:

julia> Base.rawhandle(s::String) = s

julia> Base._spawn_primitive("/tmp/xyx", `ls`, Any["abc"])
ERROR: invalid spawn handle abc from abc
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at ./process.jl:79
 [3] top-level scope at REPL[4]:1

Method `_spawn_primitive` in `process.jl` seems to be defining a local valiable that shadows the `error` method that it tries to use.
This renames the local variable to fix that.

Below are a few lines to simulate the condition.

Before:

```
julia> Base.rawhandle(s::String) = s

julia> Base._spawn_primitive("/tmp/xyx", `ls`, Any["abc"])
ERROR: UndefVarError: error not defined
Stacktrace:
 [1] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at ./process.jl:79
 [2] top-level scope at REPL[2]:1
```

With this fix:

```
julia> Base.rawhandle(s::String) = s

julia> Base._spawn_primitive("/tmp/xyx", `ls`, Any["abc"])
ERROR: invalid spawn handle abc from abc
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] _spawn_primitive(::String, ::Cmd, ::Array{Any,1}) at ./process.jl:79
 [3] top-level scope at REPL[4]:1
```
@KristofferC KristofferC added the kind:bugfix This change fixes an existing bug label Feb 10, 2020
@tanmaykm
Copy link
Member Author

Win32 test seem to have timed out (also it looks like all test cases in that did pass).
Maybe unrelated to this PR?

@JeffBezanson JeffBezanson merged commit 83fd1e8 into JuliaLang:master Feb 12, 2020
KristofferC pushed a commit that referenced this pull request Apr 11, 2020
Method `_spawn_primitive` in `process.jl` seems to be defining a local valiable that shadows the `error` method that it tries to use.
This renames the local variable to fix that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants