RangeError: Offset is out of bounds
SevereOverfl0w opened this issue · 6 comments
Nvim version
❯ nvim --version
NVIM v0.1.6-5-g46475a1
Build type: Dev
Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -Wconversion -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/tmp/pkgbuild-0/neovim-git/src/neovim-git/build/config -I/tmp/pkgbuild-0/neovim-git/src/neovim-git/src -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/usr/include -I/tmp/pkgbuild-0/neovim-git/src/neovim-git/build/src/nvim/auto -I/tmp/pkgbuild-0/neovim-git/src/neovim-git/build/include
Compiled by aurbuild@localhost
Optional features included (+) or not (-): +acl +iconv +jemalloc +tui
For differences from Vim, see :help vim-differences
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
nvimdebug.log
Edited slightly.
Tue Aug 23 2016 13:59:00 GMT+0100 (BST) clj-refactor.js: hello refactor
Tue Aug 23 2016 13:59:00 GMT+0100 (BST) clj-refactor.js: {:op "clean-ns", :path "/home/dominic/src/foo.clj", :prefix-rewriting "true", :prune-ns-form "true"} null [ { status: [ 'done' ],
id: 'fireplace-localhost-1471957137-9',
session: 'a29f48d8-b785-4804-add2-8a2788b11bef',
ns: '(ns foo\n (:require [clojure.core.async :as async]\n [foo.database :as db]))\n' } ]
Tue Aug 23 2016 13:59:00 GMT+0100 (BST) clj-refactor.js: clean-ns [ { status: [ 'done' ],
id: 'fireplace-localhost-1471957137-9',
session: 'a29f48d8-b785-4804-add2-8a2788b11bef',
ns: '(ns foo\n (:require [clojure.core.async :as async]\n [foo.database :as db]))\n' } ]
Tue Aug 23 2016 13:59:00 GMT+0100 (BST) clj-refactor.js: save RangeError: Offset is out of bounds
at RangeError (native)
at Buffer.write (buffer.js:761:21)
at encode (/home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:25:13)
at /home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:76:20
at Array.reduce (native)
at encode (/home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:75:17)
at /home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:76:20
at Array.reduce (native)
at encode (/home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:75:17)
at /home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:76:20 RangeError: Offset is out of bounds
at RangeError (native)
at Buffer.write (buffer.js:761:21)
at encode (/home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:25:13)
at /home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:76:20
at Array.reduce (native)
at encode (/home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:75:17)
at /home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:76:20
at Array.reduce (native)
at encode (/home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:75:17)
at /home/dominic/.files/nvim/plugged/node-host/node_modules/msgpack5rpc/node_modules/msgpack5/lib/encoder.js:76:20
Occurs when running crcn, but also happens with other commands.
Any clues on where to start looking?
This is often an upstream problem. (working fine on my ~2mo old version of NVIM v0.1.5-508-g47a15d0).
I see there's been some node-client work over the last week: https://github.com/neovim/node-client The first step would be to see if those changes pulled into https://github.com/neovim/node-host fix the issue.
One of the projects on my backlog is to figure out if some ci tests could be created for node-host that verify the nvim->node-client->node-host dependency chain.
Tested node-client by doing:
diff --git a/package.json b/package.json
index 85e451d..172a490 100644
--- a/package.json
+++ b/package.json
@@ -38,6 +38,6 @@
"dependencies": {
"lodash.defaults": "^4.0.1",
"lodash.omit": "^4.1.0",
- "neovim-client": "^1.1.0"
+ "neovim-client": "neovim/node-client"
}
}rm -rfing my node_modules directory, and then npm install.
Verified that the version of neovim-client now pointed to the git version by looking for neovim/node-client@e205e9d these changes to the Makefile.
I just peeked into the msgpack5 repo, and noticed that there is this open issue: mcollina/msgpack5#42. The related commit is in an area close to where the exception is thrown for us (and it seems that our exception is thrown in an else case where it couldn't be anything else)
I will test loading in this commit.
Tested the commit. It has not helped. Further debugging of the code has shown that the failing encodings seem to be very long ones (e.g. the whole file, or the namespace region)
Those that work as normal are -1 or false, and arrays of these.
It occurs to me that perhaps this length is relevant in some way, but I don't entirely understand how. It might be that the encode function is generally failing with long strings, or that strings are failing to encode in some way.
I will try and spend some time isolating what isn't encoding with the function.
Minimal test case for msgpack5, it cannot handle empty arrays of strings.
msgpack = require('msgpack')();
var foosmall = [""];
msgpack.encode(foosmall, true)I will report this upstream.
Upstream Issue: mcollina/msgpack5#48
Thanks, I'll open related issues through the dependency chain.
Thanks @SevereOverfl0w Should be able to pull in msgpack5 3.4.1 with your fix now when you update node-host and deps.