Using MKL, MKLSparse causes error

Hi,

I noticed that using MKL and MKLSparse together gives me an error. Here is
one example:

using MKL
using LinearAlgebra
using SparseArrays
using MKLSparse 
using BenchmarkTools

@show BLAS.get_config()
BLAS.set_num_threads(1)

n = 10^4 
m = 10^6 
r = 10 

A = sprand(n, n, m / n^2)
A = max.(A, A')
R = randn(n, r)

@btime $A * $R;

As mentioned by MKL.jl package, I loaded MKL first and BLAS.get_config()
gives BLAS.get_config() = LBTConfig([ILP64] libmkl_rt.so, [LP64] libmkl_rt.so).
Then this error pops up:

munmap_chunk(): invalid pointer

[363227] signal (6.-6): Aborted
in expression starting at /u/subspace_s4/huan1754/SDPLR-jl/exps/misc.jl:16
pthread_kill at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
raise at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7ff3f0c84675)
unknown function (ip: 0x7ff3f0c9bcfb)
unknown function (ip: 0x7ff3f0c9bfdb)
free at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
jl_gc_free_array at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gc.c:1202 [inlined]
sweep_malloced_arrays at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gc.c:1226 [inlined]
gc_sweep_other at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gc.c:1507 [inlined]
_jl_gc_collect at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gc.c:3393
ijl_gc_collect at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gc.c:3538
gc at ./gcutils.jl:129 [inlined]
gc at ./gcutils.jl:129 [inlined]
gcscrub at /homes/huan1754/.julia/packages/BenchmarkTools/QNsku/src/execution.jl:5 [inlined]
#_lineartrial#53 at /homes/huan1754/.julia/packages/BenchmarkTools/QNsku/src/execution.jl:188
_lineartrial at /homes/huan1754/.julia/packages/BenchmarkTools/QNsku/src/execution.jl:182
unknown function (ip: 0x7ff3d9c77349)
_jl_invoke at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gf.c:2894 [inlined]
ijl_apply_generic at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gf.c:3076
jl_apply at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
jl_f__call_latest at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/builtins.c:812
#invokelatest#2 at ./essentials.jl:892 [inlined]
invokelatest at ./essentials.jl:889 [inlined]
#lineartrial#46 at /homes/huan1754/.julia/packages/BenchmarkTools/QNsku/src/execution.jl:51 [inlined]
lineartrial at /homes/huan1754/.julia/packages/BenchmarkTools/QNsku/src/execution.jl:50 [inlined]
#tune!#58 at /homes/huan1754/.julia/packages/BenchmarkTools/QNsku/src/execution.jl:300
tune! at /homes/huan1754/.julia/packages/BenchmarkTools/QNsku/src/execution.jl:289 [inlined]
tune! at /homes/huan1754/.julia/packages/BenchmarkTools/QNsku/src/execution.jl:289
unknown function (ip: 0x7ff3d9c76c45)
_jl_invoke at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gf.c:2894 [inlined]
ijl_apply_generic at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gf.c:3076
jl_apply at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
do_call at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/interpreter.c:126
eval_value at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/interpreter.c:223
eval_stmt_value at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/interpreter.c:174 [inlined]
eval_body at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/interpreter.c:617
jl_interpret_toplevel_thunk at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/interpreter.c:775
jl_toplevel_eval_flex at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/toplevel.c:934
jl_toplevel_eval_flex at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/toplevel.c:877
jl_toplevel_eval_flex at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/toplevel.c:877
ijl_toplevel_eval_in at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/toplevel.c:985
eval at ./boot.jl:385 [inlined]
include_string at ./loading.jl:2076
_jl_invoke at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gf.c:2894 [inlined]
ijl_apply_generic at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gf.c:3076
_include at ./loading.jl:2136
include at ./Base.jl:495
jfptr_include_46380.1 at /u/subspace_s4/software/julia-1.10.1/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gf.c:2894 [inlined]
ijl_apply_generic at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gf.c:3076
exec_options at ./client.jl:318
_start at ./client.jl:552
jfptr__start_82662.1 at /u/subspace_s4/software/julia-1.10.1/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gf.c:2894 [inlined]
ijl_apply_generic at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/gf.c:3076
jl_apply at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
true_main at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/jlapi.c:582
jl_repl_entrypoint at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/src/jlapi.c:731
main at /cache/build/default-maughin-0/julialang/julia-release-1-dot-10/cli/loader_exe.c:58
unknown function (ip: 0x7ff3f0c24d8f)
__libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x4010b8)
Allocations: 2096564 (Pool: 2094660; Big: 1904); GC: 3
Aborted

Any idea why?

Are you running out of memory?