[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:, :)=speye(
From: |
John W. Eaton |
Subject: |
Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:, :)=speye(1)" |
Date: |
Tue, 24 Oct 2006 10:05:22 -0400 |
On 24-Oct-2006, Rafael Laboissiere wrote:
| This works in my Debian etch system with octave2.9-2.9.9-3::
|
| octave2.9:1> speye (1);
| octave2.9:2> x = speye (1);
|
| But this don't:
|
| octave2.9:1> x (:, :) = speye (1);
| panic: Segmentation fault -- stopping myself...
| *** glibc detected *** malloc(): memory corruption (fast): 0x0904d970 ***
| panic: attempted clean up apparently failed -- aborting...
| Aborted
|
| There is something weird with the indexing operation on the lefthand side
| when the variable being assigned is undefined. For instance, this works:
|
| octave2.9:1> x = speye (1);
| octave2.9:2> x (:, :) = speye (1);
|
| At any rate, the malloc problem reported in the error message may indicate
| some Debian-specific bug.
It fails for me too, here:
octave:1> x(:,:) = speye (1)
*** glibc detected *** double free or corruption (out): 0x0000000001609490 ***
Program received signal SIGABRT, Aborted.
[Switching to Thread 47836373494320 (LWP 22077)]
0x00002b81c54c607b in raise () from /lib/libc.so.6
(gdb) where
#0 0x00002b81c54c607b in raise () from /lib/libc.so.6
#1 0x00002b81c54c784e in abort () from /lib/libc.so.6
#2 0x00002b81c54fc639 in __fsetlocking () from /lib/libc.so.6
#3 0x00002b81c55031a3 in mallopt () from /lib/libc.so.6
#4 0x00002b81c550322e in free () from /lib/libc.so.6
#5 0x00002b81c0d730d0 in ~SparseRep (this=0x1613d70) at
/home/jwe/src/octave/liboctave/Sparse.h:101
#6 0x00002b81c0d73124 in Sparse<double>::operator= (this=0x1474c30,
address@hidden)
at /home/jwe/src/octave/liboctave/Sparse.h:227
#7 0x00002b81c178587c in assign<double, double> (address@hidden,
address@hidden)
at /home/jwe/src/octave/liboctave/Sparse.cc:2527
#8 0x00002b81c0f6d1cf in octave_base_sparse<SparseMatrix>::assign
(this=0x1474c20, address@hidden,
address@hidden) at /home/jwe/src/octave/src/ov-base-sparse.cc:191
#9 0x00002b81c1170b81 in oct_assignop_assign (address@hidden,
address@hidden, address@hidden)
at /home/jwe/src/octave/src/OPERATORS/op-sm-sm.cc:110
#10 0x00002b81c0e719a2 in octave_base_value::numeric_assign (this=0x1474c20,
address@hidden,
address@hidden, address@hidden) at /home/jwe/src/octave/src/ov-base.cc:924
#11 0x00002b81c0f644c7 in octave_base_sparse<SparseMatrix>::subsasgn
(this=0x1474c20, address@hidden,
address@hidden, address@hidden) at
/home/jwe/src/octave/src/ov-base-sparse.cc:148
#12 0x00002b81c0eb070f in octave_value::subsasgn (this=0x7fffea17aad0,
address@hidden,
address@hidden, address@hidden) at /home/jwe/src/octave/src/ov.cc:799
#13 0x00002b81c0e75982 in octave_base_value::subsasgn (this=0x162e130,
address@hidden,
address@hidden, address@hidden) at /home/jwe/src/octave/src/ov-base.cc:205
#14 0x00002b81c0eb070f in octave_value::subsasgn (this=0x17345d0,
address@hidden, address@hidden,
address@hidden) at /home/jwe/src/octave/src/ov.cc:799
#15 0x00002b81c0eb8563 in octave_value::assign (this=0x17345d0,
op=octave_value::op_asn_eq,
address@hidden, address@hidden, address@hidden) at
/home/jwe/src/octave/src/ov.cc:846
#16 0x00002b81c0e02c40 in octave_lvalue::assign (this=0x7fffea17ae60,
op=octave_value::op_asn_eq,
address@hidden) at /home/jwe/src/octave/src/oct-lvalue.cc:38
#17 0x00002b81c0f6ff33 in tree_simple_assignment::rvalue (this=0x17f8f00)
at /home/jwe/src/octave/src/pt-assign.cc:106
#18 0x00002b81c0f70752 in tree_simple_assignment::rvalue (this=0x17f8f00,
nargout=0)
at /home/jwe/src/octave/src/pt-assign.cc:64
#19 0x00002b81c0f94e69 in tree_statement::eval (this=0x17f7cd0, silent=false,
nargout=0,
in_function_body=false) at /home/jwe/src/octave/src/pt-stmt.cc:133
#20 0x00002b81c0f950fa in tree_statement_list::eval (this=0x1638850,
silent=false, nargout=0)
at /home/jwe/src/octave/src/pt-stmt.cc:190
#21 0x00002b81c0e55024 in main_loop () at
/home/jwe/src/octave/src/toplev.cc:225
#22 0x00002b81c0e000b2 in octave_main (argc=3, argv=0x7fffea17b638,
embedded=0)
at /home/jwe/src/octave/src/octave.cc:766
#23 0x00002b81c54b34ca in __libc_start_main () from /lib/libc.so.6
#24 0x000000000040078a in _start () at ../sysdeps/x86_64/elf/start.S:113
Also, this fails:
octave:1> x(:,:) = sprand (10, 10, 0.1)
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47019963046448 (LWP 22097)]
0x00002ac3ab9d9691 in assign<double, double> (address@hidden, address@hidden)
at /home/jwe/src/octave/liboctave/Sparse.cc:2663
2663 pp = (++ppp < ppi ?
lhs.ridx(lhs.cidx(j)+ppp) : new_nr);
(gdb) where
#0 0x00002ac3ab9d9691 in assign<double, double> (address@hidden,
address@hidden)
at /home/jwe/src/octave/liboctave/Sparse.cc:2663
#1 0x00002ac3ab1c01cf in octave_base_sparse<SparseMatrix>::assign
(this=0x1474c20, address@hidden,
address@hidden) at /home/jwe/src/octave/src/ov-base-sparse.cc:191
#2 0x00002ac3ab3c3b81 in oct_assignop_assign (address@hidden,
address@hidden, address@hidden)
at /home/jwe/src/octave/src/OPERATORS/op-sm-sm.cc:110
#3 0x00002ac3ab0c49a2 in octave_base_value::numeric_assign (this=0x1474c20,
address@hidden,
address@hidden, address@hidden) at /home/jwe/src/octave/src/ov-base.cc:924
#4 0x00002ac3ab1b74c7 in octave_base_sparse<SparseMatrix>::subsasgn
(this=0x1474c20, address@hidden,
address@hidden, address@hidden) at
/home/jwe/src/octave/src/ov-base-sparse.cc:148
#5 0x00002ac3ab10370f in octave_value::subsasgn (this=0x7ffffff2a880,
address@hidden,
address@hidden, address@hidden) at /home/jwe/src/octave/src/ov.cc:799
#6 0x00002ac3ab0c8982 in octave_base_value::subsasgn (this=0x1639300,
address@hidden,
address@hidden, address@hidden) at /home/jwe/src/octave/src/ov-base.cc:205
#7 0x00002ac3ab10370f in octave_value::subsasgn (this=0x17345d0,
address@hidden, address@hidden,
address@hidden) at /home/jwe/src/octave/src/ov.cc:799
#8 0x00002ac3ab10b563 in octave_value::assign (this=0x17345d0,
op=octave_value::op_asn_eq,
address@hidden, address@hidden, address@hidden) at
/home/jwe/src/octave/src/ov.cc:846
#9 0x00002ac3ab055c40 in octave_lvalue::assign (this=0x7ffffff2ac10,
op=octave_value::op_asn_eq,
address@hidden) at /home/jwe/src/octave/src/oct-lvalue.cc:38
#10 0x00002ac3ab1c2f33 in tree_simple_assignment::rvalue (this=0x17f8e00)
at /home/jwe/src/octave/src/pt-assign.cc:106
#11 0x00002ac3ab1c3752 in tree_simple_assignment::rvalue (this=0x17f8e00,
nargout=0)
at /home/jwe/src/octave/src/pt-assign.cc:64
#12 0x00002ac3ab1e7e69 in tree_statement::eval (this=0x17f8f10, silent=false,
nargout=0,
in_function_body=false) at /home/jwe/src/octave/src/pt-stmt.cc:133
#13 0x00002ac3ab1e80fa in tree_statement_list::eval (this=0x1610af0,
silent=false, nargout=0)
at /home/jwe/src/octave/src/pt-stmt.cc:190
#14 0x00002ac3ab0a8024 in main_loop () at
/home/jwe/src/octave/src/toplev.cc:225
#15 0x00002ac3ab0530b2 in octave_main (argc=3, argv=0x7ffffff2b3e8,
embedded=0)
at /home/jwe/src/octave/src/octave.cc:766
#16 0x00002ac3af7064ca in __libc_start_main () from /lib/libc.so.6
#17 0x000000000040078a in _start () at ../sysdeps/x86_64/elf/start.S:113
(gdb) list
2658 else
2659 {
2660 stmp.data(kk) =
2661 lhs.data(lhs.cidx(j)+ppp);
2662 stmp.ridx(kk++) = pp;
2663 pp = (++ppp < ppi ?
lhs.ridx(lhs.cidx(j)+ppp) : new_nr);
2664 }
2665 }
2666 if (++jji < m)
2667 jj = idx_j.elem(jji);
(gdb)
If the value on the RHS is already a sparse matrix of the right size,
there is no crash:
octave:2> x = speye (10);
octave:3> x(:,:) = sprand (10, 10, 0.1)
x =
Compressed Column Sparse (rows = 10, cols = 10, nnz = 10)
(10, 2) -> 0.68794
(9, 3) -> 0.62723
(5, 6) -> 0.89773
(10, 6) -> 0.15447
(3, 7) -> 0.69555
(3, 8) -> 0.10861
(5, 8) -> 0.39224
(8, 8) -> 0.64466
(6, 9) -> 0.57941
(5, 10) -> 0.51256
David, I don't really understand the code here, so if there is
something I can do to help debug this, let me know.
Thanks,
jwe
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:, :)=speye(1)", Rafael Laboissiere, 2006/10/24
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:, :)=speye(1)", Thomas Weber, 2006/10/24
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:, :)=speye(1)", David Bateman, 2006/10/24
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:, :)=speye(1)", Rafael Laboissiere, 2006/10/24
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:, :)=speye(1)", Quentin Spencer, 2006/10/24
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:, :)=speye(1)",
John W. Eaton <=
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:, :)=speye(1)", David Bateman, 2006/10/24
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:,, David Bateman, 2006/10/24
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:,, Rafael Laboissiere, 2006/10/24
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:,, John W. Eaton, 2006/10/24
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:,, Kim Hansen, 2006/10/25
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:,, Rafael Laboissiere, 2006/10/25
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:,, David Bateman, 2006/10/25
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:,, John W. Eaton, 2006/10/25
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:,, John W. Eaton, 2006/10/25
- Re: [Pkg-octave-devel] Bug#394982: octave2.9: Crashes on "x(:,, Kim Hansen, 2006/10/26