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

Crash in AST specifier #144

Open
lukaszsamson opened this issue Nov 14, 2022 · 5 comments
Open

Crash in AST specifier #144

lukaszsamson opened this issue Nov 14, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@lukaszsamson
Copy link

Env:
Erlang/OTP 25 [erts-13.1.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Elixir 1.14.2 (compiled with Erlang/OTP 25)
gradient version:
a9f1be9

Cannot load tokens: {:error, :enoent}
Cannot load tokens: {:error, :enoent}
Cannot load tokens: {:error, :enoent}
Cannot load tokens: {:error, :enoent}
Cannot load tokens: {:error, :enoent}
** (MatchError) no match of right hand side value: :error
    (gradient 0.1.0) lib/gradient/ast_specifier.ex:451: Gradient.AstSpecifier.spec_mapper/3
    (gradient 0.1.0) lib/gradient/ast_specifier.ex:69: Gradient.AstSpecifier.context_mapper_map/4
    (gradient 0.1.0) lib/gradient/ast_specifier.ex:96: Gradient.AstSpecifier.mapper/3
    (gradient 0.1.0) lib/gradient/ast_specifier.ex:82: Gradient.AstSpecifier.context_mapper_fold/4
    (gradient 0.1.0) lib/gradient/ast_specifier.ex:83: Gradient.AstSpecifier.context_mapper_fold/4
    (gradient 0.1.0) lib/gradient/ast_specifier.ex:53: Gradient.AstSpecifier.run_mappers/2
    (gradient 0.1.0) lib/gradient.ex:70: Gradient.handle_elixir_ast/2
    (elixir 1.14.2) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (elixir 1.14.2) lib/stream.ex:612: anonymous fn/4 in Stream.map/2
    (elixir 1.14.2) lib/enum.ex:4751: Enumerable.List.reduce/3
    (elixir 1.14.2) lib/stream.ex:1811: Enumerable.Stream.do_each/4
    (elixir 1.14.2) lib/stream.ex:1051: Stream.do_transform_inner_enum/7
    (elixir 1.14.2) lib/enum.ex:4307: Enum.reverse/1
    (elixir 1.14.2) lib/enum.ex:3646: Enum.to_list/1
    (gradient 0.1.0) lib/mix/tasks/gradient.ex:107: Mix.Tasks.Gradient.execute/2
    (gradient 0.1.0) lib/mix/tasks/gradient.ex:98: Mix.Tasks.Gradient.run/1
    (mix 1.14.2) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
    (mix 1.14.2) lib/mix/cli.ex:84: Mix.CLI.run_task/2
@erszcz erszcz added the bug Something isn't working label Nov 15, 2022
@erszcz
Copy link
Member

erszcz commented Nov 15, 2022

Could you attach the code leading to this? A snippet or a link to a repo is fine, too.

@lukaszsamson
Copy link
Author

I cannot share the repo but I'll try to isolate it

@lukaszsamson
Copy link
Author

@erszcz What's the easiest way to see what file lead to that crash?

@erszcz
Copy link
Member

erszcz commented Nov 21, 2022

@lukaszsamson Ahh, sorry, I missed that question. mix gradient --verbose should provide a verbose log which will tell the module being checked along with some relevant logs:

18:58:56 erszcz @ x6 : ~/work/elixir-lsp/elixir-ls (gradient *%)
$ mix gradient --verbose > gradient.log
18:59:06 erszcz @ x6 : ~/work/elixir-lsp/elixir-ls (gradient *%)
$ grep "Checking module" gradient.log | head -5
Checking module 'Elixir.ElixirLS.Debugger.Binding'
Checking module 'Elixir.ElixirLS.Debugger.BreakpointCondition'
Checking module 'Elixir.ElixirLS.Debugger.CLI'
Checking module 'Elixir.ElixirLS.Debugger.Completions'
Checking module 'Elixir.ElixirLS.Debugger.Output'

On a crash, the last printed Checking module ... should tell what module was the source of the crash.

@luk-pau-es
Copy link
Contributor

luk-pau-es commented Jan 4, 2023

Hello,
@lukaszsamson I have investigated the issue, with the version of gradient you have specified.
Could you update the dependency to the newest version and check again?

I have used elixir-lsp/elixir-ls repo for testing, and with the version you specified there are indeed the errors you reported. They are not present with the newest gradient version. Could you verify that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants