atom-haskell-archive / haskell-ghc-mod

haskell-ghc-mod atom package
https://atom.io/packages/haskell-ghc-mod
MIT License
69 stars 20 forks source link

Haskell-ghc-mod: ghc-mod interactive command type failed with error ghc-modi crashed #89

Closed lwdye closed 8 years ago

lwdye commented 8 years ago

[Enter steps to reproduce below:]

Occured during active editing.

Atom Version: 1.3.3 System: Mac OS X 10.10.5 Thrown From: haskell-ghc-mod package, v1.5.6

Stack Trace

Haskell-ghc-mod: ghc-mod interactive command type failed with error ghc-modi crashed

At caps: {"version":[5,4,0,0],"legacyInteractive":true,"fileMap":true,"rootExec":true,"quoteArgs":false}
URI: /Users/lwdye/qp/haskell/pami/src/PITCH/Parser.hs
Args: 43,1
message: 
log:
-0.305s: getProcessOptions(/Users/lwdye/qp/haskell/pami)
-0.304s: PATH = /Users/lwdye/google-cloud-sdk/bin:/Users/lwdye/.local/bin:/Users/lwdye/.cabal/bin:/Users/lwdye/Library/Haskell/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
-0.303s: Trying to run ghc-modi in /Users/lwdye/qp/haskell/pami
-0.303s: Checking for ghc-modi in /Users/lwdye/qp/haskell/pami
-0.303s: Found running ghc-modi instance for /Users/lwdye/qp/haskell/pami
-0.302s: Started interactive action block in /Users/lwdye/qp/haskell/pami
-0.301s: Running ghc-modi command info,src/PITCH/Parser.hs,import           Control.Monad
import           Control.Exception (assert)
import           Data.Int
import           Data.Word
import           Data.ByteString (ByteString,length,empty,append,takeWhile,readFile,writeFile,appendFile)
import           qualified Data.ByteString.Lazy
import           GHC.Generics (Generic)
import           PITCH.Types
--import           Text.Bytedump
import           Data.Either.Unwrap
import           Debug.Trace
import           Numeric
import           Data.List
import           System.CPUTime
import           Text.Printf
--import           Control.Parallel.Strategies
import           Data.Sequence
import           Data.Map.Strict
import           Data.IntMap.Strict
import           Data.Set
import           Data.IntSet
import           Data.List.Split
import           qualified Data.ByteString.Char8 as C
import           Codec.Compression.GZip
import           Data.Serialize
import           Data.Serialize.Get (getInt8)

-0.036s: ghc-modi said: EXCEPTION: info:     parse error on input ‘import’
-0.036s: Got response from ghc-modi:
Cannot show info
OK

-0.036s: Ended interactive action block in /Users/lwdye/qp/haskell/pami
-0.035s: getProcessOptions(/Users/lwdye/qp/haskell/pami)
-0.035s: PATH = /Users/lwdye/google-cloud-sdk/bin:/Users/lwdye/.local/bin:/Users/lwdye/.cabal/bin:/Users/lwdye/Library/Haskell/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
-0.035s: Trying to run ghc-modi in /Users/lwdye/qp/haskell/pami
-0.035s: Checking for ghc-modi in /Users/lwdye/qp/haskell/pami
-0.035s: Found running ghc-modi instance for /Users/lwdye/qp/haskell/pami
-0.035s: Started interactive action block in /Users/lwdye/qp/haskell/pami
-0.035s: Running ghc-modi command type,src/PITCH/Parser.hs,43,1
-0.034s: ghc-modi said: ghc-mod: unknown command: `import'
-0.001s: ghc-modi for /Users/lwdye/qp/haskell/pami ended with 1
-0.001s: ghc-modi for /Users/lwdye/qp/haskell/pami ended with 1
-0.001s: Running ghc-modi command unmap-file,src/PITCH/Parser.hs
-0.001s: ghc-modi crashed

ghc-modi crashed
    at module.exports.Util.mkError (/Users/lwdye/.atom/packages/haskell-ghc-mod/lib/util.coffee:97:15)
    at ChildProcess.exitCallback (/Users/lwdye/.atom/packages/haskell-ghc-mod/lib/ghc-mod/interactive-process.coffee:76:20)
    at emitTwo (events.js:92:20)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

Commands

     -1:47.6.0 core:save (atom-text-editor.editor.is-focused)
 14x -1:32.4.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:30 core:save (atom-text-editor.editor.is-focused)
 13x -1:24.7.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:22.4.0 core:save (atom-text-editor.editor.is-focused)
 13x -1:19.7.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:17.7.0 core:save (atom-text-editor.editor.is-focused)
 13x -1:14.2.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:11.9.0 core:save (atom-text-editor.editor.is-focused)
     -1:11.3.0 core:move-down (atom-text-editor.editor.is-focused)
 13x -1:10.8.0 core:move-right (atom-text-editor.editor.is-focused)
 13x -1:08.5.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:06.0 core:save (atom-text-editor.editor.is-focused)
     -0:38 editor:newline (atom-text-editor.editor.is-focused)
     -0:37.3.0 core:save (atom-text-editor.editor.is-focused)
     -0:35.2.0 core:move-up (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "script",
      "ide-haskell-cabal"
    ]
  },
  "haskell-ghc-mod": {
    "ghcModPath": "/Users/lwdye/.local/bin/ghc-mod",
    "ghcModiPath": "/Users/lwdye/.local/bin/ghc-modi"
  }
}

Installed Packages

# User
atom-beautify, v0.28.20
atom-json-editor, v0.4.1
autocomplete-haskell, v0.6.2
haskell-ghc-mod, v1.5.6
ide-haskell, v1.3.9
language-haskell, v1.5.2
language-java, v0.17.0
language-mathematica, v0.1.0
react, v0.12.10

# Dev
No dev packages
lwdye commented 8 years ago

Error occurred again just as a block of code was highlighted or perhaps just on focus to edit pane. There are two haskell panes open (probably unrelated).

lierdakil commented 8 years ago

Okay... apparently you just tried to get info of a whole block of imports. Doesn't matter if it was intentional or not. Problem is, apparently your source file doesn't use your platform-specific newline characters, so part of argument escapes outside the command.

So, v1.5.7 should try harder to remove anything resembling newlines from user input. Let me know if you run into something like this again.

lwdye commented 8 years ago

Thank you. Both issues #87 and #89 look stable.

From: Nikolay Yakimov Reply-To: atom-haskell/haskell-ghc-mod Date: Monday, January 11, 2016 at 1:20 PM To: atom-haskell/haskell-ghc-mod Cc: Lester Dye Subject: Re: [haskell-ghc-mod] Haskell-ghc-mod: ghc-mod interactive command type failed with error ghc-modi crashed (#89)

Okay... apparently you just tried to get info of a whole block of imports. Doesn't matter if it was intentional or not. Problem is, apparently your source file doesn't use your platform-specific newline characters, so part of argument escapes outside the command.

So, v1.5.7 should try harder to remove anything resembling newlines from user input. Let me know if you run into something like this again.

— Reply to this email directly or view it on GitHubhttps://github.com/atom-haskell/haskell-ghc-mod/issues/89#issuecomment-170678028.