elixir-ls icon indicating copy to clipboard operation
elixir-ls copied to clipboard

Debugging Scenic silently exits on launch

Open tiger808 opened this issue 7 years ago • 4 comments

Environment

  • Elixir version: "1.9.1 (compiled with Erlang/OTP 22)"
  • Erlang version: "22"
  • Operating system: MacOS 10.13.6
  • Client (editor or IDE): VS Code 1.39.1

Crash Report

Attempting to debug an app using Scenic: https://github.com/boydm/scenic

  1. Make a new Scenic example app:
mix scenic.new.example my_app
cd my_app
mix do deps.get, scenic.run
  1. Add a launch configuration that excludes the NIF modules:
{
        "type": "mix_task",
        "env": {"MIX_ENV": "dev"},
        "name": "mix scenic.run",
        "request": "launch",
        "task": "scenic.run",
        "projectDir": "${workspaceRoot}",
        "excludeModules": ["Scenic.Math.Line", "Scenic.Math.Matrix", "Scenic.Utilities.Texture"]
 }
  1. SELECT THE "mix scenic.run" configuration and debug. Debug console shows:
Started ElixirLS debugger
Elixir version: "1.9.1 (compiled with Erlang/OTP 22)"
Erlang version: "22"

The Scenic app window flashes on the screen for a fraction of a second, and then exits.

I don't see anything suspicious looking in the logs.

tiger808 avatar Oct 19 '19 11:10 tiger808

I don't think this is specific to Scenic, as we're seeing it in Phoenix and other non-Phoenix projects as well. See #185 .

mattraykowski avatar Nov 01 '19 20:11 mattraykowski

Have been experiencing this myself with various Plug and Phoenix projects using Elixir 1.9.x. Using 1.8.x always resolves the issue for me.

Did some tinkering this weekend and it appears this is where things are going awry: https://github.com/JakeBecker/elixir-ls/blob/ca277c10a81ab0486cd1426da1386ef573701240/apps/debugger/lib/debugger/server.ex#L566

With 1.8.x, Mix.Task.run does not return With 1.9.x, Mix.Task.run returns with :ok.

Elixir is still very much a language I'm working with in my spare time and next steps for me would be to compare differences between 1.8.x and 1.9.x in regards to Mix.Task.run.

Additional notes Curious if its related to this change in 1.9.x from 1.8.x where Process.sleep is no longer called in favor of System.no_halt

1.8.2 https://github.com/elixir-lang/elixir/blob/98485daab0a9f3ac2d7809d38f5e57cd73cb22ac/lib/mix/lib/mix/tasks/run.ex#L87

1.9.4 https://github.com/elixir-lang/elixir/blob/055526057ac9992cc1df87441357c4e56d45235d/lib/mix/lib/mix/tasks/run.ex#L86

joshua-andrassy avatar Nov 11 '19 16:11 joshua-andrassy

I just published version 0.2.28 of the ElixirLS fork that solves this issue: https://github.com/elixir-lsp/elixir-ls

And thanks @joshua-andrassy for the investigation! That was very helpful.

axelson avatar Nov 16 '19 18:11 axelson

This project has moved!

It's now being maintained by proactive volunteers from the Elixir community over at elixir-lsp/elixir-ls. Updates will continue to be published from that repo to the original VS Code extension, so no need to switch plugins if you're using VS Code.

To avoid inundating the new maintainers with issues, please verify that your issue persists with the latest version of the extension (which is published from the new repo) before re-filing your issue there.

Thanks for using ElixirLS!

JakeBecker avatar Apr 16 '20 03:04 JakeBecker