octave-maintainers
[Top][All Lists]
Advanced

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

Re: Seg fault with test_sparse.m


From: John W. Eaton
Subject: Re: Seg fault with test_sparse.m
Date: Mon, 21 Aug 2006 17:45:00 -0400

On 21-Aug-2006, Joe Koski wrote:

| on 8/21/06 2:30 PM, John W. Eaton at address@hidden wrote:
| 
| > On 21-Aug-2006, Joe Koski wrote:
| > 
| > | octave:1> testls(0)
| > | error: max_recursion_limit exceeded
| > | error: called from `testls' in file
| > | `/Users/jakoski/Codes/octave_test_files/testls.m'
| > | error: called from `testls' in file
| > | `/Users/jakoski/Codes/octave_test_files/testls.m'
| > 
| > Save just the function that I sent (not the stuff after the
| > endfunction line) in a file and then run
| > 
| >   [save_status, save_files] = testls (0);
| >   [load_status, load_files] = testls (1);
| >  
| >   for f = [save_files, load_files]
| >     unlink (f{1});
| >   endfor
| > 
| >   assert (save_status && load_status);
| > 
| > and there should be no recursion problem.
| > 
| > jwe
| 
| John,
| 
| Thanks, that solved the recursion problem. I stuck in
| 
|     disp('before write')
|     a14
|     b14
| 
| Immediately after all the b14 = a14, etc.
| 
| and 
| 
|       disp('after read');
|       a14
|       b14
| 
| Just before if (a14 != b14)
| 
| And got
| 
| octave:1> new_test_io
| before write
| a14 =
| 
|   7  7
|   5  1
| 
| b14 =
| 
|   7  7
|   5  1
| 
| after read
| a14 =
| 
|   7  7
|   5  1
| 
| b14 =
| 
|   7  7
|   5  1
| 
| after read
| a14 =
| 
|   7  7
|   5  1
| 
| b14 =
| 
|   7  7
|   5  1
| 
| after read
| a14 =
| 
|   0  0
|   0  0
| 
| b14 =
| 
|   7  7
|   5  1
| 
| So, on the third attempt, it shows zeros in the matrix instead of the
| correct values. We're getting closer. Now what?

OK.  I see the bug now, and I don't think it is specific to OS X.

Also, the checks in test.m should be of the form

  if (! isequal (a, b))

or

  if (! (a == b))

since

  if (a != b)

will only be true if ALL the elements of A and B are not equal.  D'oh,
that's another gotcha of the "Matlab language".

jwe


reply via email to

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