facebookarchive / nuclide

An open IDE for web and native mobile development, built on top of Atom
https://nuclide.io
Other
7.79k stars 683 forks source link

Uncaught illegal access #534

Closed JohnyDays closed 8 years ago

JohnyDays commented 8 years ago

Hey, I recently updated my atom to 1.8 and nuclide to 0.141.0 and I started getting an uncaught illegal access error that crashes the editor most of the time, although sometimes atom manages to recover somehow.

  1. Open editor ( on a big project )
  2. Wait a few seconds

Atom Version: 1.8.0 System: linux 4.5.4-1-ARCH Thrown From: nuclide package, v0.141.0

Stack Trace

Uncaught illegal access

At /home/johnydays/.atom/packages/nuclide/pkg/commons-node/process.js:521

undefined

Commands

  7x -1:07.0 find-and-replace:select-next (atom-text-editor.editor.is-focused)
     -1:02.5.0 find-and-replace:select-skip (atom-text-editor.editor.is-focused)
     -1:01.4.0 find-and-replace:select-next (atom-text-editor.editor.is-focused)
     -1:00.2.0 core:move-left (atom-text-editor.editor.is-focused)
  3x -0:56.3.0 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:54.6.0 editor:select-to-beginning-of-word (atom-text-editor.editor.is-focused.autocomplete-active.hyperclick)
     -0:52.7.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:51.8.0 editor:select-to-end-of-word (atom-text-editor.editor.is-focused)
     -0:51.5.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:50.6.0 editor:move-to-beginning-of-word (atom-text-editor.editor.is-focused)
     -0:49.1.0 core:backspace (atom-text-editor.editor.is-focused.autocomplete-active)
  2x -0:41.4.0 core:save (atom-text-editor.editor.is-focused)
     -0:30 editor:newline (atom-text-editor.editor.is-focused)
  3x -0:26.3.0 find-and-replace:select-next (atom-text-editor.editor.is-focused)
  7x -0:24.2.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:20.4.0 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "autoHideMenuBar": true,
    "customFileTypes": {
      "source.ini": [
        ".buckconfig",
        ".flowconfig"
      ],
      "source.json": [
        ".arcconfig",
        "BUCK.autodeps"
      ],
      "source.python": [
        "BUCK"
      ]
    },
    "disabledPackages": [
      "tree-view",
      "nuclide-blame-provider-hg",
      "nuclide-hg-repository",
      "hyperclick",
      "linter"
    ]
  },
  "nuclide": {
    "nuclide-arcanist": {},
    "nuclide-buck-files": {},
    "nuclide-clang-atom": {},
    "nuclide-console": {},
    "nuclide-datatip": {},
    "nuclide-debugger-hhvm": {},
    "nuclide-diagnostics-store": {
      "legacyLintOnTheFly": true
    },
    "nuclide-file-tree": {
      "revealFileOnSwitch": true
    },
    "nuclide-flow": {
      "diagnosticsOnFly": true,
      "enableStructuredTypeHints": true
    },
    "nuclide-format-js": {},
    "nuclide-hack": {},
    "nuclide-health": {},
    "nuclide-home": {
      "showHome": false
    },
    "nuclide-ios-simulator-logs": {},
    "nuclide-ocaml": {},
    "nuclide-output": {},
    "nuclide-react-native": {},
    "nuclide-working-sets": {},
    "use": {
      "nuclide-adb-logcat": false,
      "nuclide-buck-files": false,
      "nuclide-buck-toolbar": false,
      "nuclide-debugger-hhvm": false,
      "nuclide-hack": false,
      "nuclide-hhvm-toolbar": false,
      "nuclide-language-hack": false
    }
  }
}

Installed Packages

# User
atom-jade, v0.3.0
autocomplete-js-import, v1.0.1
editorconfig, v1.4.1
haskell-grammar, v0.4.0
highlight-selected, v0.11.2
language-babel, v2.26.3
language-gradle, v0.0.3
language-ini, v1.16.0
language-nginx, v0.6.1
language-ocaml, v1.1.2
language-thrift, v1.0.2
linter-eslint, v7.2.2
linter-php, v1.2.0
nuclide, v0.141.0
tool-bar, v0.4.0

# Dev
No dev packages
nmote commented 8 years ago

What sorts of files are you working on?

There is an issue with Flow that can manifest this way when Nuclide asks for type coverage results in certain cases. More details on my pull request to fix it here: https://github.com/facebook/flow/pull/1903. We also need this PR in to fix this in Nuclide: https://github.com/facebook/flow/pull/1904.

Once those are released we can start using the coverage command rather than dump-types and avoid this problem (assuming, of course, that this is the same problem).

In the mean time, you can disable the "nuclide-type-coverage" feature in the Nuclide settings which should mitigate the problem (again, assuming it's the same one I've seen).

JohnyDays commented 8 years ago

Yeah it definitely is flow related, because I have changed around my types, and it isn't happening anymore. As well as it not happening with my other projects.

I have quite a significant amount of types in my code, but the most relevant ones I changed when it stopped happening was that, I had around ~10 polymorphic types in several files that had the incorrect amount of type arguments, and I have corrected those.

I'm not sure if they were causing the crashes however, but that's the most relevant thing I can remember.

EDIT: It might be relevant to say that I'm using flow compiled from master, from yesterday's state

nmote commented 8 years ago

Thanks for the info. No, Flow compiled from master will still have this problem. It will only be solved when Nuclide can stop calling dump-types for coverage info which will have to wait until the release of Flow v0.28, it looks like. And then, Nuclide doesn't currently have the machinery to call different commands based on the Flow version, so I'll either have to build that or wait to switch over by default until we want to stop supporting earlier versions of Flow.

This only happens in pathological cases where the string versions of inferred Flow types are enormous. It's not surprising that changing around your types made this problem disappear.

JohnyDays commented 8 years ago

I do have types whose string representation is several paragraphs long 😢