You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a reliable segfaultfailure that depends on a fairly bizarre combination of factors. It was noticed in JuliaImages/ImageFeatures.jl#32, and I've managed to boil it down to a reasonably simple test case that doesn't require any packages:
using Base.Test
struct Gray{T}
val::Tend
Base.convert{T}(::Type{Gray{T}}, x) =Gray(convert(T, x))
abstract type Normed endstruct N0f8 <:Normed
val::Intend
Base.convert(::Type{N0f8}, x::Int) =N0f8(x)
# This version shouldn't be called, but if we get rid of it, it doesn't crashfunctionimresize{T,N}(original::AbstractArray{T,N}, short_size::NTuple)
len_short =length(short_size)
new_size =ntuple(i -> (i > len_short ?size(original,i) : short_size[i]), N)
imresize(original, new_size)
endfunctionimresize{T,N}(original::AbstractArray{T,N}, new_size::NTuple{N})
copy!(similar(original), original)
end# The type constraints here might seem optional, but it doesn't crash without them.# Even getting rid of the Gray, changing it to# create_descriptor{T<:Normed}(img::AbstractArray{T, 2}# (and correspondingly modifying the array creation below) fails to trigger the crash.functioncreate_descriptor{T<:Normed}(img::AbstractArray{Gray{T}, 2}, yblocks::Integer, xblocks)
h, w =size(img)
y_padded =ceil(Int, h / (yblocks)) * yblocks
x_padded =ceil(Int, w / (xblocks)) * xblocks
@show (y_padded, x_padded)
# We have `x_padded == y_padded = 10`, but if you replace the# variables with (10, 10) then it doesn't crash
img_padded =imresize(img, (y_padded, x_padded))
end# This seems spurious, but it doesn't crash without it
img = [ 0x4c0x190xac0x2e0x8c0xcc0x960x4c0xdb0x4f0x010x750x650x570x590x240xe90x8e0x1f0xd30xb30x920xdd0xdb0x2e0xf20xcc0xc10xac0x970xc80x750xa80x380x6d0x770xc30xf40x630x150x7c0xdf0x540x110x0f0x030xea0x010x5e0xe60xa50x870x400x220xeb0x710xf70xba0xb20x6f0x9d0xa70x580x7e0xf80x0f0x910xd00x8e0x040x580xd30x8b0x5d0x6f0x8b0xaa0x770x530x460x9a0x740xd80x2f0x380x4e0x4b0x180x4a0xc70x1a0xe00x520x5a0x6a0x030xe80xcb0x950xfc
]
# If you comment out the `@testset` and `end` lines, the crash doesn't happen@testset"Descriptor"begin
img = Gray{N0f8}[ 0110110110011011011001101101100110110110011011011001101101100110110110011011011001101101100110110110 ]
descriptor =create_descriptor(img, 1, 1)
end
The output is
$ julia-0.6 crash_repro.jl
(y_padded, x_padded) = (10, 10)
signal (4): Illegal instruction
while loading /home/tim/.julia/v0.6/ImageFeatures/test/crash_repro.jl, in expression starting on line 54
macro expansion at /home/tim/.julia/v0.6/ImageFeatures/test/crash_repro.jl:66 [inlined]
macro expansion at ./test.jl:853 [inlined]
anonymous at ./<missing> (unknown line)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:326 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:345 [inlined]
jl_toplevel_eval_flex at /home/tim/src/julia-0.6/src/toplevel.c:589
jl_parse_eval_all at /home/tim/src/julia-0.6/src/ast.c:873
jl_load at /home/tim/src/julia-0.6/src/toplevel.c:616
include_from_node1 at ./loading.jl:539
unknown function(ip: 0x7fcdb1bd16db)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:326 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:345 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:2234
include at ./sysimg.jl:14
unknown function(ip: 0x7fcdb1a74feb)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:326 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:345 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:2234
process_options at ./client.jl:305
_start at ./client.jl:371
unknown function(ip: 0x7fcdb1bfec08)
jl_call_fptr_internal at /home/tim/src/julia-0.6/src/julia_internal.h:326 [inlined]
jl_call_method_internal at /home/tim/src/julia-0.6/src/julia_internal.h:345 [inlined]
jl_apply_generic at /home/tim/src/julia-0.6/src/gf.c:2234
jl_apply at /home/tim/src/julia-0.6/ui/../src/julia.h:1416 [inlined]
true_main at /home/tim/src/julia-0.6/ui/repl.c:127
main at /home/tim/src/julia-0.6/ui/repl.c:264
__libc_start_main at /build/glibc-9tT8Do/glibc-2.23/csu/../csu/libc-start.c:291
unknown function(ip: 0x401668)
Allocations: 1562748 (Pool: 1561339; Big: 1409); GC: 0
Note that it gets as far as executing the @show statement.
julia>versioninfo()
Julia Version 0.6.0-pre.beta.0
Commit bd84fa1 (2017-03-3112:58 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU:Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
WORD_SIZE:64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)
The text was updated successfully, but these errors were encountered:
This is a reliable
segfaultfailure that depends on a fairly bizarre combination of factors. It was noticed in JuliaImages/ImageFeatures.jl#32, and I've managed to boil it down to a reasonably simple test case that doesn't require any packages:The output is
Note that it gets as far as executing the
@show
statement.The text was updated successfully, but these errors were encountered: