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

Current version of ApproxFun.LowRankFun causes fatal error in 0.5.1, segfault in 0.6.0-pre.beta.9 and StackOverflowError in 0.6.0-pre.beta.50 #21309

Closed
ikirill opened this issue Apr 7, 2017 · 5 comments

Comments

@ikirill
Copy link

ikirill commented Apr 7, 2017

With a clean ~/.julia, and Pkg.add("ApproxFun") followed by Pkg.checkout("ApproxFun"), I get the following errors.

On

julia> versioninfo()
Julia Version 0.6.0-pre.beta.50
Commit d5d728024f (2017-04-06 20:20 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

I get:

julia> using ApproxFun
INFO: Recompiling stale cache file /Users/kirill/.julia/lib/v0.6/ApproxFun.ji for module ApproxFun.

julia> LowRankFun((x,y) -> x*y, 0.0..1.0, 0.0..1.0)
ERROR: StackOverflowError:
Stacktrace:
 [1] ApproxFun.LowRankFun(::Function, ::IntervalSets.ClosedInterval{Float64}, ::IntervalSets.ClosedInterval{Float64}) at /Users/kirill/.julia/v0.6/ApproxFun/src/Multivariate/LowRankFun.jl:184
 [2] #LowRankFun#194(::Array{Any,1}, ::Type{T} where T, ::Function, ::IntervalSets.ClosedInterval{Float64}, ::Vararg{IntervalSets.ClosedInterval{Float64},N} where N) at /Users/kirill/.julia/v0.6/ApproxFun/src/Multivariate/LowRankFun.jl:184
 [3] ApproxFun.LowRankFun(::Function, ::IntervalSets.ClosedInterval{Float64}, ::IntervalSets.ClosedInterval{Float64}) at /Users/kirill/.julia/v0.6/ApproxFun/src/Multivariate/LowRankFun.jl:184
 [4] #LowRankFun#194(::Array{Any,1}, ::Type{T} where T, ::Function, ::IntervalSets.ClosedInterval{Float64}, ::Vararg{IntervalSets.ClosedInterval{Float64},N} where N) at /Users/kirill/.julia/v0.6/ApproxFun/src/Multivariate/LowRankFun.jl:184
.....

(this repeats, 21373 lines in total, not posted)

On

julia> versioninfo()
Julia Version 0.6.0-pre.beta.9
Commit ceb06740e3 (2017-04-02 01:04 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

I get

julia> using ApproxFun
INFO: Precompiling module ApproxFun.

julia> LowRankFun((x,y) -> x*y, 0.0..1.0, 0.0..1.0)
Segmentation fault: 11

and with

julia> versioninfo()
Julia Version 0.5.1
Commit 6445c82 (2017-03-05 13:25 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

I get

julia> using ApproxFun

julia> LowRankFun((x,y) -> x*y, 0.0..1.0, 0.0..1.0)
fatal: error thrown and no exception handler available.
ErrorException("task switch not allowed from inside gc finalizer")
rec_backtrace at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/stackwalk.c:84
record_backtrace at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:233 [inlined]
jl_throw at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:551
jl_error at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/builtins.c:42
jl_switchto at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:397
yieldto at ./event.jl:136
jlcall_yieldto_23447 at /opt/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib (unknown line)
jl_call_method_internal at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia_internal.h:210 [inlined]
jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1950
wait at ./event.jl:169
task_done_hook at ./task.jl:191
unknown function (ip: 0x3227039e2)
jl_call_method_internal at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia_internal.h:210 [inlined]
jl_apply_generic at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/gf.c:1950
jl_apply at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/./julia.h:1392 [inlined]
finish_task at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:215 [inlined]
start_task at /Users/osx/buildbot/slave/package_osx10_9-x64/build/src/task.c:262

These errors seem to be internal to julia, so I'm submitting them here as a bug. If the bug is in the code, I would expect to throw a regular, non-fatal, exception, not crash. There is a similar bug here (#17003; yuyichao commented "Seems fixed"), but I really can't tell if it's the same thing, there is no "illegal instruction" here.

@JeffBezanson
Copy link
Member

In the first example, the StackOverflowError, is there any chance Julia's behavior is correct, i.e. there is actually a stack overflow in ApproxFun?

@ikirill
Copy link
Author

ikirill commented Apr 7, 2017

@JeffBezanson Oh I see, quite possibly. I'm working on 0.5.1 (the bottom one), so that's the thing I was thinking of when I wrote that.

@yuyichao
Copy link
Contributor

yuyichao commented Apr 7, 2017

If the stack overflow is expected than the crash would be a dup of #17280 . This is unrelated to #17003

@ikirill
Copy link
Author

ikirill commented Apr 7, 2017

@yuyichao I can't reproduce the segfault in #17280 with 0.5.1. Also, the problem for me is not the stack overflow itself, but the fatal error in 0.5.1 ("task switch not allowed from inside gc finalizer"). I guess it got fixed between 0.5.1 and 0.6.0-pre.beta.50?

@KristofferC
Copy link
Member

Please comment if this still happens.

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

4 participants