bugGNU Octave - Bugs: bug #33943, mismatched dimensions for multiply...

 
 

bug #33943: mismatched dimensions for multiply causes a crash

Submitter:  Jesse Rosenstock <jmrosenstock>
Submitted:  Thu 04 Aug 2011 10:24:50 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Need Info Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.4.0 Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 24 Sep 2012 05:23:18 PM UTC, comment #18: 

I'm closing this bug. If someone thinks it should be reopened, they can let us know.

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Mon 24 Sep 2012 05:13:28 PM UTC, comment #17: 

Given that Octave is now at 3.6+, and this ticket is for 3.4+ and also pretty old, can anyone confirm that this ticket is still a valid issue? I do not see the problem when using Octave 3.6.3 compiled using GCC 4.7 (MacPorts octave-devel +gcc47, 3.6.3 revision 0).  I believe the issue was some odd way that GCC was compiling the Octave code, though I've never been able to replicate the issue.

Michael Dickens <michaelld>
Tue 10 Apr 2012 07:43:39 PM UTC, comment #16: 

Should we add a test for Octave that checks to see whether


[1, 2] * [1, 2, 3]


properly generates an error?  At least then the problem would be detected when the test suite is run.

The only other solution I can think of is to try to write a configure test that could duplicate the failure so that Octave would not build unless exception handling works in the way Octave requires.

John W. Eaton <jwe>
Group administrator
Mon 09 Apr 2012 03:15:23 AM UTC, comment #15: 

So can I close this issue?  If the problem is with gcc, rather than Octave, then a report should be on their bug tracker rather than ours.

Rik <rik5>
Group administrator
Sun 08 Apr 2012 03:30:46 PM UTC, comment #14: 

This works for me with +gcc44, but not +gcc45.

Jesse Rosenstock <jmrosenstock>
Mon 27 Feb 2012 05:34:00 PM UTC, comment #13: 

Can this issue be closed?  Has the original reporter been able to build a version of Octave using the commands supplied by the Macports maintainer Michael Dickens?

Rik <rik5>
Group administrator
Wed 14 Dec 2011 08:21:28 PM UTC, comment #12: 

I just installed via MacPorts this morning "octave-devel +fltk +atlas +gcc45".  FLTK(-devel) is @1.3.x-r9204; gcc45 is @4.5.3.  This was a clean install, with only minimal other ports installed -- so, any port depending on the variants was installed using those variants.  I did not get the mismatch dimensions crash.  I'm wondering if the OP has the same variants for octave-devel, atlas, and qrupdate?  That would certainly be an issue if not.

Michael Dickens <michaelld>
Wed 10 Aug 2011 02:14:43 PM UTC, comment #11: 

I'm the maintainer of the MacPorts' octave-devel port. I have installed right now "octave-devel @3.4.2_0+fltk+gcc44". So using GCC 4.4.6 (universal) instead of 4.5 as the OP has. This installed Octave works correctly for the test below ("[ 1 2 ] * [ 1 2 3 ]"). Can the OP try reinstalling using some other GCC? I know that means recompiling atlas & maybe other ports to match, but it's worth a try.

Michael Dickens <michaelld>
Sat 06 Aug 2011 09:29:48 PM UTC, comment #10: 
Jesse Rosenstock <jmrosenstock>
Sat 06 Aug 2011 09:25:51 PM UTC, comment #9: 

The configure options are:

64
65 configure.args      --disable-dependency-tracking \
66                     --without-x \
67                     --disable-docs \
68                     --with-cholmod="-lcholmod -lmetis"

124 if {${gcc_version} != ""} {
125     set gcc_version_join [join [split ${gcc_version} "."] ""]
126     configure.ldflags    "${prefix}/lib/gcc${gcc_version_join}/libstdc++.6.dylib"
127     depends_build-append port:gcc${gcc_version_join}
128     configure.compiler   macports-gcc-${gcc_version}
129 }

124 if {${gcc_version} != ""} {
125     set gcc_version_join [join [split ${gcc_version} "."] ""]
126     configure.ldflags    "${prefix}/lib/gcc${gcc_version_join}/libstdc++.6.dylib"
127     depends_build-append port:gcc${gcc_version_join}
128     configure.compiler   macports-gcc-${gcc_version}
129 }

https://trac.macports.org/browser/trunk/dports/math/octave-devel/Portfile

I built with
gcc-mp-4.5 (GCC) 4.5.3

I'll open a bug with MacPorts.

Jesse Rosenstock <jmrosenstock>
Sat 06 Aug 2011 06:30:05 PM UTC, comment #8: 

ATLAS is not the problem here.  The xgemm function is part of Octave (liboctave/dMatrix.cc).  When it detects a dimension mismatch, it calls gripe_nonconformant (liboctave/lo-array-gripes.cc).  That function calls an error handler using the function pointer current_liboctave_error_with_id_handler.  Normally, that is set to lo_error_with_id_handler (set in the function initialize_error_handlers in src/octave.cc).  That function ultimately calls octave_throw_execution_exception (libcruft/misc/quit.cc) which ultimately throws a C++ exception which should be caught in the main_loop function (src/toplev.cc).  I'd guess the abort is happening because the exception is not caught as it should be.  I have no idea why that would be happening.  Precisely how was Octave compiled?  What compiler and version were used?  Were exceptions somehow disabled?

John W. Eaton <jwe>
Group administrator
Sat 06 Aug 2011 05:41:14 PM UTC, comment #7: 

No, 3.9.37.

The MacPorts atlas is setup to use a development version. This could be the source of my problem. I'm building with the current latest development version, 3.9.47, and will test again with that. If that doesn't work, I'll try a stable version.

http://sourceforge.net/projects/math-atlas/files/Developer%20%28unstable%29/

Jesse Rosenstock <jmrosenstock>
Sat 06 Aug 2011 02:30:41 PM UTC, comment #6: 

You mean version 3.8.37?

Is there another version you can try installing? The latest version seems to be 3.8.4

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Sat 06 Aug 2011 02:08:43 PM UTC, comment #5: 

atlas 3.9.37.

a bit more info from the backtrace:

xgemm is really Z5xgemmRK6MatrixS1_15blas_trans_typeS2 ->
xgemm(Matrix const&, Matrix const&, blas_trans_type, blas_trans_type)

operator* -> ZmlRK6MatrixS1 -> operator*(Matrix const&, Matrix const&)

Jesse Rosenstock <jmrosenstock>
Sat 06 Aug 2011 02:00:05 PM UTC, comment #4: 

Are you using ATLAS? If so, what version? There's a version out there with a bug that could be causing this.

Jordi Gutiérrez Hermoso <jordigh>
Group Member
Sat 06 Aug 2011 01:52:26 PM UTC, comment #3: 

Same thing with 3.4.2:

GNU Octave, version 3.4.2

Octave was configured for "i386-apple-darwin9.8.0".

octave:1> [ 1 2 ] * [ 1 2 3 ]

Program received signal SIGABRT, Aborted.
0x915b1d52 in __kill ()

same backtrace.

Installed from MacPorts 2.0.1 with current port definitions as of 2011-08-05.
port install octave-devel +gcc45

Jesse Rosenstock <jmrosenstock>
Fri 05 Aug 2011 08:07:11 PM UTC, comment #2: 

It was installed via MacPorts.  I will upgrade MacPorts (not sure if the octave / gcc versions will change) and try again.

Here is the backtrace:


octave:2> [1 2] * [ 1 2 3 ]

Program received signal SIGABRT, Aborted.
0x915b1d52 in __kill ()
(gdb) bt
#0  0x915b1d52 in __kill ()
#1  0x915b1d44 in kill$UNIX2003 ()
#2  0x91624242 in raise ()
#3  0x91630681 in abort ()
#4  0x970c4a2a in _Unwind_Resume ()
#5  0x023636cd in xgemm ()
#6  0x02363760 in operator* ()
#7  0x017343be in oct_binop_mul ()
#8  0x0145676a in do_binary_op ()
#9  0x014f4832 in tree_binary_expression::rvalue1 ()
#10 0x011ffcce in fold ()
#11 0x012038dd in octave_parse ()
#12 0x012ea641 in main_loop ()
#13 0x0127b92e in octave_main ()
#14 0x00001ff0 in main ()

Jesse Rosenstock <jmrosenstock>
Thu 04 Aug 2011 03:45:43 PM UTC, comment #1: 

Here is what I see with 3.4.0 on my system:


octave:1> [1,2]*[1,2,3]
error: operator *: nonconformant arguments (op1 is 1x2, op2 is 1x3)


I have no idea why you are seeing a panic here.  Can you try running Octave under gdb and get a stack trace to show precisely where the error occurs?

How did you install Octave?  Did you build it from source, or did you install a precompiled version?  If the latter, which one?

John W. Eaton <jwe>
Group administrator
Thu 04 Aug 2011 10:24:50 AM UTC, original submission:  

GNU Octave, version 3.4.0
...

Octave was configured for "i386-apple-darwin9.8.0".
...
octave:1> [ 1 2 ] * [ 1 2 3 ]
panic: Abort trap -- stopping myself...

Instead, an error message like "inner matrix dimensions must agree" should be printed.

Jesse Rosenstock <jmrosenstock>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by michaelld (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jmrosenstock (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-09-24 jordigh Open/ClosedOpen Closed
    2011-08-04 jwe StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code