JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.9k stars 5.49k forks source link

Segmentation fault for sparse with incorrect size provided #9525

Closed karanveerm closed 9 years ago

karanveerm commented 9 years ago

I get a seg fault when I try to construct a sparse matrix with the incorrect size provided as shown below:

A = sparse([1; 2; 3], [1; 2; 5], 1.0, 3, 3)

signal (11): Segmentation fault: 11
sparse at sparse/csparse.jl:73
sparse at sparse/sparsematrix.jl:291
jlcall_sparse;19942 at  (unknown line)
jl_apply at /Users/vagrant/buildbot/slave/package_osx10_9/build/src/gf.c:1418
jl_apply at /Users/vagrant/buildbot/slave/package_osx10_9/build/src/interpreter.c:59
eval at /Users/vagrant/buildbot/slave/package_osx10_9/build/src/interpreter.c:207
eval at /Users/vagrant/buildbot/slave/package_osx10_9/build/src/interpreter.c:215
eval_body at /Users/vagrant/buildbot/slave/package_osx10_9/build/src/interpreter.c:543
jl_interpret_toplevel_thunk_with at /Users/vagrant/buildbot/slave/package_osx10_9/build/src/interpreter.c:571
jl_toplevel_eval_flex at /Users/vagrant/buildbot/slave/package_osx10_9/build/src/toplevel.c:453
jl_f_top_eval at /Users/vagrant/buildbot/slave/package_osx10_9/build/src/builtins.c:399
eval_user_input at REPL.jl:53
jlcall_eval_user_input;19940 at  (unknown line)
jl_apply at /Users/vagrant/buildbot/slave/package_osx10_9/build/src/gf.c:1418
anonymous at task.jl:95
jl_apply at /Users/vagrant/buildbot/slave/package_osx10_9/build/src/task.c:427
julia_trampoline at /Users/vagrant/buildbot/slave/package_osx10_9/build/src/init.c:1007
Segmentation fault: 11

I'm on Julia 0.3.3 on OS X.

julia> versioninfo()
Julia Version 0.3.3
Commit b24213b* (2014-11-23 20:19 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin13.3.0)
  CPU: Intel(R) Core(TM) i7-4650U CPU @ 1.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
tkelman commented 9 years ago

also kind of odd that the c parts of the backtraces have absolute paths from the buildbot machine @staticfloat

staticfloat commented 9 years ago

I'm not sure how to fix that. That's pretty normal; when baking in debugging info, absolute paths from the build machine are usually all the information you have.

tkelman commented 9 years ago

Fair enough, I've seen this kind of thing elsewhere too, but it's always a bit confusing.

staticfloat commented 9 years ago

At least it doesn't say /Users/sabae/julia/.... anymore. ;)

tkelman commented 9 years ago

that would at least be shorter

nalimilan commented 9 years ago

Isn't there any way of removing the path to the build directory, only keeping the end of the path?