Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wake crashes on bad input source #1425

Open
ngraybeal opened this issue Sep 21, 2023 · 1 comment
Open

wake crashes on bad input source #1425

ngraybeal opened this issue Sep 21, 2023 · 1 comment
Assignees

Comments

@ngraybeal
Copy link

I was able to crash Wake language server in Vscode with the following code.

Wake Version: 38.0.0

Running wake gives the following error.
wake/wakebox/runners/rhel8-slurm-runner.wake:210:9: multi-argument match requires a multi-argument pattern

Error:

RuntimeError: memory access out of bounds
    at wasm://wasm/007a1372:wasm-function[403]:0xcc52a
    at wasm://wasm/007a1372:wasm-function[403]:0xcbacd
    at wasm://wasm/007a1372:wasm-function[372]:0xbb3b0
    at wasm://wasm/007a1372:wasm-function[372]:0xbc810
    at wasm://wasm/007a1372:wasm-function[372]:0xbc94a
    at wasm://wasm/007a1372:wasm-function[581]:0x12dac1
    at wasm://wasm/007a1372:wasm-function[565]:0x10bd75
    at wasm://wasm/007a1372:wasm-function[558]:0x10782d
[Error - 4:08:01 PM] Request textDocument/definition failed.
  Message: Request textDocument/definition failed with message: memory access out of bounds
  Code: -32603 

Bad code

def foo =
    def bar =
        "apple"
    require Pass (Pair extra base) = match tokenize `-` bar
        (d, h, Nil) -> Pass (Pair d h)
        (h, Nil) -> Pass (Pair "" h)
        _ -> failWithError "Wrong Format"

Good Code

def foo =
    def bar =
        "apple"
    require Pass (Pair extra base) = match (tokenize `-` bar)
        (d, h, Nil) -> Pass (Pair d h)
        (h, Nil) -> Pass (Pair "" h)
        _ -> failWithError "Wrong Format"
@V-FEXrt V-FEXrt self-assigned this Oct 3, 2023
@V-FEXrt V-FEXrt changed the title VSCode Wake extension Language server crash wake crashes on bad input source Oct 4, 2023
@V-FEXrt
Copy link
Collaborator

V-FEXrt commented Oct 4, 2023

Looks like this isn't specific to the LSP, running wake -x Unit with this file will also crash wake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants