octave-maintainers
[Top][All Lists]
Advanced

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

64bit foundation bug in Octave2.9.3


From: John W. Eaton
Subject: 64bit foundation bug in Octave2.9.3
Date: Wed, 15 Jun 2005 09:46:34 -0400

On 15-Jun-2005, Clinton Chee wrote:

| Version 2.9.3
| Platform: SGI Altix Itanium2 (linux)
| Compilers: Intel F/C/CC
| 
| 
| Dear All,
| 
| I was following up on Daniel's test of simple indexing to stress test
| the octave64 capability.
| 
| ccc(2^4)=0;
| 
| this should create a vector of 16 entries filled with zeros
| and it works!
| 
| ccc(2^32)=0;
| 
| this should create a vector of 4294967296 entries filled with zeros
| BUT it doesn't
| 
| After some investigation, I found:
| ccc(2^31) --> octave thinks it is ---> ccc(2147483648) CORRECT
| ccc(2^31+50) --> octave thinks it is ---> ccc( -2147483598) WRONG
| ccc(2^31+100) --> octave thinks it is ---> ccc( -2147483548) WRONG
| ccc(2^32) --> octave thinks it is ---> ccc(0) WRONG
| 
| In short, there's an error in the indexing which still seems to be "int"
| instead of the "octave_idx_type" index which I supposed to have change.
| 
| I tried tracing the bug but can't really nail it down. I can't find
| which class or function which I've missed changing the index. From the
| backtrace of a process that is actually giving the right result (eg,
| ccc(2^30) = 0; ), the following backtrace from gdb is obtained.

The following patch fixes a potential problem like this, but I'm not
sure that this code is involved in the particular problem you cite.

jwe


liboctave/ChangeLog:

2005-06-15  John W. Eaton  <address@hidden>

        * Array.h (Array::resize): Change int args to octave_idx_type.


Index: liboctave/Array.h
===================================================================
RCS file: /cvs/octave/liboctave/Array.h,v
retrieving revision 1.93
diff -u -r1.93 Array.h
--- liboctave/Array.h   26 Apr 2005 19:24:27 -0000      1.93
+++ liboctave/Array.h   15 Jun 2005 13:45:39 -0000
@@ -451,9 +451,9 @@
 
 public:
 
-  void resize (int n) { resize_no_fill (n); }
+  void resize (octave_idx_type n) { resize_no_fill (n); }
 
-  void resize (int n, const T& val) { resize_and_fill (n, val); }
+  void resize (octave_idx_type n, const T& val) { resize_and_fill (n, val); }
 
   void resize (const dim_vector& dv) { resize_no_fill (dv); }
 



reply via email to

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