Octave crashes with the message of panic: Segmentation fault -- stopping myself...
John W. Eaton
jwe at bevo.che.wisc.edu
Wed Apr 16 00:20:04 CDT 2008
On 15-Apr-2008, Roozbeh Daneshvar wrote:
| --------
| Bug report for Octave 2.1.73 configured for i486-pc-linux-gnu
|
| Description:
| -----------
|
| The program works correctly once and for the next time when I change intitial values of some variables in the code and type source "lorenzAttractor.m", the program gives me the following error and closes:
|
| panic: Segmentation fault -- stopping myself...
| attempting to save variables to 'octave-core'...
| save to 'octave-core' complete
|
| Repeat-By:
| ---------
|
| It works for one code and when the code is changed, it crashes. I am attaching the code that I use, to this email.
The following works with 3.0.0 (I replaced the vtk functions with
standard plotting functions and changed the code to plot all the data
each time as that is faster than adding one line segment at a time
when using the gnuplot interface).
iterations = 4000;
x = -5;
y = 3;
z = 50;
oldx = x;
oldy = y;
oldz = z;
sigma = 10;
b = 8/3;
r = 99.96;
deltat = 0.005;
xs = zeros(iterations, 1);
ys = zeros(iterations, 1);
zs = zeros(iterations, 1);
for iterationCounter = (1 : iterations)
dx = sigma * (y - x);
dy = r * x - y - x * z;
dz = x * y - b * z;
x = x + deltat * dx;
y = y + deltat * dy;
z = z + deltat * dz;
xp = [oldx; x];
yp = [oldy; y];
zp = [oldz; z];
plot3(xs, ys, zs);
axis([-40, 40, -80, 70, 40, 170]);
drawnow ();
xs(iterationCounter) = x;
ys(iterationCounter) = y;
zs(iterationCounter) = z;
oldx = x;
oldy = y;
oldz = z;
endfor
plot3(xs, ys, zs);
axis([-40, 40, -80, 70, 40, 170]);
drawnow ();
What happens if you remove the calls to the vtk plotting functions?
Does it still crash? If not, then I suspect the bug is in the vtk
package, not Octave. In any case, I strongly recommend upgrading to
Octave 3.0.
jwe
More information about the Bug-octave
mailing list