cstjean / TraceCalls.jl

A debugging and profiling tool for Julia
Other
46 stars 4 forks source link

IJulia - SystemError: dup: Bad file descriptor #60

Open JobJob opened 6 years ago

JobJob commented 6 years ago

Great package!

This is just an FYI for others. This package doesn't work in IJulia, but will if https://github.com/JuliaLang/IJulia.jl/pull/641 gets merged.

The call that triggers the error is in ClobberingReload but I thought it's better posted here, since I'm guessing more people will encounter it from here as a starting point (like I did).

using TraceCalls, Calculus
@traceable f(x) = sin(x) + sqrt(x)
trace_derivative = @trace Calculus second_derivative(f, 1.0)
SystemError: dup: Bad file descriptor

Stacktrace:
 [1] #systemerror#44 at ./error.jl:64 [inlined]
 [2] systemerror(::String, ::Bool) at ./error.jl:64
 [3] dup(::RawFD, ::RawFD) at ./libc.jl:27
 [4] _redirect_stderr(::IOStream) at ./stream.jl:1023
 [5] _redirect_stderr at ~/.julia/v0.6/Compat/src/Compat.jl:18 [inlined]
 [6] redirect_stderr(::IOStream) at ./stream.jl:1028
 [7] (::ClobberingReload.##2#3{ClobberingReload.##4#5{TraceCalls.##68#69{TraceCalls.CodeUpdate}},NTuple{5,Regex}})(::String, ::IOStream) at ~/.julia/v0.6/ClobberingReload/src/scrub_stderr.jl:35
 [8] mktemp(::ClobberingReload.##2#3{ClobberingReload.##4#5{TraceCalls.##68#69{TraceCalls.CodeUpdate}},NTuple{5,Regex}}, ::String) at ./file.jl:376
 [9] scrub_stderr(::ClobberingReload.##4#5{TraceCalls.##68#69{TraceCalls.CodeUpdate}}, ::Regex, ::Vararg{Regex,N} where N) at ~/.julia/v0.6/ClobberingReload/src/scrub_stderr.jl:21
 [10] (::TraceCalls.RevertibleCodeUpdate)(::Function) at ~/.julia/v0.6/TraceCalls/src/code_update.jl:129
 [11] with_tracing_definitions(::TraceCalls.##113#114{##5#6}, ::Module) at ~/.julia/v0.6/TraceCalls/src/tracing.jl:188
 [12] trace(::Function, ::Module) at ~/.julia/v0.6/TraceCalls/src/tracing.jl:224
 [13] include_string(::String, ::String) at ./loading.jl:515
cstjean commented 6 years ago

Thank you for looking into it. I thought that I had gotten rid of the ClobberingReload dependency, but it looks like it's still around...