Segfault on BLAS operation with incorrect character input

question

#1

Hi all,

I’m getting the following segfault by directly calling a BLAS routine, but using the wrong character to indicate the type of operation. I’m on julia v0.6, but don’t have a v0.7 install on which to test this. Should I file it as an issue, or is this expected when calling BLAS routines directly?

m = randn(4, 2)
v = randn(2)
Base.LinAlg.BLAS.gemv('n', 1.0, m, v)

results in:

signal (11): Segmentation fault
while loading no file, in expression starting on line 0
jl_gc_pool_alloc at /home/centos/buildbot/slave/package_tarball64/build/src/gc.c:928
jl_gc_alloc_ at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:249 [inlined]
jl_gc_alloc at /home/centos/buildbot/slave/package_tarball64/build/src/gc.c:2129
_new_array_ at /home/centos/buildbot/slave/package_tarball64/build/src/array.c:96 [inlined]
_new_array at /home/centos/buildbot/slave/package_tarball64/build/src/array.c:149 [inlined]
jl_alloc_array_1d at /home/centos/buildbot/slave/package_tarball64/build/src/array.c:372
jl_f__expr at /home/centos/buildbot/slave/package_tarball64/build/src/builtins.c:876
eval_user_input at ./REPL.jl:69
unknown function (ip: 0x7f36a48f81cf)
jl_call_fptr_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1933
macro expansion at ./REPL.jl:97 [inlined]
#1 at ./event.jl:73
unknown function (ip: 0x7f368825934f)
jl_call_fptr_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:339 [inlined]
jl_call_method_internal at /home/centos/buildbot/slave/package_tarball64/build/src/julia_internal.h:358 [inlined]
jl_apply_generic at /home/centos/buildbot/slave/package_tarball64/build/src/gf.c:1933
jl_apply at /home/centos/buildbot/slave/package_tarball64/build/src/julia.h:1424 [inlined]
start_task at /home/centos/buildbot/slave/package_tarball64/build/src/task.c:267
unknown function (ip: 0xffffffffffffffff)
Allocations: 1799132 (Pool: 1797705; Big: 1427); GC: 1
Segmentation fault (core dumped)

Note that Base.LinAlg.BLAS.gemv('N', 1.0, m, v) works just fine.

Cheers,

Colin


#2

I get the same segfault on a 12-day old master.
Perhaps something could be added to the dimension mismatch checks that are already there?


#3

There’s no harm in opening an issue.


#4

Yes, an additional else clause might do it. Although that would only help for gemv, ie wouldn’t be universal. I’ve opened an issue as I’m probably out of my depth in coming up with a universal solution.

Cheers,

Colin


#5

Done!