[Pkg-octave-devel] Bug#603046: octave3.2: strchr triggers Octave:str-to-num

Kim Hansen kim at i9.dk
Wed Nov 10 16:38:50 UTC 2010


Package: octave3.2
Version: 3.2.4-8
Severity: normal
Tags: patch


strchr treats a string as a number implicitly:

kim at raph:~/orion/svn/raph1/octave$ octave
GNU Octave, version 3.2.4
....
octave:1> warning error Octave:str-to-num
octave:2> strchr("Octave is the best software","best")
error: implicit conversion from string to real N-d array
error: type conversion failed for binary operator `+'
error: evaluating argument list element number 1
error: invalid empty index list
error: called from:
error:   /usr/share/octave/3.2.4/m/strings/strchr.m at line 37, column 16
octave:2> 


I think it can be fixed by changing the the strchr function to:

function varargout = strchr (str, chars, varargin)
  if (nargin < 2 || ! ischar (str) || ! ischar (chars))
    print_usage ();
  endif
  f = false (1, 256);
  f(uint8(chars) + 1) = true;
  varargout = cell (1, nargout);
  varargout{1} = [];
  [varargout{:}] = find (reshape (f(uint8(str) + 1), size (str)), varargin{:});
endfunction


I found this bug by doing this:
  warning error Octave:str-to-num
  oldpath = path;
  path(oldpath);
If the octave-octcdf package is installed this will fail.


Regards,
Kim Hansen


-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages octave3.2 depends on:
ii  libamd2.2.0         1:3.4.0-2            approximate minimum degree orderin
ii  libarpack2          2.1+parpack96.dfsg-3 Fortran77 subroutines to solve lar
ii  libatlas3gf-base [l 3.8.3-28             Automatically Tuned Linear Algebra
ii  libblas3gf [libblas 1.2-8                Basic Linear Algebra Reference imp
ii  libbz2-1.0          1.0.5-6              high-quality block-sorting file co
ii  libc6               2.11.2-7             Embedded GNU C Library: Shared lib
ii  libcamd2.2.0        1:3.4.0-2            symmetric approximate minimum degr
ii  libccolamd2.7.1     1:3.4.0-2            constrained column approximate lib
ii  libcholmod1.7.1     1:3.4.0-2            sparse Cholesky factorization libr
ii  libcolamd2.7.1      1:3.4.0-2            column approximate minimum degree 
ii  libcurl3-gnutls     7.21.2-1             Multi-protocol file transfer libra
ii  libcxsparse2.2.3    1:3.4.0-2            concise sparse matrix library (com
ii  libfftw3-3          3.2.2-1              library for computing Fast Fourier
ii  libfltk1.1          1.1.10-2+b1          Fast Light Toolkit - shared librar
ii  libfreetype6        2.4.2-2              FreeType 2 font engine, shared lib
ii  libftgl2            2.1.3~rc5-3          library to render text in OpenGL u
ii  libgcc1             1:4.4.5-6            GCC support library
ii  libgfortran3        4.4.5-6              Runtime library for GNU Fortran ap
ii  libgl1-mesa-glx [li 7.7.1-4              A free implementation of the OpenG
ii  libglpk0            4.43-1               linear programming kit with intege
ii  libglu1-mesa [libgl 7.7.1-4              The OpenGL utility library (GLU)
ii  libgomp1            4.4.5-6              GCC OpenMP (GOMP) support library
ii  libgraphicsmagick++ 1.3.12-1+b1          format-independent image processin
ii  libgraphicsmagick3  1.3.12-1+b1          format-independent image processin
ii  libhdf5-serial-1.8. 1.8.4-patch1-2       Hierarchical Data Format 5 (HDF5) 
ii  libice6             2:1.0.6-2            X11 Inter-Client Exchange library
ii  libjasper1          1.900.1-7+b1         The JasPer JPEG-2000 runtime libra
ii  libjpeg62           6b1-1                The Independent JPEG Group's JPEG 
ii  liblapack3gf [libla 3.2.2-1              library of linear algebra routines
ii  liblcms1            1.18.dfsg-1.2+b3     Color management library
ii  libltdl7            2.2.6b-2             A system independent dlopen wrappe
ii  libncurses5         5.7+20100313-4       shared libraries for terminal hand
ii  libpcre3            8.02-1.1             Perl 5 Compatible Regular Expressi
ii  libpng12-0          1.2.44-1             PNG library - runtime
ii  libqhull5           2009.1-1             calculate convex hulls and related
ii  libqrupdate1        1.0.1-1              Fast updates of QR and Cholesky de
ii  libreadline6        6.1-3                GNU readline and history libraries
ii  libsm6              2:1.2.0-1            X11 Session Management library
ii  libstdc++6          4.4.5-6              The GNU Standard C++ Library v3
ii  libtiff4            3.9.4-5              Tag Image File Format (TIFF) libra
ii  libumfpack5.4.0     1:3.4.0-2            sparse LU factorization library
ii  libwmf0.2-7         0.2.8.4-6.1+b1       Windows metafile conversion librar
ii  libx11-6            2:1.3.3-3            X11 client-side library
ii  libxext6            2:1.1.2-1            X11 miscellaneous extension librar
ii  libxml2             2.7.8.dfsg-1         GNOME XML library
ii  octave3.2-common    3.2.4-8              architecture-independent files for
ii  texinfo             4.13a.dfsg.1-6       Documentation system for on-line i
ii  zlib1g              1:1.2.3.4.dfsg-3     compression library - runtime

Versions of packages octave3.2 recommends:
ii  gnuplot                       4.4.0-1.1  A command-line driven interactive 
ii  libatlas3gf-base              3.8.3-28   Automatically Tuned Linear Algebra

Versions of packages octave3.2 suggests:
pn  octave3.2-doc                 <none>     (no description available)
pn  octave3.2-emacsen             <none>     (no description available)
ii  octave3.2-headers             3.2.4-8    header files for the GNU Octave la
pn  octave3.2-htmldoc             <none>     (no description available)
pn  octave3.2-info                <none>     (no description available)

-- no debconf information





More information about the Pkg-octave-devel mailing list