save and load bug.

Ben Abbott bpabbott at mac.com
Sat Dec 27 22:07:38 CST 2008


On Dec 27, 2008, at 10:16 PM, GARY FORBIS wrote:
>
>
> > CC: help-octave at octave.org
> > From: bpabbott at mac.com
> > To: forbisgaryg at msn.com
> > Subject: Re: save and load bug.
> > Date: Sat, 27 Dec 2008 21:51:03 -0500
> >
> >
> > On Dec 27, 2008, at 8:50 PM, GARY FORBIS wrote:
> >
> > > a> I tried a simple version
> > > >
> > > > a = -rand (1, 500);
> > > > save -text test.txt a
> > > > clear all
> > > > load test.txt
> > > > whos a
> > > >
> > > > Running both 3.0.3 and the developers sources load() appears to
> > > work.
> > > >
> > > > I you are unable to produce a simple example which  
> demonstrates the
> > > > problem, can you attach a file that doesn't load so that it  
> may be
> > > > examined?
> > > >
> > > > Ben
> > >
> > > I thought I gave it. Here it is again:
> > >
> > > a=-0.03597396637549816
> > > b=[]
> > > for x=1:500
> > > b=[b,a]
> > > save stest b
> > > load stest
> > > end
> > >
> > > Here it is running:
> > >
> > > octave-3.0.3.exe:13> a=-0.03597396637549816
> > > a = -0.035974
> > > octave-3.0.3.exe:14>
> > > octave-3.0.3.exe:14> b=[]
> > > b = [](0x0)
> > > octave-3.0.3.exe:15> for x=1:500
> > > > b=[b,a]
> > > > save stest b
> > > > load stest
> > > > end
> > > error: load: failed to load matrix constant
> > > error: load: trouble reading ascii file `stest'
> > > error: load: reading file stest
> > > error: evaluating for command near line 15, column 1
> > > octave-3.0.3.exe:15>
> > >
> > > The reason I wrote it that way was because it fails predictably.
> > > Another version:
> > >
> > > a=-0.03597396637549816
> > > b=[]
> > >
> > > for x=1:383
> > > b=[b,a]
> > > end
> > > save stest b
> > > load stest
> > > b=[b,a]
> > > save stest b
> > > load stest
> > >
> > > In this second program the first case loads and the second fails.
> >
> > I tried your examples again ... they both run without error for  
> Octave
> > 3.0.3 and Octave built from the developers sources.
> >
> > What do you get when you type "which load" and "which save"?
> >
> > Ben
> >
>
> octave-3.0.3.exe:1> which load
> load is a built-in command
> octave-3.0.3.exe:2> which save
> save is a built-in command
>
>
> GNU Octave, version 3.0.3
> Copyright (C) 2008 John W. Eaton and others.
> This is free software; see the source code for copying conditions.
> There is ABSOLUTELY NO WARRANTY; not even for MERCHANTIBILITY or
> FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.
> Octave was configured for "i686-pc-msdosmsvc".
>
> Package Name       | Version | Installation directory
> -------------------+---------+-----------------------
>               ann *|   1.0.1 | ...\Octave\share\octave\packages 
> \ann-1.0.1
>            arpack *|   1.0.6 | ...\Octave\share\octave\packages 
> \arpack-1.0.6
>             audio *|   1.1.2 | ...\Octave\share\octave\packages 
> \audio-1.1.2
>         benchmark *|   1.0.0 | ...\Octave\share\octave\packages 
> \benchmark-1.0.0
>           bioinfo *|   0.1.1 | ...\Octave\share\octave\packages 
> \bioinfo-0.1.1
>     combinatorics *|   1.0.7 | ...\share\octave\packages 
> \combinatorics-1.0.7
>    communications *|   1.0.8 | ...\share\octave\packages 
> \communications-1.0.8
>           control *|   1.0.7 | ...\Octave\share\octave\packages 
> \control-1.0.7
>    data-smoothing *|   1.1.1 | ...\share\octave\packages\data- 
> smoothing-1.1.1
>          database *|   1.0.1 | ...\Octave\share\octave\packages 
> \database-1.0.1
>      econometrics *|   1.0.7 | ...\share\octave\packages 
> \econometrics-1.0.7
>         financial *|   0.3.0 | ...\Octave\share\octave\packages 
> \financial-0.3.0
>             fixed *|   0.7.8 | ...\Octave\share\octave\packages 
> \fixed-0.7.8
>               ftp *|   1.0.1 | ...\Octave\share\octave\packages 
> \ftp-1.0.1
>                ga *|   0.9.4 | ...\Octave\share\octave\packages 
> \ga-0.9.4
>           general *|   1.0.7 | ...\Octave\share\octave\packages 
> \general-1.0.7
>               gsl *|   1.0.7 | ...\Octave\share\octave\packages 
> \gsl-1.0.7
>             ident *|   1.0.6 | ...\Octave\share\octave\packages 
> \ident-1.0.6
>             image *|   1.0.8 | ...\Octave\share\octave\packages 
> \image-1.0.8
> informationtheory *|   0.1.6 | ...\octave\packages 
> \informationtheory-0.1.6
>                io *|   1.0.7 | ...\Octave\share\octave\packages 
> \io-1.0.7
>              irsa *|   1.0.6 | ...\Octave\share\octave\packages 
> \irsa-1.0.6
>              java *|   1.2.5 | ...\Octave\share\octave\packages 
> \java-1.2.5
>          jhandles  |   0.3.4 | ...\Octave\share\octave\packages 
> \jhandles-0.3.4
>    linear-algebra *|   1.0.6 | ...\share\octave\packages\linear- 
> algebra-1.0.6
>     miscellaneous *|   1.0.7 | ...\share\octave\packages 
> \miscellaneous-1.0.7
> missing-functions *|   1.0.1 | ...\octave\packages\missing- 
> functions-1.0.1
>              nnet *|   0.1.8 | ...\Octave\share\octave\packages 
> \nnet-0.1.8
>            octcdf *|  1.0.11 | ...\Octave\share\octave\packages 
> \octcdf-1.0.11
>            odebvp *|   1.0.5 | ...\Octave\share\octave\packages 
> \odebvp-1.0.5
>            odepkg *|   0.6.4 | ...\Octave\share\octave\packages 
> \odepkg-0.6.4
>             optim *|   1.0.4 | ...\Octave\share\octave\packages 
> \optim-1.0.4
>          outliers *|  0.13.8 | ...\Octave\share\octave\packages 
> \outliers-0.13.8
> physicalconstants *|   0.1.6 | ...\octave\packages 
> \physicalconstants-0.1.6
>              plot *|   1.0.6 | ...\Octave\share\octave\packages 
> \plot-1.0.6
>            signal *|   1.0.8 | ...\Octave\share\octave\packages 
> \signal-1.0.8
>           sockets *|   1.0.5 | ...\Octave\share\octave\packages 
> \sockets-1.0.5
>           specfun *|   1.0.7 | ...\Octave\share\octave\packages 
> \specfun-1.0.7
>    special-matrix *|   1.0.6 | ...\share\octave\packages\special- 
> matrix-1.0.6
>           splines *|   1.0.6 | ...\Octave\share\octave\packages 
> \splines-1.0.6
>        statistics *|   1.0.7 | ...\share\octave\packages 
> \statistics-1.0.7
>           strings *|   1.0.6 | ...\Octave\share\octave\packages 
> \strings-1.0.6
>            struct *|   1.0.6 | ...\Octave\share\octave\packages 
> \struct-1.0.6
>          symbolic *|   1.0.7 | ...\Octave\share\octave\packages 
> \symbolic-1.0.7
>              time *|   1.0.8 | ...\Octave\share\octave\packages 
> \time-1.0.8
>             video *|   1.0.1 | ...\Octave\share\octave\packages 
> \video-1.0.1
>           windows *|   1.0.6 | ...\Octave\share\octave\packages 
> \windows-1.0.6
>
> octave-3.0.3.exe:8> save vars
> error: octave_base_value::save_ascii(): wrong type argument `swig_ref'
>   (I have reloaded GNU Octave 4 times.  It always complains.  I  
> don't know if
>    it's something about my hardware.  Is this a symptom of a real  
> problem?)
>
> in cygwin:
>
> # Created by Octave 3.0.3, Sat Dec 27 19:10:15 2008 Pacific Standard  
> Time <unknown at unknown>
> # name: SQL_ENSURE
> # type: global scalar
> 1
> # name: SQL_FILE_USAGE
> # type: global scalar
> 84
> # name: SQL_C_UBIGINT
> # type: global scalar
> -27
> # name: SQL_API_ODBC3_ALL_FUNCTIONS
> # type: global scalar
> 999
> # name: ODBCVER
> # type: global scalar
> 849
> # name: SQLITE_MISUSE
> # type: global scalar
> 21
> # name: SQL_AT_DROP_COLUMN_DEFAULT
> # type: global scalar
> 512
> # name: SQL_SRVC_DEFAULT
> # type: global scalar
> 4
> # name: SQL_SET_NULL
> # type: global scalar
> 2
> # name: SQL_NC_END
> # type: global scalar
> 4
> # name: SQL_C_DEFAULT
> # type: global scalar
> 99
> # name: SQLITE_EMPTY
> # type: global scalar
> 16
> # name: SQL_PC_NOT_PSEUDO
> # type: global scalar
> 1
> # name: SQL_SQL92_ROW_VALUE_CONSTRUCTOR
> # type: global scalar
> 163
> # name: SQL_HANDLE_STMT
> # type: global scalar
> 3
> # name: SQL_AD_DROP_DOMAIN_CONSTRAINT
> # type: global scalar
> 4
> # name: SQL_DI_CREATE_INDEX
> # type: global scalar
> 1
> # name: SQL_DRIVER_HENV
> # type: global scalar
> 4
> # name: SQL_ATTR_AUTOCOMMIT
> # type: global scalar
> 102
> # name: SQL_SO_KEYSET_DRIVEN
> # type: global scalar
> 2
> # name: SQL_FN_CVT_CONVERT
> # type: global scalar
> 1
> # name: SQL_CDO_CONSTRAINT_NAME_DEFINITION
> # type: global scalar
> 16
> # name: SQLITE_BUSY
> # type: global scalar
> 5
> # name: SQL_API_SQLDESCRIBECOL
> # type: global scalar
> 8
> # name: SQL_FN_STR_SUBSTRING
> # type: global scalar
> 2048
> # name: SQL_OU_PRIVILEGE_DEFINITION
> # type: global scalar
> 16
> # name: SQL_API_SQLGETINFO
> # type: global scalar
> 45
> # name: SQL_DIAG_DYNAMIC_UPDATE_CURSOR
> # type: global scalar
> 81
> # name: SQL_ISV_REFERENTIAL_CONSTRAINTS
> # type: global scalar
> 4096
> # name: SQL_API_SQLTABLES
> # type: global scalar
> 54
> # name: SQL_BP_DROP
> # type: global scalar
> 4
> # name: SQL_ORDER_BY_COLUMNS_IN_SELECT
> # type: global scalar
> 90
> # name: __nargin__
> # type: scalar
> 0
> # name: SQL_PARAM_INPUT_OUTPUT
> # type: global scalar
> 2
> # name: SQL_DELETE
> # type: global scalar
> 3
> # name: SQL_SRJO_RIGHT_OUTER_JOIN
> # type: global scalar
> 256
> # name: SQL_FN_NUM_ATAN2
> # type: global scalar
> 16
> # name: SQL_SCROLL_OPTIONS
> # type: global scalar
> 44
> # name: SQL_API_SQLEXECUTE
> # type: global scalar
> 12
> # name: SQL_DIAG_DELETE_WHERE
> # type: global scalar
> 19
> # name: SQL_ROWSET_SIZE_DEFAULT
> # type: global scalar
> 1
> # name: SQL_SETPOS_MAX_LOCK_VALUE
> # type: global scalar
> 2
> # name: SQL_HANDLE_SENV
> # type: global scalar
> 5
> # name: SQL_AF_DISTINCT
> # type: global scalar
> 32
> # name: SQL_GETDATA_EXTENSIONS
> # type: global scalar
> 81
> # name: SQL_ACCESSIBLE_PROCEDURES
> # type: global scalar
> 20
> # name: SQL_DESC_PRECISION
> # type: global scalar
> 1005
> # name: SQL_API_SQLALLOCHANDLESTD
> # type: global scalar
> 73
> # name: SQL_OUTER_JOINS
> # type: global scalar
> 38
> # name: SQL_FETCH_FIRST
> # type: global scalar
> 2
> # name: sqlite3_index_info_aConstraintUsage
> # type: global swig_ref
>
> I wonder how many more variables there are.


ok, I'm at a loss as to what may be wrong.

I've cc'd the list again.

Hopefully someone will notice your post with the have an idea as to  
what might be wrong.

Ben


More information about the Help-octave mailing list