Skip to content

Denial of Service due to crash at initialization #180

@pvillads

Description

@pvillads

I am using the latest version of the code add-in (0.6.7). I am editing a simple file:
-module(test).
-export([factorial/1]).

factorial(0) -> 1;
factorial(N) -> N * factorial(N-1).

I have set the erlang path specifically to C:\Program Files\erl-23.2\bin.

When the system starts it displays the following in the output window. As far as I can see, this is an almost complete denial of service: Even though the colorizer does work, none of the commands do.

erlang extension is active
using erlang binaries from path : 'C:\Program Files\erl-23.2\bin'
starting : escript.exe
c:\Users\pvillads.vscode\extensions\pgourlain.erlang-0.6.7\rebar3 compile
===> Verifying dependencies...
===> Compiling vscode_lsp
escript.exe exit code:0
using erlang binaries from path : 'C:\Program Files\erl-23.2\bin'
starting : erl
-noshell -pa src -pa ebin -s int -vscode_port 52836 -s vscode_lsp_entry start 52836
Old inliner: threshold=0 functions=[{hex,1}]
Old inliner: threshold=0 functions=[{object_key,2}]
=ERROR REPORT==== 23-Dec-2020::13:42:18.337000 ===
LSP handler error error:badarg while executing lsp_handlers:initialize(_, #{capabilities =>
#{textDocument =>
#{codeAction =>
#{codeActionLiteralSupport =>
#{codeActionKind =>
#{valueSet =>
[<<>>,
<<"quickfix">>,
<<"refactor">>,
<<"refactor.extract">>,
<<"refactor.inline">>,
<<"refactor.rewrite">>,
<<"source">>,
<<"source.organizeImports">>]}},
dynamicRegistration =>
true},
codeLens =>
#{dynamicRegistration =>
true},
colorProvider =>
#{dynamicRegistration =>
true},
completion =>
#{completionItem =>
#{commitCharactersSupport =>
true,
deprecatedSupport =>
true,
documentationFormat =>
[<<"markdown">>,
<<"plaintext">>],
preselectSupport =>
true,
snippetSupport =>
true},
completionItemKind =>
#{valueSet =>
[1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25]},
contextSupport =>
true,
dynamicRegistration =>
true},
definition =>
#{dynamicRegistration =>
true},
documentHighlight =>
#{dynamicRegistration =>
true},
documentLink =>
#{dynamicRegistration =>
true},
documentSymbol =>
#{dynamicRegistration =>
true,
hierarchicalDocumentSymbolSupport =>
true,
symbolKind =>
#{valueSet =>
[1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26]}},
foldingRange =>
#{dynamicRegistration =>
true,
lineFoldingOnly =>
true,
rangeLimit =>
5000},
formatting =>
#{dynamicRegistration =>
true},
hover =>
#{contentFormat =>
[<<"markdown">>,
<<"plaintext">>],
dynamicRegistration =>
true},
implementation =>
#{dynamicRegistration =>
true},
onTypeFormatting =>
#{dynamicRegistration =>
true},
publishDiagnostics =>
#{relatedInformation =>
true},
rangeFormatting =>
#{dynamicRegistration =>
true},
references =>
#{dynamicRegistration =>
true},
rename =>
#{dynamicRegistration =>
true},
signatureHelp =>
#{dynamicRegistration =>
true,
signatureInformation =>
#{documentationFormat =>
[<<"markdown">>,
<<"plaintext">>]}},
synchronization =>
#{didSave =>
true,
dynamicRegistration =>
true,
willSave =>
true,
willSaveWaitUntil =>
true},
typeDefinition =>
#{dynamicRegistration =>
true}},
workspace =>
#{applyEdit =>
true,
configuration =>
true,
didChangeConfiguration =>
#{dynamicRegistration =>
true},
didChangeWatchedFiles =>
#{dynamicRegistration =>
true},
executeCommand =>
#{dynamicRegistration =>
true},
symbol =>
#{dynamicRegistration =>
true,
symbolKind =>
#{valueSet =>
[1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26]}},
workspaceEdit =>
#{documentChanges =>
true},
workspaceFolders =>
true}},
processId =>
28432,
rootPath =>
null,
rootUri =>
null,
trace =>
<<"off">>,
workspaceFolders =>
null}), stacktrace:[{erlang,
binary_to_list,
[null],
[]},
{lsp_handlers,
initialize,
2,
[{file,
"src/lsp_handlers.erl"},
{line,
10}]},
{gen_lsp_server,
safeApply,
3,
[{file,
"src/gen_lsp_server.erl"},
{line,
26}]},
{gen_lsp_server,
do_contents,
2,
[{file,
"src/gen_lsp_server.erl"},
{line,
104}]}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions