From bug-octave-request at bevo dot che dot wisc dot edu Tue Aug 11 23:45:11 1998 Subject: Octave dumps core From: "John W. Eaton" To: Francesco Potorti` Cc: Octave bugs list Date: Tue, 11 Aug 1998 23:44:19 -0500 (CDT) On 11-Aug-1998, Francesco Potorti` wrote: | Bug report for Octave 2.0.13 configured for i386-pc-linux-gnu | | I append .m file that makes octave crash, and a data file bzipped and | uuencoded, which is read by the .m file. To reproduce, just call the | script as shown: | [...] | ---------------- start of satelliteatt.m ----------------- | # Read the "att" file containing two column vectors att20 and att30 listing | # the measured attenuation. They are 179580 samples long. | load -force att | L=length(att20); | | # Build the matrix att composed of the two column vectors | att=[att20 att30]; | disp("[min(att); max(att)]:"); | disp([min(att); max(att)]); | | # Build the attbin20, attbin30 vectors and the attbin matrix, containing the | # number od the bin of the attenuation samples. Bins are 2dB-wide for | # uplink (30 GHz) and 1dB-wide for downlink (20GHz). The first bin has | # number 0. | attbin=fix([att20 att30/2]); | disp("[min(attbin);max(attbin)]:"); | disp([min(attbin);max(attbin)]); | | # Build attstring, a column vector desribing the strings of samples internal | # to the same bin. Four columns: row where the string begins, column (1 for | # att20, 2 for att30), length of the string, number of the bin. | attseq=[[1 1]; diff(attbin)]; | attseq=(attseq!=0); | [a,b]=find(attseq); | d=attbin(a,b); This is a memory allocation problem. Unfortunately, it appears that on Linux systems malloc (and therefore the C++ operator new) is not reporting a problem, and then the failure happens later when Octave tries to use memory that it shouldn't. At least on a DEC Alpha running Digital Unix, I get a memory exhausted error message. I believe the problem really needs to be fixed in the Linux malloc. See http://www.che.wisc.edu/octave/mailing-lists/bug-octave/1998/215 for some more information about this problem. In your code, I don't think the lines [a,b]=find(attseq); d=attbin(a,b); are doing what you want. For your data, the a and b index vectors are both 32294 elements long, so when you do the indexing operation, you are attempting to create a result matrix with 1042902436 elements, which requires approximately 7GB of storage. I'm not exactly sure what you want your code to do. I'm guessing that it is something more like t = attbin(:)'; d = t (find (attseq)); jwe