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

Debugging Distillery Release CLI crashing on macOS due to badmatch error #1347

Open
saialluru opened this issue Nov 22, 2018 · 25 comments
Open

Comments

@saialluru
Copy link

_build/dev/rel/hello/bin/hello foreground
Exec: /usr/local/Cellar/erlang/21.1/lib/erlang/erts-10.1/bin/erlexec -noshell -noinput +Bd -boot /Users/sai/elixir-projects/hello/_build/dev/rel/hello/releases/0.1.0/hello -boot_var ERTS_LIB_DIR /usr/local/Cellar/erlang/21.1/lib/erlang/erts-10.1/../lib -env ERL_LIBS /Users/sai/elixir-projects/hello/_build/dev/rel/hello/lib -pa /Users/sai/elixir-projects/hello/_build/dev/rel/hello/lib/hello-0.1.0/consolidated -args_file /Users/sai/elixir-projects/hello/_build/dev/rel/hello/var/vm.args -config /Users/sai/elixir-projects/hello/_build/dev/rel/hello/var/sys.config -mode embedded -eval application:ensure_all_started(elixir) -eval 'Elixir.Code':require_file(<<"/private/var/folders/9v/vwx8qj4n7_55nff1pw39j2lr0000gq/T/intellij_elixir1/debugger/lib/intellij_elixir/debugger/server.ex">>) -eval 'Elixir.Code':require_file(<<"/private/var/folders/9v/vwx8qj4n7_55nff1pw39j2lr0000gq/T/intellij_elixir1/debugger/lib/intellij_elixir/debugged.ex">>) -eval 'Elixir.IntelliJElixir.Debugged':start()' -extra --
Root: /Users/sai/elixir-projects/hello/_build/dev/rel/hello
warning: variable "arg" is unused
/private/var/folders/9v/vwx8qj4n7_55nff1pw39j2lr0000gq/T/intellij_elixir1/debugger/lib/intellij_elixir/debugger/server.ex:404

warning: variable "counter" is unused
/private/var/folders/9v/vwx8qj4n7_55nff1pw39j2lr0000gq/T/intellij_elixir1/debugger/lib/intellij_elixir/debugger/server.ex:505

{"init terminating in do_boot",{{badmatch,{error,{1,erl_scan,{string,39,[]}},1}},[{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}

00:56:13.716 [error] Error in process #PID<0.7.0> on node :"hello@127.0.0.1" with exit value:
{{:badmatch, {:error, {1, :erl_scan, {:string, 39, []}}, 1}}, [{:init, :start_it, 1, []}, {:init, :start_em, 1, []}, {:init, :do_boot, 3, []}]}

init terminating in do_boot ({{badmatch,{error,{1,erl_scan,{_}},1}},[{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done

@acarvajal-gap
Copy link

+1

@atelierJVA
Copy link

atelierJVA commented Dec 30, 2018

+1, exact same error

macOS 10.13.6, elixir 1.7.4, Erlang 21.2.2, IntelliJ 2018.3.2, Elixir plug-in 10.2.0

@k2m30
Copy link

k2m30 commented Feb 4, 2019

The same

{"init terminating in do_boot",{{badmatch,{error,{1,erl_scan,{string,39,[]}},1}},[{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}

Elixir 1.8.1 (compiled with Erlang/OTP 21), Rubymine, Mac OS

/usr/local/Cellar/erlang/21.2.4/lib/erlang/bin/erl -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/dialyzer-3.3.1/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/ftp-1.0.1/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/sasl-3.3/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/syntax_tools-2.1.6/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/erl_docgen-0.8.1/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/parsetools-2.1.8/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/observer-2.8.2/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/ssl-9.1.2/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/reltool-0.7.8/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/snmp-5.2.12/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/erl_interface-3.10.4/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/eunit-2.3.7/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/os_mon-2.4.7/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/xmerl-1.3.19/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/runtime_tools-1.13.1/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/debugger-4.2.6/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/erts-10.2.3/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/common_test-1.16.1/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/tools-3.0.2/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/ssh-4.7.3/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/stdlib-3.7/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/mnesia-4.15.5/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/kernel-6.2/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/edoc-0.9.4/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/wx-1.8.6/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/hipe-3.18.2/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/tftp-1.0.1/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/et-1.6.4/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/diameter-2.1.6/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/eldap-1.2.6/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/megaco-3.18.4/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/compiler-7.3.1/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/asn1-5.0.8/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/inets-7.0.4/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/otp_mibs-1.2.1/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/crypto-4.4/ebin -pa /usr/local/Cellar/erlang/21.2.4/lib/erlang/lib/public_key-1.6.4/ebin -name debugged6b5bb36e-62b0-41df-bf3b-2a92e3e2d6e1@127.0.0.1 -setcookie 6b5bb36e-62b0-41df-bf3b-2a92e3e2d6e1 -eval application:ensure_all_started(elixir) -eval 'Elixir.Code':require_file(<<"/private/var/folders/53/17f4wn2j4tb3szz62c9x4p2h0000gn/T/intellij_elixir5/debugger/lib/intellij_elixir/debugger/server.ex">>) -eval 'Elixir.Code':require_file(<<"/private/var/folders/53/17f4wn2j4tb3szz62c9x4p2h0000gn/T/intellij_elixir5/debugger/lib/intellij_elixir/debugged.ex">>) -eval 'Elixir.IntelliJElixir.Debugged':start()' -pa /usr/local/Cellar/elixir/1.8.1/lib/logger/ebin -pa /usr/local/Cellar/elixir/1.8.1/lib/elixir/ebin -pa /usr/local/Cellar/elixir/1.8.1/lib/ex_unit/ebin -pa /usr/local/Cellar/elixir/1.8.1/lib/mix/ebin -pa /usr/local/Cellar/elixir/1.8.1/lib/eex/ebin -pa /usr/local/Cellar/elixir/1.8.1/lib/iex/ebin -noshell -s elixir start_cli -elixir ansi_enabled true -extra hello_world.ex

@krumft-zz
Copy link

Any news here? Fixing that will enable IntelliJ debugging of Elixir, which would be awesome!

@k2m30
Copy link

k2m30 commented Mar 11, 2019

давайте, ребята, соберитесь. очень надо

@audiobuddha

This comment has been minimized.

@KronicDeth

This comment has been minimized.

@audiobuddha

This comment has been minimized.

@irenekay

This comment has been minimized.

@KronicDeth

This comment has been minimized.

@KronicDeth

This comment has been minimized.

@sabudaye

This comment has been minimized.

@fatnlazycat

This comment has been minimized.

@Snackin

This comment has been minimized.

@KronicDeth

This comment has been minimized.

@sbauer322
Copy link

@KronicDeth - I can reproduce the original issue (not the UTF-8 issue) in Ubuntu, if you need help in that regard.

@tiagodocouto

This comment has been minimized.

@tiagodocouto
Copy link

I can confirm that the exactly same thing is happening on MacOS

@dkgitdev

This comment has been minimized.

@akbarahmadshah

This comment has been minimized.

@KronicDeth KronicDeth added this to the 11.8.1 milestone Sep 18, 2020
@KronicDeth KronicDeth self-assigned this Sep 18, 2020
KronicDeth added a commit that referenced this issue Sep 18, 2020
Fixes #1347

On Windows, the `file.path` has `\`, but they aren't escaped.  Therefore, replace them with escaped version, `\\` to fix debugging on Windows, but leave Linux and macOS unaffected.
@krumft-zz

This comment has been minimized.

@KronicDeth KronicDeth changed the title debugger crashing Debugger crashing on macOS due to badmatch error Sep 22, 2020
@KronicDeth
Copy link
Owner

I moved Windows problem to #1824. Please only report macOS crashes in this bug if you have badmatch error.

@KronicDeth
Copy link
Owner

Since I can't reproduce this when doing Elixir Mix ExUnit run configurations on macOS, I took a better look at what is going on and then noticed that @k2m30's command line ends in -extra hello_world.ex. The only way I can see this happening is if you made a Run Configuration with hello_world.ex as the elixir argument, but that does really make sense as a thing to do because how would you call any code in that module? I know it is over a year ago, but what were you trying to do?

If you had a file call hello_world.ex, where you want to call a function you can't just run the file, you need some way to call the function such as using an IEx Mix Run Configuration, so you can type which function to call. I'm going to attribute this to just an invalid use of the run configuration unless you can explain what you were doing to see if I can make it work.

@saialluru's original command line appears to be showing using the debugger on a built release: dev/rel/hello/releases/0.1.0/hello

@sabudaye's command line is about using the IEx Mix Run configuration with phx.server, but on Linux.

All three of these are different usages, so I may once again split this issue further.

@KronicDeth KronicDeth changed the title Debugger crashing on macOS due to badmatch error Debugging Distillery Release CLI crashing on macOS due to badmatch error Sep 25, 2020
@krumft-zz
Copy link

With the latest version of IntelliJ and Elixir plugin I am successfully able to start a fat Phoenix app and step through it via the debugger. Kudos for fixing the problem.

@XiXiaPdx
Copy link

Coming to Elixir from Java, using Intellij and this plugin is amazing!

I'm having trouble with running the debugger as it crashes. Here is what I see when I try to run the debugger.

Elixir.Debugged':start()' -noshell -user Elixir.IEx.CLI -extra --no-halt -S mix
Erlang/OTP 24 [erts-12.1.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit] [dtrace]

{"init terminating in do_boot",{{badmatch,{error,{1,erl_scan,{string,39,[]}},1}},[{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({{badmatch,{error,{1,erl_scan,{_}},1}},[{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done

My Run configuration

runconfig

Intellij Ultimate 2021.2.2
MacOS Big Sur 11.6
Project SDK for Elixir is 1.12.3
Erlang is 24

My app is this from a Udemy course - https://github.com/StephenGrider/ElixirCode/tree/master/identicon

It runs fine with the Play button, just crashes with the debugger.

I've tried a few things:

  1. reduced the project to one file, HelloWorld
  2. removed the dependency on egd

Thank you!

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

No branches or pull requests