Bug? In Octave 3.0.X for Mac OS X

Glenn Eychaner geychaner at mac.com
Mon Sep 1 13:35:18 CDT 2008


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.

Am I doing something wrong here?

Thanks,
-G.
--
Glenn Eychaner (geychaner at lco.cl)
Telescope Systems Programmer, Las Campanas Observatory





More information about the Help-octave mailing list