Is redirect_stderr broken?

julia> redirect_stdout()
(Base.PipeEndpoint(RawFD(21) open, 0 bytes waiting), Base.PipeEndpoint(RawFD(22) open, 0 bytes waiting))

julia> print("asd")

julia> redirect_stderr()
(Base.PipeEndpoint(RawFD(23) open, 0 bytes waiting), Base.PipeEndpoint(RawFD(24) open, 0 bytes waiting))

julia> error("asd")
ERROR: asd
Stacktrace:
 [1] error(::String) at ./error.jl:21

I also get a nasty segfault on 0.6 (I might not have the latest version) when calling it on remote workers:

julia> addprocs(1)
1-element Array{Int64,1}:
 2

julia> remotecall_fetch(redirect_stderr,2)
(
signal (11): Segmentation fault: 11

redirect_stderr on workers might not do what you want since the stderr is redirected already. I don’t see anything wrong with the single process one. You aren’t writting to STDERR anyway.

What’s the way to write to STDERR then ? It seems errors should go there.

I’m trying to capture both prints and errors on remote workers (for each worker independently).

The output you see comes from the REPL. The uncaught error printing will go to the STDERR in a script.