[Pkg-octave-devel] Bug#770192: octave: mkoctfile -M infinite loop maybe because (char)c != EOF

Edmund Grimley Evans edmund.grimley.evans at gmail.com
Wed Nov 19 15:37:46 UTC 2014


Source: octave
Version: 3.8.2-3

On arm64 mkoctfile -M goes into an infinite loop:

echo > t.c
mkoctfile -M t.c
# it runs for ever

This may be because of this code in src/mkoctfile.in.cc:

get_line (FILE *fp)
{
  static std::vector<char> buf (100);
  unsigned int idx = 0;
  char c;

  while (true)
    {
      c = static_cast<char> (gnulib::fgetc (fp));
      if (c == '\n' || c == EOF)
        break;

On architectures where plain char is unsigned, c == EOF will always be
false. I suggest changing the type of c and the static_cast to "int".

Note that vlfeat is failing to build on arm64 apparently because of
mkoctfile -M timing out:

/usr/bin/mkoctfile -I. -I./toolbox -M "./toolbox/geometry/vl_rodr.c"
E: Caught signal ‘Terminated’: terminating immediately
make: *** [build-arch] Terminated

See:

http://buildd.debian.org/status/package.php?p=vlfeat&suite=sid

Would it be worth adding a simple test to octave so that this problem
with mkoctfile is discovered when building octave rather than later?



More information about the Pkg-octave-devel mailing list