edelvalle / SuperElixir

This is a sublime plug-in that provide IDE like capabilities to sublime when working with the Elixir language.
GNU Lesser General Public License v3.0
31 stars 4 forks source link

SublimeText locking up #11

Open jeffdeville opened 6 years ago

jeffdeville commented 6 years ago

I'm getting hard lockups in sublime. If there's a rhyme or reason for what is triggering them, I haven't managed to identify it yet. I'll just be typing, and then beach ball. I suppose the most likely case is a crash on linting, because I've had it crash when I switch to my browser, and can't get back to sublime.

I've cloned master into my plugins directory, but haven't played with sublime plugins much. Is there a way to write the log output to a file instead of the console (that I can't see)? If so, any best practices for helping debug? (I realize I haven't given much to go on)

edelvalle commented 6 years ago

Hi @jeffdeville, right now I'm in a "almost non-internet" country. But if you use prints you could see in the terminal, or write your own logger in Python you should be able to log to a file.

I will try to check this problem any way.

Cheers

jeffdeville commented 6 years ago

Thanks for checking in, @edelvalle. No rush. I do have some new info. The problem is that elixir_sense itself seems to be crashing. If I kill that process, sublime comes back. (Now maybe the processes are linked, and I'm still wrong). Nevertheless, killing the process lets me look at the console. Which... I didn't dig through yesterday because I had a release. But now that I know how to collect more info, I'll hopefully be able to help at least diagnose the cause more completely.

jeffdeville commented 6 years ago

== Compilation error in file lib/pubsub_contracts/polling_server.ex ==
** (TokenMissingError) lib/pubsub_contracts/polling_server.ex:86: missing terminator: end (for "do" starting at line 1)
    (elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6

<_sre.SRE_Match object at 0x10845d1a0> 85 None error None missing terminator: end (for "do" starting at line 1) end
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 591, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/autocomplete.py", line 40, in on_query_completions
    if s['type'] == 'hint':
TypeError: string indices must be integers
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 591, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/autocomplete.py", line 40, in on_query_completions
    if s['type'] == 'hint':
TypeError: string indices must be integers
Compiling 10 files (.ex)

== Compilation error in file lib/pubsub_contracts/polling_server.ex ==
** (TokenMissingError) lib/pubsub_contracts/polling_server.ex:86: missing terminator: end (for "do" starting at line 1)
    (elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6

<_sre.SRE_Match object at 0x10845d1a0> 85 None error None missing terminator: end (for "do" starting at line 1) end
Compiling 10 files (.ex)

== Compilation error in file lib/pubsub_contracts/polling_server.ex ==
** (TokenMissingError) lib/pubsub_contracts/polling_server.ex:86: missing terminator: end (for "do" starting at line 1)
    (elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6

<_sre.SRE_Match object at 0x10845d1a0> 85 None error None missing terminator: end (for "do" starting at line 1) end
Traceback (most recent call last):
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/erlang.py", line 325, in binary_to_term
    i, term = _binary_to_term(1, data)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/erlang.py", line 480, in _binary_to_term
    i, value = _binary_to_term(i, data)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/erlang.py", line 415, in _binary_to_term
    i, tmp = _binary_to_term_sequence(i, length, data)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/erlang.py", line 528, in _binary_to_term_sequence
    i, element = _binary_to_term(i, data)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/erlang.py", line 479, in _binary_to_term
    i, key = _binary_to_term(i, data)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/erlang.py", line 355, in _binary_to_term
    tag = b_ord(data[i])
IndexError: index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 591, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/autocomplete.py", line 35, in on_query_completions
    suggestions = sense.suggestions(buffer, line, column)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/sense_client.py", line 160, in suggestions
    column=column,
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/sense_client.py", line 115, in _send_request
    data = decode_term(erlang.binary_to_term(response))
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/erlang.py", line 332, in binary_to_term
    raise ParseException('missing data')
  File "<string>", line None
SuperElixir.super_elixir.erlang.ParseException: <no detail available>
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 591, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/autocomplete.py", line 35, in on_query_completions
    suggestions = sense.suggestions(buffer, line, column)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/sense_client.py", line 160, in suggestions
    column=column,
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/sense_client.py", line 115, in _send_request
    data = decode_term(erlang.binary_to_term(response))
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/erlang.py", line 323, in binary_to_term
    raise ParseException('invalid version')
  File "<string>", line None
SuperElixir.super_elixir.erlang.ParseException: <no detail available>
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 591, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/autocomplete.py", line 35, in on_query_completions
    suggestions = sense.suggestions(buffer, line, column)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/sense_client.py", line 160, in suggestions
    column=column,
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/sense_client.py", line 109, in _send_request
    self._socket.send(header + payload)
BrokenPipeError: [Errno 32] Broken pipe
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 591, in on_query_completions
    res = callback.on_query_completions(v, prefix, locations)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/autocomplete.py", line 35, in on_query_completions
    suggestions = sense.suggestions(buffer, line, column)
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/sense_client.py", line 160, in suggestions
    column=column,
  File "/Users/jeff/Library/Application Support/Sublime Text 3/Packages/SuperElixir/super_elixir/sense_client.py", line 109, in _send_request
    self._socket.send(header + payload)
BrokenPipeError: [Errno 32] Broken pipe
Compiling 10 files (.ex)

== Compilation error in file lib/pubsub_contracts/polling_server.ex ==
** (TokenMissingError) lib/pubsub_contracts/polling_server.ex:87: missing terminator: end (for "do" starting at line 1)
    (elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6

<_sre.SRE_Match object at 0x10845d310> 86 None error None missing terminator: end (for "do" starting at line 1) None
jeffdeville commented 6 years ago

I think the "Broken pipe" is where I killed elixir_sense. I'm guessing that your socket does a blocking receive? Then if ElixirSense locks up, then the reply is never sent? I'll try and look at it futher when things at work calm down a bit.

edelvalle commented 6 years ago

Yes, right now it works in blocking mode. I could improve it, but I'm not using the plugin right now and I have my forces focused somewhere else...

smpallen99 commented 6 years ago

any update on this issue? Its very annoying. I'm getting lockups every 10 - 30 minutes.