help-octave
[Top][All Lists]
Advanced

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

Bug? In Octave 3.0.X for Mac OS X


From: John W. Eaton
Subject: Bug? In Octave 3.0.X for Mac OS X
Date: Mon, 08 Sep 2008 14:07:12 -0400

On  1-Sep-2008, Glenn Eychaner wrote:

| The following rather simple function:
| 
| function [newdates, newaz] = zlocate (pdates, pz, adates, az)
| % Given passive and active data, find the active data that corresponds
| % to the passive data
| 
| newdates = vec(zeros(length(pdates),1));
| newaz = zeros(size(pz));
| 
| for n = 1 : length(pdates)
|       % Find the nearest active point in time to a given passive point
|       [ min, midx ] = min(abs(adates - pdates(n)));
|       
|       % Copy the date and zernikes to the new array
|       newdates(n) = adates(midx);
|       newaz(:,n) = az(:, midx);
| endfor
| endfunction
| 
| run in the following rather simple way:0
| 1025 pdates = [1:2:48];
| 1026 adates = [1:48];
| 1027 pz = rand(10,24);
| 1028 az = rand(10,48);
| 1029 zlocate(pdates,pz,adates,az);
| 
| rather reliably generates the following error on a fresh Octave  
| instance in Mac OS X:
| 
| octave-3.0.2(2559) malloc: *** error for object 0x24267d0: incorrect  
| checksum for freed object - object was probably modified after being  
| freed.
| *** set a breakpoint in malloc_error_break to debug
| 
| and executing it in a loop or other more complex structure will  
| frequently seg-fault Octave and leave behind an octave core file.

I can't reproduce the malloc error, but I'm not using OS X.  Perhaps
you could or someone else could run Octave with valgrind.  That might
help to find where the allocation error occurs.

With the current development sources, I see this kind of behavior if
you redefine a built-in function as a variable:

  octave:1> [min, midx] = min (rand (100));
  octave:2> [min, midx] = min (rand (100));
  error: expecting integer index, found 0.069779

This error happens because at the time of the second call, min is a
variable, and the index doesn't make sense.  I think that is the
proper behavior here.  It is not possible to fix for the 3.0.x release
series.  But in the current development sources, the symbol table code
has been completely redesigned and it is possible to define variables
with the same name as built-in functions.

jwe


reply via email to

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