Package: luajit
Version: 2.0.4+dfsg-1
Severity: important

Dear Maintainer,

Neovim's test suite was periodically failing on mipsel and after looking
into it, it turns out that luajit sometimes incorrectly handles
str:sub(i, j).

I instrumented the test to log the i, j, and size of the returned
string.  A snippet of the relevant code is below:

    local shift = 0
    while shift < #fcontents do
      local size = 3
      local s = fcontents:sub(shift + 1, shift + size)
      if shift + size < #fcontents then
        io.stdout:write('shift+1: '..(shift)..', shift+size: 
'..(shift+size)..', s: '..#s..'\n')
        eq(size, #s)
      end
      local wr = file_write(fp, s)
      eq(wr, #s)
      shift = shift + size
    end

fcontents is a string of 4096 bytes, which we take 3 bytes at a time and
write to a file.  Sometimes, this fails because fcontents:sub returns
the rest of the string instead of just the slice requested.  As an
example:

    …
    shift+1: 2931, shift+size: 2934, s: 3
    shift+1: 2934, shift+size: 2937, s: 3
    shift+1: 2937, shift+size: 2940, s: 3
    shift+1: 2940, shift+size: 2943, s: 1156
    not ok 192 - file_write can write the whole file by small chunks

The final call (fcontents:sub(2940, 2943)) returned a slice from 2940 →
4096 (1156 bytes).

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable')
Architecture: mipsel (mips)

Kernel: Linux 4.7.0-0.bpo.1-octeon (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

Versions of packages luajit depends on:
ii  libc6                 2.24-8
ii  libgcc1               1:6.2.1-5
ii  libluajit-5.1-common  2.0.4+dfsg-1

luajit recommends no packages.

luajit suggests no packages.

-- no debconf information

Cheers,
-- 
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7  2D23 DFE6 91AE 331B A3DB

Reply via email to