joefitzgerald / go-plus

An Enhanced Go Experience For The Atom Editor
https://atom.io/packages/go-plus
Other
1.51k stars 129 forks source link

Uncaught RangeError: Invalid string length #537

Open calvn opened 7 years ago

calvn commented 7 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.12.8 Electron Version: 1.3.13 System: Mac OS X 10.12.2 Thrown From: go-plus package, v5.0.9

Stack Trace

Uncaught RangeError: Invalid string length

At /Users/cleung/.dotfiles/atom.symlink/packages/go-plus/lib/config/executor.js:56

RangeError: Invalid string length
    at stdoutFn (/Users/cleung/.dotfiles/atom.symlink/packages/go-plus/lib/config/executor.js:56:21)
    at Socket.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:87:13)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:543:20)

Commands

     -2:05.7.0 editor:toggle-line-comments (atom-text-editor.editor.is-focused)
     -2:05.0 core:save (atom-text-editor.editor.is-focused)
  9x -1:40.6.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:27.6.0 autocomplete-plus:confirm (atom-text-editor.editor.is-focused.autocomplete-active)
  3x -1:21.7.0 core:move-right (atom-text-editor.editor.is-focused.autocomplete-active)
     -1:20.6.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:19.1.0 core:save (atom-text-editor.editor.is-focused.autocomplete-active.hyperclick)
     -0:55.1.0 core:cut (atom-text-editor.editor.is-focused)
     -0:54 core:save (atom-text-editor.editor.is-focused.autocomplete-active)
  2x -0:51.3.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:46.7.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:45.1.0 core:paste (atom-text-editor.editor.is-focused)
  2x -0:41.8.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:34.4.0 editor:newline (atom-text-editor.editor.is-focused)
     -0:33.7.0 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
  2x -0:32.5.0 core:save (atom-text-editor.editor.is-focused.autocomplete-active)

Config

{
  "core": {
    "telemetryConsent": "limited"
  },
  "go-plus": {}
}

Installed Packages

# User
go-debug, v1.0.1 (active)
go-plus, v5.0.9 (active)
go-signature-statusbar, v1.2.0 (active)
hyperclick, v0.0.39 (active)
linter, v1.11.18 (active)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.45.0 (inactive)
base16-tomorrow-dark-theme, v1.3.0 (inactive)
base16-tomorrow-light-theme, v1.3.0 (inactive)
one-dark-ui, v1.6.2 (active)
one-light-ui, v1.6.2 (inactive)
one-dark-syntax, v1.5.0 (active)
one-light-syntax, v1.5.0 (inactive)
solarized-dark-syntax, v1.0.5 (inactive)
solarized-light-syntax, v1.0.5 (inactive)
about, v1.7.0 (active)
archive-view, v0.62.0 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.13.1 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.4 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.42.0 (active)
bracket-matcher, v0.82.2 (active)
command-palette, v0.39.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.40.0 (active)
find-and-replace, v0.202.2 (active)
fuzzy-finder, v1.4.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.2 (active)
image-view, v0.60.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.2 (inactive)
markdown-preview, v0.158.8 (active)
metrics, v1.1.2 (active)
notifications, v0.65.1 (active)
open-on-github, v1.2.1 (inactive)
package-generator, v1.0.1 (inactive)
settings-view, v0.243.1 (active)
snippets, v1.0.4 (active)
spell-check, v0.68.4 (active)
status-bar, v1.4.1 (active)
styleguide, v0.47.2 (active)
symbols-view, v0.113.1 (inactive)
tabs, v0.103.0 (active)
timecop, v0.33.2 (active)
tree-view, v0.210.0 (active)
update-package-dependencies, v0.10.0 (active)
welcome, v0.35.1 (active)
whitespace, v0.35.0 (active)
wrap-guide, v0.38.2 (active)
language-c, v0.54.0 (active)
language-clojure, v0.22.1 (active)
language-coffee-script, v0.48.0 (active)
language-csharp, v0.13.0 (active)
language-css, v0.40.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.43.0 (active)
language-html, v0.47.1 (active)
language-hyperlink, v0.16.1 (active)
language-java, v0.24.0 (active)
language-javascript, v0.122.0 (active)
language-json, v0.18.3 (active)
language-less, v0.29.6 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.37.0 (active)
language-php, v0.37.3 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.1 (active)
language-ruby, v0.70.2 (active)
language-ruby-on-rails, v0.25.1 (active)
language-sass, v0.57.0 (active)
language-shellscript, v0.23.0 (active)
language-source, v0.9.0 (active)
language-sql, v0.25.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.29.1 (active)
language-toml, v0.18.1 (active)
language-xml, v0.34.12 (active)
language-yaml, v0.27.1 (active)

# Dev
No dev packages
lloiser commented 7 years ago

After a quick search this error seems to happen if you have a really (!!!) long string (> 256MB, see constant in node/v8). A related issue can be found here: https://github.com/nodejs/node/issues/3175

What did you do that could have caused such a massive output? Running tests with verbose flag?

I don't think we can do anything here (beside better error handling)...

calvn commented 7 years ago

That error was caused by a stack overflow

runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow
gmmeyer commented 6 years ago

If this error throws once, it keeps throwing until Atom crashes. It's pretty serious and needs to be resolved.

gmmeyer commented 6 years ago

Now, it's my fault for accidentally logging a gigantic object, but at the same time that should not crash the editor.

eblock-fw commented 6 years ago

This error (and the related perpetual throwing until crash) can also be caused by logging in a frequently-repeating (e.g. infinite or very large) loop.

For my case (log in loop), it would be better to handle by terminating program execution and logging an error to the console.

tomjowitt commented 6 years ago

I caused this error by introducing an infinite loop and because the test suite runs on each save it kept crashing Atom before I could debug and fix the loop. Completely my fault but it would be nice if go-plus handled this without crashing.

halfrost commented 6 years ago

[Enter steps to reproduce:]

  1. ...
  2. ...

Atom: 1.21.2 x64 Electron: 1.6.15 OS: Mac OS X 10.13.1 Thrown From: go-plus package 5.6.0

Stack Trace

Uncaught RangeError: Invalid string length

At /Users/YDZ/.atom/packages/go-plus/lib/config/executor.js:64

RangeError: Invalid string length
    at stdoutFn (/packages/go-plus/lib/config/executor.js:64:21)
    at Socket.<anonymous> (/Applications/Atom.app/Contents/Resources/app/src/buffered-process.js:212:17)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at readableAddChunk (_stream_readable.js:176:18)
    at Socket.Readable.push (_stream_readable.js:134:10)
    at Pipe.onread (net.js:551:20)

Commands

  2x -0:46.2.0 core:backspace (input.hidden-input)
     -0:44.4.0 core:save (input.hidden-input)
  8x -0:07.8.0 core:copy (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)

Non-Core Packages

atom-beautify 0.30.6 
atom-material-ui 2.0.6 
busy-signal 1.4.3 
esformatter 2.3.0 
go-debug 1.5.2 
go-plus 5.6.0 
go-signature-statusbar 1.2.3 
hyperclick 0.1.5 
intentions 1.1.5 
js-hyperclick 1.12.1 
language-vue 0.23.1 
last-cursor-position 0.9.2 
linter 2.2.0 
linter-ui-default 1.6.10 
minimap 4.29.7 
nucleus-dark-ui 0.12.3 
platformio-ide-terminal 2.7.0 
seti-icons 1.5.4 
seti-syntax 1.1.3 
seti-ui 1.9.0 
sync-settings 0.8.3 
vue-autocomplete 0.1.1 
vue-hyperclick 0.2.0 
vue2-autocomplete 0.1.0-alpha.4 
weex-format 1.0.2 
BrendonW commented 5 years ago

The real issue here is that the entire Editor crashes if you hit this limit. That makes it very difficult to debug why your test is spewing so much information. Can this not be headed off or caught in a way that lets the Editor continue running?