Calling plot() consistently crashes octave - Why?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Calling plot() consistently crashes octave - Why?

david
This post was updated on .
Cannot get plot() to work in octave 3.8.2


BACKGROUND INFORMATION:


Am an intermediate linux user.   Am experienced using both matlab and octave.

Now I just installed octave onto a newly released (Jun 10, 2017)Debian linux distro.

$ uname -a
Linux neptune 4.9.30 #6 SMP PREEMPT Sun May 28 18:35:23 CEST 2017 x86_64 GNU/Linux

Am running GNU Octave, version 3.8.2 in a bash shell, on a 64-bit quad-core CPU.   That's the version which #apt-get install octave installed.

I also installed gnuplot using #apt-get install gnuplot because I thought that if plot doesn't work in octave, maybe I could use gnuplot as a separate program to plot data saved to a file.

$ octave
GNU Octave, version 3.8.2
Copyright (C) 2014 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Additional information about Octave is available at http://www.octave.org.

Please contribute if you find this software useful.
For more information, visit http://www.octave.org/get-involved.html

Read http://www.octave.org/bugs.html to learn how to submit bug reports.
For information about changes from previous versions, type 'news'.

octave:1> graphics_toolkit
ans = gnuplot
octave:2> who
Variables in the current scope:

ans

octave:3> pkg describe all
error: could not find any INDEX file in directory /home/george/octave/gnuplot-1.0.1, try 'pkg rebuild all' to generate missing INDEX files
error: called from:
error:   /usr/share/octave/3.8.2/m/pkg/private/parse_pkg_idx.m at line 32, column 5
error:   /usr/share/octave/3.8.2/m/pkg/private/describe.m at line 60, column 39
error:   /usr/share/octave/3.8.2/m/pkg/pkg.m at line 526, column 11
octave:3> pkg rebuild all
octave:4> pkg describe all
error: could not find any INDEX file in directory /home/george/octave/gnuplot-1.0.1, try 'pkg rebuild all' to generate missing INDEX files
error: called from:
error:   /usr/share/octave/3.8.2/m/pkg/private/parse_pkg_idx.m at line 32, column 5
error:   /usr/share/octave/3.8.2/m/pkg/private/describe.m at line 60, column 39
error:   /usr/share/octave/3.8.2/m/pkg/pkg.m at line 526, column 11
octave:4> pkg list
Package Name  | Version | Installation directory
--------------+---------+-----------------------
     gnuplot  |   1.0.1 | /home/george/octave/gnuplot-1.0.1
        plot *|   1.1.0 | /usr/share/octave/packages/plot-1.1.0
octave:5> pkg update
octave:6> exit

I downloaded gnuplot-1.0.1.tar.gz from https://octave.sourceforge.io/gnuplot/ and installed it with octave as follows:
>pkg install matlab_octave/octave/gnuplot-1.0.1.tar.gz
and got lots of warnings!



PROBLEM:


Every time I call plot() from octave, octave crashes with the same
error message:

octave:1> graphics_toolkit("gnuplot")
octave:2> x=-10:0.1:10;
octave:3> graphics_toolkit
ans = gnuplot
octave:4> plot(x,sin(x));
panic: Illegal instruction -- stopping myself...
Illegal instruction

and returns to the bash shell.

I have gotten this exact same error message each and every time I called plot() from octave.

Did I forget to do something important?  Or is this version of octave old and broken?    Please comment if you have any suggestions on what else I can try.    I have been trying to figure out what I may have forgotten
to do in setting up octave, but cannot find the missing link in my written log.     Did I overlook something simple ?


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

Mike Miller-4
On Fri, Jul 21, 2017 at 11:09:17 -0700, david wrote:
> Now I just installed octave onto a newly released (Jun 10, 2017)Debian linux
> distro.
>
> $ uname -a
> Linux neptune 4.9.30 #6 SMP PREEMPT Sun May 28 18:35:23 CEST 2017 x86_64
> GNU/Linux
>
> Am running GNU Octave, version 3.8.2 in a bash shell, on a 64-bit quad-core
> CPU.   That's the version which #apt-get install octave installed.

As a first step, you might want to check which version of Debian you
actually have installed and make sure your apt sources are up to date.

Debian 9 (stretch), which was released on June 17, includes Octave
4.0.2. And with the backports repository enabled, Octave 4.2.1.

> I also installed gnuplot using #apt-get install gnuplot because I thought
> that if plot doesn't work in octave, maybe I could use gnuplot as a separate
> program to plot data saved to a file.

Yes, but Octave also uses gnuplot as a fallback plotting backend if your
system lacks in OpenGL support or is headless. For the best experience,
you might want to make sure that the gnuplot-qt package is installed.

> $ octave
> GNU Octave, version 3.8.2
> Copyright (C) 2014 John W. Eaton and others.
> This is free software; see the source code for copying conditions.
> There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
> FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.
>
> Octave was configured for "x86_64-pc-linux-gnu".
>
> Additional information about Octave is available at http://www.octave.org.
>
> Please contribute if you find this software useful.
> For more information, visit http://www.octave.org/get-involved.html
>
> Read http://www.octave.org/bugs.html to learn how to submit bug reports.
> For information about changes from previous versions, type 'news'.
>
> octave:1> graphics_toolkit
> ans = gnuplot

Do you have a ~/.octaverc? Are you explicitly choosing to make gnuplot
the default graphics_toolkit?

> octave:4> pkg list
> Package Name  | Version | Installation directory
> --------------+---------+-----------------------
>      gnuplot  |   1.0.1 | /home/george/octave/gnuplot-1.0.1
>         plot *|   1.1.0 | /usr/share/octave/packages/plot-1.1.0

Both of these packages are obsolete, you do not need to install them at
all. Octave has built in support for plotting with OpenGL and gnuplot. I
recommend that you do

    rm -rf ~/octave/gnuplot-1.0.1
    sudo apt-get purge octave-plot
    octave --eval 'pkg rebuild'

> Every time I call plot() from octave, octave crashes with the same
> error message:
[copied text from nabble]
>     octave:1> graphics_toolkit("gnuplot")
>     octave:2> x=-10:0.1:10;
>     octave:3> graphics_toolkit
>     ans = gnuplot
>     octave:4> plot(x,sin(x));
>     panic: Illegal instruction -- stopping myself...
>     Illegal instruction

You might want to try separating the plot from the sin function to see
which is to blame. You should also try this after sorting out your apt
sources and making sure the obsolete packages are no longer installed.

--
mike

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

david
Thank you, mike, for your suggestions.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Neptune
Release:        4.5
Codename:       wheezy

It is a wheezy distribution.

Mike Miller-4 wrote
Do you have a ~/.octaverc? Are you explicitly choosing to make gnuplot
the default graphics_toolkit?
Yes.      Yes, I added the line
graphics_toolkit("gnuplot")
to my ~/.octaverc.   So the one in my octave script is redundant.

After reading your suggestions, I entered the three bash commands you suggested.   Then I added
gnuplot-qt using apt.     Then I reran octave exactly as earlier.    Octave crashed in exactly the same way.

Then, I separated sin(x) from the line with the plot() call.    This verified that the plot() call is what made octave crash.

plot() has been in octave for many versions.    It should work in 3.8 as well as in 4.x, shouldn't it?   Maybe the
next reasonable step would be to remove thegraphics_toolkit("gnuplot") line from both
~/.octaverc and my octave script, and run the example again and see what happens.  I think I will try that next.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

Mike Miller-4
On Fri, Jul 21, 2017 at 15:13:23 -0700, david wrote:
> After reading your suggestions, I entered the three bash commands you
> suggested.   Then I added
> gnuplot-qt using apt.     Then I reran octave exactly as earlier.    Octave
> crashed in exactly the same way.
>
> Then, I separated sin(x) from the line with the plot() call.    This
> verified that the plot() call is what made octave crash.

Some light web searching shows that others have seen the same error, and
the most likely culprit is an ATLAS or OpenBLAS library that may not be
properly compiled for your particular processor.

Octave relies on the BLAS and LAPACK libraries for many array and matrix
operations, even for functions that do not seem related to linear
algebra on the surface, like plot.

The most likely explanation for the "Illegal instruction" error is a
problem with the ATLAS or OpenBLAS packages provided by Debian or
Neptune for your distribution.

Try installing the libblas3 and liblapack3 packages, and then removing
any installed libatlas and libopenblas packages. Restart Octave and try
your example again.

--
mike

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

david
This post was updated on .
root@neptune: /home/david # ldconfig -p | grep libatlas
root@neptune: /home/david # ldconfig -p | grep libopenblas
        libopenblas.so.0 (libc6,x86-64) => /usr/lib/libopenblas.so.0
root@neptune: /home/david # ldconfig -p | grep libblas3
root@neptune: /home/david # ldconfig -p | grep libblapack3
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

david
This post was updated on .
Before removing the libraries you suggested, Mike, I thought it might be prudent to first determine which packages (applications) would break if I remove them.

$ dpkg-query -l 'libatlas'
dpkg-query: no packages found matching libatlas
george@neptune:~$ dpkg-query -l 'libopenblas'
dpkg-query: no packages found matching libopenblas
$ dpkg-query -l | grep openblas
ii  libopenblas-base                                0.1.1-6+deb7u3                                    amd64        Optimized BLAS (linear algebra) library based on GotoBLAS2
$ dpkg-query -l | grep openblas
ii  libopenblas-base                                0.1.1-6+deb7u3                                    amd64        Optimized BLAS (linear algebra) library based on GotoBLAS2
 ii  libopenblas-base                                0.1.1-6+deb7u3                                    amd64        Optimized BLAS (linear algebra) library based on GotoBLAS2
bash: syntax error near unexpected token `('
$ dpkg-query -W -f='${Status} ${Version}\n' openblas
dpkg-query: no packages found matching openblas

I am not sure how to interpret this information.   Or even if I am going about this properly.   My guess is it means
       * no application depends on "libatlas",
and
       * no application depends on "libopenblas"

So I will proceed with your advice on removing these libraries.

UPDATE:
I just checked:
$ dpkg-query -W -f='${Status} ${Version}\n' libblas3
install ok installed 1.2.20110419-5
$ dpkg-query -W -f='${Status} ${Version}\n' liblapack3
install ok installed 3.4.1+dfsg-1+deb70u1
I take this to mean libblas3 and liblapack3 are already installed (correct me if I'm wrong).
So I will go back & try what I suggested in my post from last night.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

david
This post was updated on .
I commented out this line
#graphics_toolkit("gnuplot")
in my ~/.octaverc and re-entered my test plot code:

Same results as before:
octave:1> x=-10:0.1:10;
octave:2> plot(x,sin(x));
panic: Illegal instruction -- stopping myself...
Illegal instruction
I noticed the graphics window appeared as soon as the plot() line was entered, but disappeared within a fraction of a second.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

Mike Miller-4
On Sat, Jul 22, 2017 at 08:26:04 -0700, david wrote:
> I commented out this line
> #graphics_toolkit("gnuplot")
> in my ~/.octaverc and re-entered my sample:
>
> Same results as before:
> octave:1> x=-10:0.1:10;
> octave:2> plot(x,sin(x));
> panic: Illegal instruction -- stopping myself...
> Illegal instruction

Was this with OpenBLAS still installed or did you successfully remove
it?

In your previous message you showed that OpenBLAS is installed, but I'm
not sure if you've now uninstalled it.

--
mike

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

david
"Was this with OpenBLAS still installed or did you successfully remove
it?"
Just ran this:

 # ldconfig -p | grep blas
        libopenblas.so.0 (libc6,x86-64) => /usr/lib/libopenblas.so.0
        liblastfm.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/liblastfm.so.1
        libgslcblas.so.0 (libc6,x86-64) => /usr/lib/libgslcblas.so.0

so I guess libopenblas is still installed.   Please correct me if I'm wrong.

Last night, I ran this simple x^2 vs. x plot from another linux Live CD (not installed) and it plotted
perfectly on the first try.    I did NOT have to add any scripts or system libraries to make it work.

Should I remove libopenblas and retry it?       If yes, how do you suggest removing
it ?    and is my concern abuot breaking other installed applications valid ?

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

Mike Miller-4
On Sun, Jul 23, 2017 at 08:16:33 -0700, david wrote:

> "Was this with OpenBLAS still installed or did you successfully remove
> it?"
> Just ran this:
>
>  # ldconfig -p | grep blas
>         libopenblas.so.0 (libc6,x86-64) => /usr/lib/libopenblas.so.0
>         liblastfm.so.1 (libc6,x86-64) =>
> /usr/lib/x86_64-linux-gnu/liblastfm.so.1
>         libgslcblas.so.0 (libc6,x86-64) => /usr/lib/libgslcblas.so.0
>
>
> so I guess libopenblas is still installed.   Please correct me if I'm wrong.

You are correct.

> Last night, I ran this simple x^2 vs. x plot from another linux Live CD (not
> installed) and it plotted
> perfectly on the first try.    I did NOT have to add any scripts or system
> libraries to make it work.

What live distribution and version was this? Booted on the same machine?

> Should I remove libopenblas and retry it?       If yes, how do you suggest
> removing
> it ?    and is my concern abuot breaking other installed applications valid
> ?

Yes, if I were on a wheezy system I would run the following

    sudo apt-get install libblas3 liblapack3
    sudo apt-get purge libatlas3-base libopenblas-base

The first command may do nothing if these libraries are already
installed.

The second apt-get command will tell you if any other packages need to
be uninstalled transitively because of removing libatlas3-base and
libopenblas-base. There are very few packages that have a hard
dependency on libopenblas-base.

I may be wrong, but I seem to remember that OpenBLAS 0.1 on wheezy was a
bit immature, and Octave recommended ATLAS at the time.

--
mike

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

david
This post was updated on .
I did those two apt-get commands you suggested, Mike.

# apt-get install libblas3 liblapack3
Reading package lists... Done
Building dependency tree      
Reading state information... Done
libblas3 is already the newest version.
libblas3 set to manually installed.
liblapack3 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 41 not upgraded.
# apt-get purge libatlas3-base libopenblas-base
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Package 'libatlas3-base' is not installed, so not removed
The following packages will be REMOVED:
  libopenblas-base*
0 upgraded, 0 newly installed, 1 to remove and 41 not upgraded.
After this operation, 19.6 MB disk space will be freed.
Do you want to continue? [Y/n] y
dpkg: warning: files list file for package 'libmo-system-xml4.0-cil' missing; assuming package has no files currently installed
(Reading database ... 229993 files and directories currently installed.)
Removing libopenblas-base (0.1.1-6+deb7u3) ...
update-alternatives: using /usr/lib/libblas/libblas.so.3 to provide /usr/lib/libblas.so.3 (libblas.so.3) in auto mode

Does this agree with what you expected ?

I re-ran my test program
octave:1> x=1:10; y=x.^2;
octave:2> plot(x,y,);
octave:3> grid on
octave:4> graphics_toolkit
ans = fltk

It plotted perfectly the first time in its own viewport.

Thank you, Mike, for helping me fix this.     Next I will see if any of my other applications fail during the next week.

The Live DVD linux distribution I tried last night (on the same 64-bit machine, yes) was solydk 64-bit version released July 7, 2017.    Free download from https://solydxk.com/ The KDE version solydk.    Not to be confused with solydx, the XFCE version.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

Mike Miller-4
On Sun, Jul 23, 2017 at 09:41:27 -0700, david wrote:

> Does this agree with what you expected ?
>
> I re-ran my test program
> octave:1> x=1:10; y=x.^2;
> octave:2> plot(x,y,);
> octave:3> grid on
> octave:4> graphics_toolkit
> ans = fltk
>
>
> It plotted perfectly the first time in its own viewport.

Good, so that ancient version of OpenBLAS is not suitable for your
processor, either due to an old bug or the way in which the package was
compiled.

> The Live DVD linux distribution I tried last night (on the same 64-bit
> machine, yes) was
> solydk 64-bit version released July 7, 2017.    Free download from
> https://solydxk.com/

No surprise here, as this is based on a much newer version of Debian. If
OpenBLAS is installed in this live environment, it is the latest version
that has likely fixed the problems that were present in wheezy.

--
mike

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

tmacchant
In reply to this post by david




----- Original Message -----

>
> *Cannot get plot() to work in octave 3.8.2*
>
> BACKGROUND INFORMATION:
>
>
> Am an imtermediate linux user.   Am experienced using both matlab and
> octave.
>
> Now I just installed octave onto a newly released (Jun 10, 2017)Debian linux
> distro.
>
> $ uname -a
> Linux neptune 4.9.30 #6 SMP PREEMPT Sun May 28 18:35:23 CEST 2017 x86_64
> GNU/Linux
>
> Am running GNU Octave, version 3.8.2 in a bash shell, on a 64-bit quad-core
> CPU.   That's the version which #apt-get install octave installed.
>
> I also installed gnuplot using #apt-get install gnuplot because I thought
> that if plot doesn't work in octave, maybe I could use gnuplot as a separate
> program to plot data saved to a file.
>
> $ octave
> GNU Octave, version 3.8.2
> Copyright (C) 2014 John W. Eaton and others.
> This is free software; see the source code for copying conditions.
> There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
> FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.
>
> Octave was configured for "x86_64-pc-linux-gnu".
>
> Additional information about Octave is available at http://www.octave.org.
>
> Please contribute if you find this software useful.
> For more information, visit http://www.octave.org/get-involved.html
>
> Read http://www.octave.org/bugs.html to learn how to submit bug reports.
> For information about changes from previous versions, type 'news'.
>
> octave:1> graphics_toolkit
> ans = gnuplot
> octave:2> who
> Variables in the current scope:
>
> ans
>
> octave:3> pkg describe all
> error: could not find any INDEX file in directory
> /home/george/octave/gnuplot-1.0.1, try 'pkg rebuild all' to generate
> missing
> INDEX files
> error: called from:
> error:   /usr/share/octave/3.8.2/m/pkg/private/parse_pkg_idx.m at line 32,
> column 5
> error:   /usr/share/octave/3.8.2/m/pkg/private/describe.m at line 60, column
> 39
> error:   /usr/share/octave/3.8.2/m/pkg/pkg.m at line 526, column 11
> octave:3> pkg rebuild all
> octave:4> pkg describe all
> error: could not find any INDEX file in directory
> /home/george/octave/gnuplot-1.0.1, try 'pkg rebuild all' to generate
> missing
> INDEX files
> error: called from:
> error:   /usr/share/octave/3.8.2/m/pkg/private/parse_pkg_idx.m at line 32,
> column 5
> error:   /usr/share/octave/3.8.2/m/pkg/private/describe.m at line 60, column
> 39
> error:   /usr/share/octave/3.8.2/m/pkg/pkg.m at line 526, column 11
> octave:4> pkg list
> Package Name  | Version | Installation directory
> --------------+---------+-----------------------
>      gnuplot  |   1.0.1 | /home/george/octave/gnuplot-1.0.1
>         plot *|   1.1.0 | /usr/share/octave/packages/plot-1.1.0
> octave:5> pkg update
> octave:6> exit
>
> I downloaded gnuplot-1.0.1.tar.gz from
> https://octave.sourceforge.io/gnuplot/ and installed it with octave as
> follows:
>> pkg install matlab_octave/octave/gnuplot-1.0.1.tar.gz
> and got lots of warnings!
>


It is not necessary to install the gnuplot and plot octave-forge packages to 
use plot command on gnuplot graphics toolkit.

Please post short commands to reproduce your trouble.


Tatsuro

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Calling plot() consistently crashes octave - Why?

Francesco Potortì
In reply to this post by Mike Miller-4
>> octave:4> pkg list
>> Package Name  | Version | Installation directory
>> --------------+---------+-----------------------
>>      gnuplot  |   1.0.1 | /home/george/octave/gnuplot-1.0.1
>>         plot *|   1.1.0 | /usr/share/octave/packages/plot-1.1.0
>
>Both of these packages are obsolete, you do not need to install them at
>all.

Unfortunately, me too I have installed the "plot" package.  It's the only
place I can find the 'tics' function.

--
Francesco Potortì (ricercatore)        Voice:  +39.050.621.3058
ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti
(entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it


_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave
Loading...