steelbrain / linter

A Base Linter with Cow Powers http://steelbrain.me/linter/
MIT License
1.1k stars 178 forks source link

Validate provider ranges for NaN #1116

Closed werner291 closed 8 years ago

werner291 commented 8 years ago

Hello! I tried to compile some C++ with atom-build, atom-build-cmake.

It gave a few errors, and then this uncaught exception, telling me to submit this error report. I'll see if I can hunt down the error a bit further.

Atom Version: 1.6.1 System: Mac OS X 10.10.5 Thrown From: linter package, v1.11.4

Stack Trace

Uncaught TypeError: Invalid Point: (26, NaN)

At /Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/point.js:63

TypeError: Invalid Point: (26, NaN)
    at Function.module.exports.Point.assertValid (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/point.js:63:15)
    at TextBuffer.module.exports.TextBuffer.clipPosition (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1021:13)
    at TextBuffer.module.exports.TextBuffer.clipRange (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1009:20)
    at MarkerLayer.module.exports.MarkerLayer.markRange (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker-layer.js:204:46)
    at TextEditorMarkerLayer.module.exports.TextEditorMarkerLayer.markBufferRange (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor-marker-layer.js:78:52)
    at DisplayBuffer.module.exports.DisplayBuffer.markBufferRange (/Applications/Atom.app/Contents/Resources/app.asar/src/display-buffer.js:1103:38)
    at TextEditor.module.exports.TextEditor.markBufferRange (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:1366:59)
    at /Users/werner/.atom/packages/linter/lib/editor-linter.js:50:34
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at EditorLinter.addMessage (/Users/werner/.atom/packages/linter/lib/editor-linter.js:137:20)
    at /Users/werner/.atom/packages/linter/lib/linter-views.js:104:22
    at Array.forEach (native)
    at LinterViews.notifyEditorLinters (/Users/werner/.atom/packages/linter/lib/linter-views.js:102:11)
    at LinterViews.render (/Users/werner/.atom/packages/linter/lib/linter-views.js:59:10)
    at /Users/werner/.atom/packages/linter/lib/linter.coffee:39:14
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at MessageRegistry.updatePublic (/Users/werner/.atom/packages/linter/lib/message-registry.js:84:18)
    at UpdateMessages (/Users/werner/.atom/packages/linter/lib/message-registry.js:24:16)

Commands

     -0:02.3.0 cmake:all (div.settings-view.pane-item)

Config

{
  "core": {
    "disabledPackages": [
      "symbols-plus"
    ],
    "packagesWithKeymapsDisabled": [
      "build-tools"
    ],
    "themes": [
      "atom-light-ui",
      "atom-light-syntax"
    ]
  },
  "linter": {}
}

Installed Packages

# User
autocomplete-clang, v0.8.9
build, v0.58.0
build-cmake, v0.3.3
build-tools, v4.3.4
command-toolbar, v1.0.12
linter, v1.11.4
symbol-gen, v1.0.0

# Dev
No dev packages
steelbrain commented 8 years ago

This is actually a bug in your linter provider, please reopen this in the provider repo

werner291 commented 8 years ago

Might I suggest that you add a checker that checks whether the linter provider gives you valid data?

That way you don't get blamed for the provider violating your method contract.

Also, you could add the name of the provider in the error message, which would be useful for debugging.

steelbrain commented 8 years ago

That is a good idea!

lexicalunit commented 8 years ago

Just got this today after updating the linter package to v1.11.5.

[Enter steps to reproduce below:]

  1. Open a python file.
  2. Lint.

Atom Version: 1.9.0-beta0 System: Mac OS X 10.11.5 Thrown From: linter package, v1.11.5

Stack Trace

Uncaught TypeError: Invalid Point: (21, NaN)

At /Users/me/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/point.js:63

TypeError: Invalid Point: (21, NaN)
    at Function.module.exports.Point.assertValid (/Users/me/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/point.js:63:15)
    at TextBuffer.module.exports.TextBuffer.clipPosition (/Users/me/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1080:13)
    at TextBuffer.module.exports.TextBuffer.clipRange (/Users/me/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1068:20)
    at MarkerLayer.module.exports.MarkerLayer.markRange (/Users/me/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/marker-layer.js:192:46)
    at DisplayMarkerLayer.module.exports.DisplayMarkerLayer.markBufferRange (/Users/me/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/display-marker-layer.js:74:62)
    at TextEditor.module.exports.TextEditor.markBufferRange (/Users/me/Applications/Atom Beta.app/Contents/Resources/app.asar/src/text-editor.js:1574:38)
    at /Users/me/.atom/packages/linter/lib/editor-linter.js:50:34
    at Function.module.exports.Emitter.simpleDispatch (/Users/me/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Users/me/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at EditorLinter.addMessage (/Users/me/.atom/packages/linter/lib/editor-linter.js:137:20)
    at /Users/me/.atom/packages/linter/lib/linter-views.js:104:22
    at Array.forEach (native)
    at LinterViews.notifyEditorLinters (/Users/me/.atom/packages/linter/lib/linter-views.js:102:11)
    at LinterViews.render (/Users/me/.atom/packages/linter/lib/linter-views.js:59:10)
    at /Users/me/.atom/packages/linter/lib/linter.coffee:39:14
    at Function.module.exports.Emitter.simpleDispatch (/Users/me/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Users/me/Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at MessageRegistry.updatePublic (/Users/me/.atom/packages/linter/lib/message-registry.js:84:18)
    at UpdateMessages (/Users/me/.atom/packages/linter/lib/message-registry.js:24:16)

Commands

Config

{
  "core": {
    "audioBeep": false,
    "disabledPackages": [
      "autocomplete",
      "exception-reporting",
      "autoflow",
      "autosave",
      "background-tips",
      "bookmarks",
      "encoding-selector",
      "language-toml",
      "metrics",
      "open-on-github",
      "styleguide",
      "update-package-dependencies",
      "welcome",
      "atom-pair",
      "rainbow-selection",
      "opened-files",
      "minimap-codeglance",
      "rst-preview-pandoc",
      "swackets",
      "todo-show",
      "symbols-tree-view",
      "wrap-guide",
      "language-python",
      "activate-power-mode"
    ],
    "themes": [
      "native-ui",
      "solarized-light-syntax"
    ]
  },
  "linter": {
    "lintOnChange": true,
    "lintOnFlyInterval": 10000
  }
}

Installed Packages

# User
activate-power-mode, v0.5.2 (inactive)
api-workbench, v0.8.30 (active)
atom-pair, v2.0.10 (inactive)
autocomplete-go, v1.1.0 (active)
autocomplete-python, v1.7.5 (active)
autoupdate-packages, v1.3.1 (active)
builder-go, v1.0.0 (active)
column-select, v0.2.0 (active)
cursor-indicator, v1.2.7 (active)
event-watch, v3.9.1 (active)
file-icons, v1.7.13 (active)
git-time-machine, v1.5.3 (inactive)
go-config, v1.1.4 (active)
go-get, v1.0.3 (active)
go-plus, v4.1.0 (active)
gofmt, v1.1.6 (active)
gometalinter-linter, v1.1.0 (active)
gorename, v1.0.2 (active)
gruvbox, v1.0.5 (inactive)
highlight-selected, v0.11.2 (active)
isotope-light-ui, v2.2.6 (inactive)
isotope-ui, v2.7.1 (inactive)
language-applescript, v0.2.2 (inactive)
language-cmake, v0.1.4 (active)
language-diff, v0.4.0 (active)
language-docker, v1.1.6 (active)
language-groovy, v0.6.0 (active)
language-json, v0.18.0 (active)
language-latex, v0.6.1 (active)
language-restructuredtext, v0.16.0 (active)
language-rust, v0.4.6 (active)
line-length-break, v0.4.0 (inactive)
linter, v1.11.5 (active)
linter-clang, v3.4.4 (active)
linter-coffeelint, v1.1.2 (active)
linter-csslint, v1.3.2 (active)
linter-docker, v0.1.2 (active)
linter-erb, v1.0.2 (active)
linter-flake8, v1.12.0 (active)
linter-jsonlint, v1.2.5 (active)
linter-just-say-no, v0.6.1 (active)
linter-raml, v0.2.2 (active)
linter-shellcheck, v1.2.0 (active)
linter-tidy, v2.1.1 (active)
linter-write-good, v0.6.1 (active)
MagicPython, v0.5.11 (active)
merge-conflicts, v1.4.4 (active)
minimap, v4.24.3 (active)
minimap-codeglance, v0.4.5 (inactive)
minimap-find-and-replace, v4.5.1 (active)
minimap-git-diff, v4.3.1 (active)
minimap-highlight-selected, v4.4.0 (active)
minimap-selection, v4.4.0 (active)
monokai, v0.18.0 (inactive)
multi-wrap-guide, v0.24.0 (active)
native-ui, v0.18.2 (active)
navigator-godef, v1.0.3 (active)
next-occurrence, v0.5.0 (inactive)
nvatom, v0.10.0 (active)
pretty-json, v1.4.1 (active)
python-isort, v0.0.7 (active)
python-yapf, v0.10.0 (active)
rainbow-selection, v0.3.1 (inactive)
raml, v0.2.0 (active)
red-wavy-underline, v0.3.0 (active)
rst-preview-pandoc, v0.1.12 (inactive)
script, v3.7.3 (inactive)
set-syntax, v0.3.0 (active)
soft-wrap-indicator, v0.7.0 (active)
sort-lines, v0.14.0 (inactive)
swackets, v0.10.0 (inactive)
symbols-tree-view, v0.13.2 (inactive)
tab-control, v0.6.9 (active)
tabs-to-spaces, v1.0.2 (active)
tester-go, v1.0.4 (active)
todo-show, v1.6.0 (inactive)
toggle-quotes, v1.0.0 (inactive)
trailing-spaces, v0.3.2 (active)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.51.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.43.0 (inactive)
base16-tomorrow-dark-theme, v1.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.3.2 (inactive)
one-light-ui, v1.3.2 (inactive)
one-dark-syntax, v1.2.0 (inactive)
one-light-syntax, v1.2.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (active)
about, v1.5.2 (active)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.11.1 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.0 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (inactive)
background-tips, v0.26.0 (inactive)
bookmarks, v0.41.0 (inactive)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (inactive)
exception-reporting, v0.38.1 (inactive)
fuzzy-finder, v1.2.0 (active)
git-diff, v1.0.1 (active)
find-and-replace, v0.198.0 (inactive)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (active)
image-view, v0.58.0 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
metrics, v0.53.1 (inactive)
notifications, v0.64.1 (active)
open-on-github, v1.1.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.238.0 (active)
snippets, v1.0.2 (active)
spell-check, v0.67.1 (active)
status-bar, v1.3.1 (active)
styleguide, v0.46.0 (inactive)
symbols-view, v0.113.0 (inactive)
tabs, v0.98.0 (active)
timecop, v0.33.1 (active)
tree-view, v0.208.0 (active)
update-package-dependencies, v0.10.0 (inactive)
welcome, v0.34.0 (inactive)
whitespace, v0.32.2 (active)
wrap-guide, v0.38.1 (inactive)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.0 (active)
language-csharp, v0.12.1 (active)
language-css, v0.36.2 (active)
language-gfm, v0.86.0 (active)
language-git, v0.13.0 (active)
language-go, v0.42.0 (active)
language-html, v0.44.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.22.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.0 (active)
language-less, v0.29.3 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.35.0 (active)
language-php, v0.37.0 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (inactive)
language-ruby, v0.68.5 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.52.0 (active)
language-shellscript, v0.22.3 (active)
language-source, v0.9.0 (active)
language-sql, v0.21.1 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (inactive)
language-xml, v0.34.8 (active)
language-yaml, v0.26.0 (active)

# Dev
No dev packages
lexicalunit commented 8 years ago

If this is caused by a linter provider, perhaps an atom notification indicating the problematic linter provider when the issue is detected so that the error isn't silently ignored forever.

Arcanemagus commented 8 years ago

@lexicalunit That's been reported in https://github.com/AtomLinter/linter-flake8/issues/196, earlier reports showed it happening on Linux, but it seems currently only OSX users are seeing it, if you could comment there with the debugging steps outlined in the last post that would be great as I have no OS X machine to test things on!

steelbrain commented 8 years ago

Done (not yet released, but closing anyway to keep only unresolved issues open for easy view)