help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Aw: Re: Octave type argument error calling mxGetField


From: Hans Peschke
Subject: Re: Aw: Re: Octave type argument error calling mxGetField
Date: Wed, 07 Jan 2015 19:59:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 05.01.2015 13:31, Julien Bect wrote:> Hello Hans,
>
> Please answer *below* when you post on Octave's mailing list (i.e., use
> bottom-posting).
>
> I have tried your test files (on Octave 3.9.0+ on Ubuntu 14.10 32 bits):
>
> 1) If I compile with your compile.sh script, Octave crashes as you describe.
>
> octave:1> test
> n = <class Number>
> error: octave_class::as_mxArray (): wrong type argument 'class'
> panic: impossible state reached in file 'corefcn/mex.cc' at line 556
> panic: Abandon -- stopping myself...
>
> 2) if I use instead the following instructions directly from octave:
>
> cd lib
> mex -c -I. Number.c
> mex -c -I. Wrap.c
>
> cd ../matlab
> mex -I. -I../lib -D_MEASURE_ number_.c ../lib/Number.o ../lib/Wrap.o
>
> cd ../@Number
> mex -I. -I../lib -D_MEASURE_ subsref.c ../lib/Number.o ../lib/Wrap.o
> mex -I. -I../lib -D_MEASURE_ subsasgn.c ../lib/Number.o ../lib/Wrap.o
> mex -I. -I../lib -D_MEASURE_ delete.c ../lib/Number.o ../lib/Wrap.o
> cd ..
>
> then it doesn't crash. But I still get the following error message:
>
> n = <class Number>
> error: invalid index for class
> error: called from:
> error: /home/bect/Sandbox/matlabOctave/essaiHansPeschke/minig/test.m at
> line 7, column 1
>
>
> 3) I have also tried with Matlab R2012a. I get this
>
>   >> test
>
> n =
>
>       Number object: 1-by-1
>
> ans =
>
>     1.2672e-314
>
> Is it the expected ouput ?
>

Hello Julien,
I just played around a little with your compile.m script and experienced some *very* strange behaviour, which I can not explain.

With your compile.m script I also could reproduce my original crash, but only under a this strange circumstance:

./clean.sh
octave
cd path/to/minig
compile
> ... the usual warnings
test
n = <class Number>
error: invalid index for class
error: called from:
error:   /path/to/minig/test.m at line 8, column 1

in a different terminal: vim compile.m
test
n = <class Number>
error: octave_class::as_mxArray (): wrong type argument 'class'
panic: impossible state reached in file 'corefcn/mex.cc' at line 556
panic: Aborted -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
Aborted (core dumped)

Thus the result of executing the test.m script depends on whether the compile script is edited (only open, no changes done) with vim. There are maybe also some other situations which strange outcome, but I conly could reproduce this case. The next crazy thing is: when I quit vim in the other terminal, remove the octave core dump, start octave, change to the minig directory and start test.m, then it crashes again. But the object files and mex files didnt change. The can be reset by cleaining all the object files with clean.sh. There is something very strange going on here. Can you reproduce this behaviour?

I didnt test minig with Matlab 2012, once I tried it with matlab 2014, but it crashed, I can try it tomorrow again.


In all the code in minig, there is one thing I don't understand at all, namely the line in @Number/Number.m:26,27
n.handle = number_(arg0);
n = class(n, 'Number');

What is this handle thing. Are these Matlab handle classes then? I read somewhere, that handle classes are not supported by octave. I mean number_ just wraps it in a Wrap object, but what is this handle field about and what happens in line 27?? Do you have an explanation for this?

Thanks a lot and happy new year :)
Hans Peschke



reply via email to

[Prev in Thread] Current Thread [Next in Thread]