KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.84k stars 154 forks source link

init terminating in do_boot () #1321

Open razz-matazz opened 6 years ago

razz-matazz commented 6 years ago

Hello,

First: Thanks a lot for this great plugin.

I am trying to debug my phoenix app. I am on windows 10 and using IntelliJ 2018.1.6, Erlang/OTP 19 and Elixir 1.7.1 (via chocolatey). I updated IntelliJ-Elixir to 10.0.0

Starting server: no problems. When I try to debug, I get this console output:

"C:\Program Files\erl8.1\bin\erl.exe" -pa "C:/Program Files/erl8.1/lib/asn1-4.0.4/ebin" -pa "C:/Program Files/erl8.1/lib/common_test-1.12.3/ebin" -pa "C:/Program Files/erl8.1/lib/compiler-7.0.2/ebin" -pa "C:/Program Files/erl8.1/lib/cosEvent-2.2.1/ebin" -pa "C:/Program Files/erl8.1/lib/cosEventDomain-1.2.1/ebin" -pa "C:/Program Files/erl8.1/lib/cosFileTransfer-1.2.1/ebin" -pa "C:/Program Files/erl8.1/lib/cosNotification-1.2.2/ebin" -pa "C:/Program Files/erl8.1/lib/cosProperty-1.2.1/ebin" -pa "C:/Program Files/erl8.1/lib/cosTime-1.2.2/ebin" -pa "C:/Program Files/erl8.1/lib/cosTransactions-1.3.2/ebin" -pa "C:/Program Files/erl8.1/lib/crypto-3.7.1/ebin" -pa "C:/Program Files/erl8.1/lib/debugger-4.2.1/ebin" -pa "C:/Program Files/erl8.1/lib/dialyzer-3.0.2/ebin" -pa "C:/Program Files/erl8.1/lib/edoc-0.8/ebin" -pa "C:/Program Files/erl8.1/lib/eldap-1.2.2/ebin" -pa "C:/Program Files/erl8.1/lib/erl_docgen-0.6/ebin" -pa "C:/Program Files/erl8.1/lib/erl_interface-3.9.1/ebin" -pa "C:/Program Files/erl8.1/lib/erts-8.1/ebin" -pa "C:/Program Files/erl8.1/lib/et-1.6/ebin" -pa "C:/Program Files/erl8.1/lib/eunit-2.3.1/ebin" -pa "C:/Program Files/erl8.1/lib/gs-1.6.2/ebin" -pa "C:/Program Files/erl8.1/lib/hipe-3.15.2/ebin" -pa "C:/Program Files/erl8.1/lib/ic-4.4.2/ebin" -pa "C:/Program Files/erl8.1/lib/inets-6.3.3/ebin" -pa "C:/Program Files/erl8.1/lib/jinterface-1.7.1/ebin" -pa "C:/Program Files/erl8.1/lib/kernel-5.1/ebin" -pa "C:/Program Files/erl8.1/lib/megaco-3.18.1/ebin" -pa "C:/Program Files/erl8.1/lib/mnesia-4.14.1/ebin" -pa "C:/Program Files/erl8.1/lib/observer-2.2.2/ebin" -pa "C:/Program Files/erl8.1/lib/odbc-2.11.3/ebin" -pa "C:/Program Files/erl8.1/lib/orber-3.8.2/ebin" -pa "C:/Program Files/erl8.1/lib/os_mon-2.4.1/ebin" -pa "C:/Program Files/erl8.1/lib/otp_mibs-1.1.1/ebin" -pa "C:/Program Files/erl8.1/lib/parsetools-2.1.3/ebin" -pa "C:/Program Files/erl8.1/lib/percept-0.9/ebin" -pa "C:/Program Files/erl8.1/lib/public_key-1.2/ebin" -pa "C:/Program Files/erl8.1/lib/reltool-0.7.2/ebin" -pa "C:/Program Files/erl8.1/lib/runtime_tools-1.10.1/ebin" -pa "C:/Program Files/erl8.1/lib/sasl-3.0.1/ebin" -pa "C:/Program Files/erl8.1/lib/snmp-5.2.4/ebin" -pa "C:/Program Files/erl8.1/lib/ssh-4.3.2/ebin" -pa "C:/Program Files/erl8.1/lib/ssl-8.0.2/ebin" -pa "C:/Program Files/erl8.1/lib/stdlib-3.1/ebin" -pa "C:/Program Files/erl8.1/lib/syntax_tools-2.1/ebin" -pa "C:/Program Files/erl8.1/lib/tools-2.8.6/ebin" -pa "C:/Program Files/erl8.1/lib/typer-0.9.11/ebin" -pa "C:/Program Files/erl8.1/lib/wx-1.7.1/ebin" -pa "C:/Program Files/erl8.1/lib/xmerl-1.3.12/ebin" -name debuggedf97c2829-5f60-4b4d-aabf-ca76c0d49d80@127.0.0.1 -setcookie f97c2829-5f60-4b4d-aabf-ca76c0d49d80 -eval application:ensure_all_started(elixir) -eval 'Elixir.Code':require_file(<<\"C:\Users\Peter\AppData\Local\Temp\intellij_elixir281\debugger\lib\intellij_elixir\debugger\server.ex\">>) -eval 'Elixir.Code':require_file(<<\"C:\Users\Peter\AppData\Local\Temp\intellij_elixir281\debugger\lib\intellij_elixir\debugged.ex\">>) -eval 'Elixir.Code':require_file(<<\"C:\Users\Peter\AppData\Local\Temp\intellij_elixir281\debugger\lib\mix\tasks\intellij_elixir\debug.ex\">>) -pa C:/ProgramData/chocolatey/lib/elixir/lib/eex/ebin -pa C:/ProgramData/chocolatey/lib/elixir/lib/elixir/ebin -pa C:/ProgramData/chocolatey/lib/elixir/lib/ex_unit/ebin -pa C:/ProgramData/chocolatey/lib/elixir/lib/iex/ebin -pa C:/ProgramData/chocolatey/lib/elixir/lib/logger/ebin -pa C:/ProgramData/chocolatey/lib/elixir/lib/mix/ebin -noshell -s elixir start_cli -elixir ansi_enabled true -extra C:\ProgramData\chocolatey\lib\elixir\bin\mix do intellij_elixir.debug, phx.server init terminating in do_boot () Crash dump is being written to: erl_crash.dump...{"init terminating in do_boot",{#{'__exception__'=>true,'__struct__'=>'Elixir.Code.LoadError',file=><<99,58,47,85,115,101,114,115,80,101,116,101,114,65,112,112,68,97,116,97,76,111,99,97,108,84,101,109,112,105,110,116,101,108,108,105,106,95,101,108,105,120,105,114,50,56,49,127,101,98,117,103,103,101,114,108,105,98,105,110,116,101,108,108,105,106,95,101,108,105,120,105,114,127,101,98,117,103,103,101,114,32,101,114,118,101,114,46,101,120>>,message=><<99,111,117,108,100,32,110,111,116,32,108,111,97,100,32,99,58,47,85,115,101,114,115,80,101,116,101,114,65,112,112,68,97,116,97,76,111,99,97,108,84,101,109,112,105,110,116,101,108,108,105,106,95,101,108,105,120,105,114,50,56,49,127,101,98,117,103,103,101,114,108,105,98,105,110,116,101,108,108,105,106,95,101,108,105,120,105,114,127,101,98,117,103,103,101,114,32,101,114,118,101,114,46,101,120>>},[{'Elixir.Code',find_file,2,[{file,"lib/code.ex"},{line,1147}]},{'Elixir.Code',require_file,2,[{file,"lib/code.ex"},{line,754}]},{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,670}]},{init,start_it,1,[{file,"init.erl"},{line,1090}]},{init,start_em,1,[{file,"init.erl"},{line,1076}]},{init,do_boot,3,[{file,"init.erl"},{line,784}]}]}} done

All those files are really there.

erl_crash.dump is attached. erl_crash.dump.txt

What can I do or what have I done wrong?

Thanks for help.

KronicDeth commented 6 years ago

It looks like the charset isn't set properly as it is spitting out file names and messages as binaries instead of printable strings.

razz-matazz commented 6 years ago

What is the right charset and can I set it manually?

N-0x90 commented 6 years ago

@razz-matazz you found any way to fix it?

razz-matazz commented 6 years ago

No, that exceeds my abilities :(

elaurendeau commented 5 years ago

I have a similar problem to debug ExUnit running Intellij Ultimate 2018.3.2 with Elixir plugin v10.2.0

init terminating in do_boot ({,[{Elixir.Code,findfile,2,[{},{_}]},{Elixir.Code,requirefile,2,[{},{_}]},{erl_eval,doapply,6,[{},{_}]},{init,startit,1,[{},{_}]},{init,startem,1,[{},{_}]},{init

fcFn commented 5 years ago

I suppose it's Windows specific?

Got the same on Win 10 just now with Elixir plugin v10.2.0 and RubyMine 2018.3.5.

GiorgioG commented 5 years ago

Same issue, IntelliJ Ultimate, Windows 10

joxford531 commented 5 years ago

Having a similar problem, I am using Windows 10 and IntelliJ Community Edition 2019.1. When I extract the binary from

<<99,58,47,87,111,114,107,47,69,108,105,120,105,114,47,112,104,111,101,110,105,120,47,114,117,109,98,108,47,85,115,101,114,115,106,111,120,102,111,114,100,65,112,112,68,97,116,97,76,111,99,97,108,84,101,109,112,105,110,116,101,108,108,105,106,95,101,108,105,120,105,114,55,127,101,98,117,103,103,101,114,108,105,98,105,110,116,101,108,108,105,106,95,101,108,105,120,105,114,127,101,98,117,103,103,101,114,32,101,114,118,101,114,46,101,120>>,message=><<99,111,117,108,100,32,110,111,116,32,108,111,97,100,32,99,58,47,87,111,114,107,47,69,108,105,120,105,114,47,112,104,111,101,110,105,120,47,114,117,109,98,108,47,85,115,101,114,115,106,111,120,102,111,114,100,65,112,112,68,97,116,97,76,111,99,97,108,84,101,109,112,105,110,116,101,108,108,105,106,95,101,108,105,120,105,114,55,127,101,98,117,103,103,101,114,108,105,98,105,110,116,101,108,108,105,106,95,101,108,105,120,105,114,127,101,98,117,103,103,101,114,32,101,114,118,101,114,46,101,120>>

It turns into this which looks like a pathing problem. What should the Working Directory be set to in the mix task I make for phx.server ?

"c:/Work/Elixir/phoenix/rumbl/UsersjoxfordAppDataLocalTempintellij_elixir7\debuggerlibintellij_elixir\debugger erver.ex" "could not load c:/Work/Elixir/phoenix/rumbl/UsersjoxfordAppDataLocalTempintellij_elixir7\debuggerlibintellij_elixir\deb ugger erver.ex"

skruger commented 5 years ago

Same problem. Windows 10, IntelliJ CE, elixir plugin v10.5.0, Elixir 1.8.1, Erlang 21 as installed with Elixir installer.

I looked to see what the file was that it couldn't load. It is very interesting that it is somehow assembling the temp path string incorrectly. In the first section it uses forward slashes instead of backslashes for the project directory path, in the middle it contains the value of %TMP% stripped of the drive letter and backslash separators, and in the last section it begins a valid path, but the \s in "\server.ex" seems to have been interpreted as some kind of escape to make a space character.

My real path to server.ex is:

C:\Users\Shaun\AppData\Local\Temp\intellij_elixir\debugger\lib\intellij_elixir\debugger\server.ex

You can see all of the elements of this valid path in the path that appears in the error message with various missing backslashes appended to my project root.

iex(1)> binstr = <<99,58,47,85,115,101,114,115,47,83,104,97,117,110,47,73,100,101,97,80,114,111,106,101,99,116,115,47,116,114,97,99,107,104,111,98,98,115,45,115,108,97,99,107,47,85,115,101,114,115,83,104,97,117,110,65,112,1
12,68,97,116,97,76,111,99,97,108,84,101,109,112,105,110,116,101,108,108,105,106,95,101,108,105,120,105,114,127,101,98,117,103,103,101,114,108,105,98,105,110,116,101,108,108,105,106,95,101,108,105,120,105,114,127,101,98,117,
103,103,101,114,32,101,114,118,101,114,46,101,120>>
"c:/Users/Shaun/IdeaProjects/trackhobbs-slack/UsersShaunAppDataLocalTempintellij_elixir\debuggerlibintellij_elixir\debugger erver.ex"
va575 commented 4 years ago

https://github.com/KronicDeth/intellij-elixir/blob/9fdba1020ecc4ba465292c6c7aa04a9f42fb3e67/src/org/elixir_lang/debugger/Modules.kt#L35

@razz-matazz

I was facing the same issue too in Windows and was unable to use the plugin in Windows. I just tried the below code in Modules.kt instead of the above and debug works for me now in Windows. I am new to Kotlin , so not sure if there is an alternative. Tried this in plugin version 10.6.0 in Intellij 2019.1.3 Community Edition.

listOf("-eval", "'Elixir.Code:require_file(\"".replace("\","",true)+file.path+"\")'".replace("\","",true))

@KronicDeth If this is fine, maybe this fix can be contributed to Modules.kt ?

KronicDeth commented 4 years ago

Have you tested that the change works on macOS and Linux @va575? My windows desktop is in storage, so I can’t verify the Windows side right now.

va575 commented 4 years ago

Have you tested that the change works on macOS and Linux @va575? My windows desktop is in storage, so I can’t verify the Windows side right now.

@KronicDeth I just have Windows machines, so could not test on macOS or Linux :(

Looks like this should also resolve #1347