JuliaMath / Interpolations.jl

Fast, continuous interpolation of discrete datasets in Julia
http://juliamath.github.io/Interpolations.jl/
Other
536 stars 110 forks source link

Bizzare ReadOnlyMemoryError() causing segfaults with a quadratic bspline #187

Open dsweber2 opened 6 years ago

dsweber2 commented 6 years ago

I'm getting some weird intermittent ReadOnlyMemoryErrors using interpolate asinterpolate(complexVectorToInterpolate, BSpline(Quadratic(Reflect())), OnGrid()). It doesn't happen every time, but sometimes when it happens inside a function, julia suffers a segfault. I switched to interpolate(complexVectorToInterpolate, BSpline(Linear()), OnGrid()), and that doesn't seem to be having the same issues. I seem to have had some success if I run interpolate(randn(1532), BSpline(Quadratic(Reflect())), OnGrid()) immediately after using Interpolations, but this is most certainly a hack I'd rather not leave in.

The result from the segfault follows:

signal (11): Segmentation fault
while loading /home/dsweber/Dropbox/projects/scatteringTransform.jl/test.jl, in expression starting on line 90
dtrsm_kernel_RT_BOBCAT at /home/dsweber/.julia/juliav0.6.1/bin/../lib/julia/libopenblas64_.so (unknown line)
collect at ./array.jl:475
unknown function (ip: 0x7f58c2a9c7d2)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
index_gen at /home/dsweber/.julia/v0.6/Interpolations/src/b-splines/quadratic.jl:140
index_gen at /home/dsweber/.julia/v0.6/Interpolations/src/b-splines/quadratic.jl:137
getindex_impl at /home/dsweber/.julia/v0.6/Interpolations/src/b-splines/indexing.jl:32
unknown function (ip: 0x7f58c2a9ac92)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
getindex at /home/dsweber/.julia/v0.6/Interpolations/src/b-splines/indexing.jl:51
jl_call_staged at /buildworker/worker/package_linux64/build/src/method.c:263 [inlined]
jl_code_for_staged at /buildworker/worker/package_linux64/build/src/method.c:315
Type at ./inference.jl:285
typeinf_edge at ./inference.jl:2534
unknown function (ip: 0x7f59eb31879a)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call_gf_by_type at ./inference.jl:1420
unknown function (ip: 0x7f59eb3166c6)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call at ./inference.jl:1897
unknown function (ip: 0x7f59eb3127ce)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_eval_call at ./inference.jl:1927
abstract_eval at ./inference.jl:1950
unknown function (ip: 0x7f59eb30d816)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_interpret at ./inference.jl:2076
unknown function (ip: 0x7f59eb30de66)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
typeinf_work at ./inference.jl:2669
typeinf at ./inference.jl:2787
typeinf_edge at ./inference.jl:2535
unknown function (ip: 0x7f59eb31879a)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call_gf_by_type at ./inference.jl:1420
unknown function (ip: 0x7f59eb3166c6)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call at ./inference.jl:1897
unknown function (ip: 0x7f59eb3127ce)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_eval_call at ./inference.jl:1927
abstract_eval at ./inference.jl:1950
unknown function (ip: 0x7f59eb30d816)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_interpret at ./inference.jl:2076
unknown function (ip: 0x7f59eb30de66)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
typeinf_work at ./inference.jl:2669
typeinf at ./inference.jl:2787
typeinf_edge at ./inference.jl:2535
unknown function (ip: 0x7f59eb31879a)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call_gf_by_type at ./inference.jl:1420
unknown function (ip: 0x7f59eb3166c6)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call at ./inference.jl:1897
unknown function (ip: 0x7f59eb33817a)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_apply at ./inference.jl:1561
unknown function (ip: 0x7f59eb3346ce)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call at ./inference.jl:1689
unknown function (ip: 0x7f59eb3127ce)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_eval_call at ./inference.jl:1927
abstract_eval at ./inference.jl:1950
unknown function (ip: 0x7f59eb30d816)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_interpret at ./inference.jl:2076
unknown function (ip: 0x7f59eb30de66)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
typeinf_work at ./inference.jl:2669
typeinf at ./inference.jl:2787
typeinf_edge at ./inference.jl:2535
unknown function (ip: 0x7f59eb31879a)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call_gf_by_type at ./inference.jl:1420
unknown function (ip: 0x7f59eb3166c6)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call at ./inference.jl:1897
unknown function (ip: 0x7f59eb33817a)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_apply at ./inference.jl:1561
unknown function (ip: 0x7f59eb3346ce)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call at ./inference.jl:1689
unknown function (ip: 0x7f59eb3127ce)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_eval_call at ./inference.jl:1927
abstract_eval at ./inference.jl:1950
unknown function (ip: 0x7f59eb30d816)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
typeinf_work at ./inference.jl:2722
typeinf at ./inference.jl:2787
typeinf_edge at ./inference.jl:2535
unknown function (ip: 0x7f59eb31879a)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call_gf_by_type at ./inference.jl:1420
unknown function (ip: 0x7f59eb3166c6)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_call at ./inference.jl:1897
unknown function (ip: 0x7f59eb3127ce)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
abstract_eval_call at ./inference.jl:1927
abstract_eval at ./inference.jl:1950
unknown function (ip: 0x7f59eb30d816)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
typeinf_work at ./inference.jl:2722
typeinf at ./inference.jl:2787
typeinf_frame at ./inference.jl:2504
typeinf_code at ./inference.jl:2583
unknown function (ip: 0x7f59eb32918d)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
typeinf_ext at ./inference.jl:2622
unknown function (ip: 0x7f59eb3083b2)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1424 [inlined]
jl_apply_with_saved_exception_state at /buildworker/worker/package_linux64/build/src/rtutils.c:257
jl_type_infer at /buildworker/worker/package_linux64/build/src/gf.c:262
jl_compile_for_dispatch at /buildworker/worker/package_linux64/build/src/gf.c:1661
jl_compile_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:307 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:354 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
macro expansion at /home/dsweber/Dropbox/projects/scatteringTransform.jl/test.jl:101 [inlined]
anonymous at ./<missing> (unknown line)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:589
jl_parse_eval_all at /buildworker/worker/package_linux64/build/src/ast.c:873
include_string at ./loading.jl:522
include_string at /home/dsweber/.julia/v0.6/CodeTools/src/eval.jl:30
unknown function (ip: 0x7f59cc10a8a0)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
do_call at /buildworker/worker/package_linux64/build/src/interpreter.c:75
eval at /buildworker/worker/package_linux64/build/src/interpreter.c:242
jl_interpret_toplevel_expr at /buildworker/worker/package_linux64/build/src/interpreter.c:34
jl_toplevel_eval_flex at /buildworker/worker/package_linux64/build/src/toplevel.c:577
jl_toplevel_eval_in at /buildworker/worker/package_linux64/build/src/builtins.c:496
include_string at /home/dsweber/.julia/v0.6/CodeTools/src/eval.jl:34
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
#49 at /home/dsweber/.julia/v0.6/Atom/src/eval.jl:50
withpath at /home/dsweber/.julia/v0.6/CodeTools/src/utils.jl:30
unknown function (ip: 0x7f59cc185bd6)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
withpath at /home/dsweber/.julia/v0.6/Atom/src/eval.jl:38
unknown function (ip: 0x7f59cc185896)
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
macro expansion at /home/dsweber/.julia/v0.6/Atom/src/eval.jl:49 [inlined]
#48 at ./task.jl:80
jl_call_fptr_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /buildworker/worker/package_linux64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /buildworker/worker/package_linux64/build/src/gf.c:1926
jl_apply at /buildworker/worker/package_linux64/build/src/julia.h:1424 [inlined]
start_task at /buildworker/worker/package_linux64/build/src/task.c:267
unknown function (ip: 0xffffffffffffffff)
Allocations: 21967123 (Pool: 21963184; Big: 3939); GC: 51
timholy commented 6 years ago

This will be pretty hard to debug without a runnable test case.

What Julia version are you using? (versioninfo() please.) If it's 0.6.0, can you upgrade to 0.6.2? (I don't see it on the downloads page, but you can get it on release-0.6 if you build julia from source.)

dsweber2 commented 6 years ago

I'm aware, sorry about that. Trying to isolate it is difficult, as the function that is calling interpolations works fine in isolation, the problem happens inconsistently. I'm as much in need of some reason that it might be causing a ReadOnlyError() as anything else, so as to narrow down where the conflict might be occurring.

Also, I had a typo in the beginning-- switching to Linear() rather than Quadratic(Reflect()) made the crash stop.

I'm on version 0.6.1. I've also tried it on the master branch of interpolations as well, and it had the same result. I'll upgrade to 0.6.2 and see if there's still a ghost.

timholy commented 6 years ago

My lab had a bizarre ReadOnlyMemoryError (Gtk.jl-related, but only when logging in from certain machines) that disappeared when we upgraded to 0.6.2. Hope you experience the same.

Cody-G commented 6 years ago

I think I just hit this one too, I will see if I can get a reliable test case...

dsweber2 commented 6 years ago

@Cody-G what packages are you using? After a package I was using dropped its dependency on ArrayFire.jl, this problem went away, so I suspect that may have been it.

Cody-G commented 6 years ago

I'm using a custom image registration package that does not depend on ArrayFire.jl. But I did notice that I can avoid the error by reducing the number of julia processes. When I reduced the number from 12 to 8 the error went away, strange. There's no communication between workers; each is just handling an independent image from a big pool of images. So what does that have in common with ArrayFire? I'm not sure how ArrayFire works, but maybe it runs in its own thread/process?

dsweber2 commented 6 years ago

Interesting, ArrayFire is primarily a GPU computing resource which ArrayFire.jl calls. Reading through the documentation, it isn't clear whether they use multiple threads, though it's certainly plausible.