erlide_eclipse icon indicating copy to clipboard operation
erlide_eclipse copied to clipboard

Erlide Eshell appears to hang

Open Jrasm opened this issue 10 years ago • 11 comments

I've been working through the Erlang tutorials in Seven Languages in Seven Weeks using Erlide for eclipse and for the most part all seemed to be ok until i got to the concurrency section.

loop() ->
receive "casa" ->
io:format("house~n"), loop(); "blanca" -> io:format("white~n"), loop();

    _ -> io:format("no comprendo~n"),
            loop()
end.

When running as suggested by the book i should be able to send messages with Pid ! "someStuff". However when running this, nothing is returned and the debugger requires i kill the process before any activity resumes.

Here's an example of the console. You'll see when i send the message, nothing is returned.

Eshell V5.10.4 (ErlangDay3@Jeff-PC)1> Pid = spawn(fun translate:loop/0). < 0.202.0 > (ErlangDay3@Jeff-PC)2> Pid ! "casa". Pid ! "hello?". WhatJustHappened.

This all seems to run perfectly through the command line directly with Eshell (without eclipse and erlide). Could i have missed some configuration somewhere? I'm now completely stumped. I realize that maybe submitting is not the best place for a question like this, however i've completely exhausted my google-fu and it doesn't appear that there is any community support anywhere on the webs. Thank you for any and all advice you may provide. Please let me know if there's anything else i can provide.

Jeff

Jrasm avatar Mar 18 '14 03:03 Jrasm

Thanks for the report! This was a bug that I was hunting unsuccessfully since a while back, but now I managed to find and fix it. Please try the latest nightly build from http://download.erlide.org/update/nightly

vladdu avatar Mar 18 '14 09:03 vladdu

I have same issue and I think it hadn't been fixed completely. It hang when I tried simple code:

hd(ok).

theking-laptop avatar Mar 20 '14 15:03 theking-laptop

That works for me as expected, see below. Can you please reproduce the error and then send me the logs (/erlide.log and /.metadata/.log)?

(main@shadow)1> hd(ok).
** exception error: bad argument
     in function  hd/1
        called as hd(ok)

vladdu avatar Mar 20 '14 21:03 vladdu

This works for me. @theking-laptop, make sure you're using the latest nightly build.

As an aside and for others that may come to this: initially when i put this in place, it appeared that io:format was not being redirected to the shell, furthermore it seemed that any spawned processes were no longer receiving messages (although no error was returned). However after restarting eclipse and ensuring any open erl.exe processes were stopped, it's now working correctly.

Thanks for putting this project together!

Jrasm avatar Mar 21 '14 02:03 Jrasm

@vladdu

Eshell of Eclipse.

Eshell V5.10.4
(Test@theking-laptop)1> hd(ok).
type_whatever.

/.metadata/.log

eclipse.buildId=4.3.2.M20140221-1700
java.version=1.7.0_51
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.java.product

!ENTRY org.erlide.core 1 0 2014-03-21 14:52:06.641
!MESSAGE Erlide log is in /home/theking/Downloads/eclipse/www

!ENTRY org.erlide.core 1 0 2014-03-21 14:52:06.664
!MESSAGE *** starting Erlide v0.27.1.201403201407 (core=0.24.4.201403201407) (model api=0.24.4.201403201407) *** (UTF-8) 

erlide.log

14:52:06,652 I: (ErlangCore.java:66) : Starting CORE Thread[main,6,main]
14:52:06,663 I: (ErlangCore.java:75) : *** starting Erlide v0.27.1.201403201407 (core=0.24.4.201403201407) (model api=0.24.4.201403201407) *** (UTF-8) 
14:52:06,680 I: (ErlangCore.java:82) : Started CORE
14:52:07,609 F: (ErlangHostnameRetriever.java:40) : Test long hostname: null
14:52:07,610 W: (ErlangHostnameRetriever.java:46) : Can't use null as long name
14:52:08,514 F: (ErlangHostnameRetriever.java:40) : Test long hostname: theking-laptop
14:52:09,550 W: (ErlangHostnameRetriever.java:46) : Can't use theking-laptop as long name
14:52:09,918 F: (ErlangHostnameRetriever.java:40) : Test short hostname: theking-laptop
14:52:09,942 F: (HostnameUtils.java:73) : Detected:: theking-laptop && null
14:52:10,009 I: (ErlideUIPlugin.java:156) : Starting UI Thread[main,6,main]
14:52:10,071 I: (ErlideUIPlugin.java:191) : Started UI
14:52:10,387 F: (ModelActivator.java:19) : Starting Erlang model api
14:52:10,393 F: (ModelPlugin.java:35) : Starting Erlang model
14:52:10,394 F: (ModelPlugin.java:38) : Started model
14:52:10,413 F: (BackendFactory.java:43) : Create ide backend
14:52:10,418 F: (BackendFactory.java:75) : Create backend fe83_theking_a031b1_erlide
14:52:10,452 F: (ErlRuntime.java:409) : Runtime fe83_theking_a031b1_erlide@theking-laptop starting
14:52:10,452 F: (ManagedErlRuntime.java:56) : START node :> [/usr/lib/erlang/bin/erl, -sname, fe83_theking_a031b1_erlide@theking-laptop, -setcookie, erlide] *** /home/theking/Downloads/eclipse/www
14:52:10,658 F: (ErlRuntime.java:273) : using cookie 'erlide...'6 (info: 'erlide')
14:52:10,671 F: (ErlRuntime.java:278) : fe83_theking_a031b1_erlide@theking-laptop: waiting connection to peer...
14:52:10,900 F: (ErlRuntime.java:414) : Runtime fe83_theking_a031b1_erlide@theking-laptop running
14:52:10,960 W: (CodeBundle.java:73) : Can't access path ebin, plugin may be incorrectly built
14:52:11,014 F: (LogEventHandler.java:27) : info: {"Monitoring java node",'jerlide_3a032a0@theking-laptop'}
14:52:11,014 F: (LogEventHandler.java:27) : info: {"Start monitor process: ",10000000,50000000}
14:52:11,029 F: (ModelActivator.java:30) : Started model api
14:53:08,658 F: (ErlangNodeLaunchShortcut.java:115) : ** Launch :: tmp.erl
14:53:08,730 F: (BackendManager.java:118) : create execution backend Test
14:53:08,730 F: (BackendFactory.java:75) : Create backend Test
14:53:08,732 F: (ManagedErlRuntime.java:56) : START node :> [/usr/lib/erlang/bin/erl, -sname, Test@theking-laptop, -setcookie, erlide] *** /home/theking/Downloads/eclipse/www
14:53:08,734 F: (ErlRuntime.java:409) : Runtime Test@theking-laptop starting
14:53:08,940 F: (ErlRuntime.java:273) : using cookie 'erlide...'6 (info: 'erlide')
14:53:08,940 F: (ErlRuntime.java:278) : Test@theking-laptop: waiting connection to peer...
14:53:09,150 F: (ErlRuntime.java:414) : Runtime Test@theking-laptop running
14:53:09,158 W: (CodeBundle.java:73) : Can't access path ebin, plugin may be incorrectly built
14:53:09,214 F: (LogEventHandler.java:27) : info: {"Monitoring java node",'jerlide_3a1164a@theking-laptop'}
14:53:09,214 F: (ErlConsoleManager.java:43) : console ADDED to org.erlide.backend.api.BackendData@2ffc9d7f
14:53:09,215 F: (LogEventHandler.java:27) : info: {"Start monitor process: ",10000000,50000000}
14:53:09,265 F: (ErlangLaunchDelegate.java:116) : Started erts: Test >> Test
14:53:20,666 F: (ErlRuntime.java:382) : Runtime Test@theking-laptop terminated
14:53:23,502 F: (BackendManager.java:118) : create execution backend Test
14:53:23,502 F: (BackendFactory.java:75) : Create backend Test
14:53:23,504 F: (ManagedErlRuntime.java:56) : START node :> [/usr/lib/erlang/bin/erl, -sname, Test@theking-laptop, -setcookie, erlide] *** /home/theking/Downloads/eclipse/www
14:53:23,504 F: (ErlRuntime.java:409) : Runtime Test@theking-laptop starting
14:53:23,707 F: (ErlRuntime.java:273) : using cookie 'erlide...'6 (info: 'erlide')
14:53:23,708 F: (ErlRuntime.java:278) : Test@theking-laptop: waiting connection to peer...
14:53:23,919 F: (ErlRuntime.java:414) : Runtime Test@theking-laptop running
14:53:23,922 W: (CodeBundle.java:73) : Can't access path ebin, plugin may be incorrectly built
14:53:23,969 F: (LogEventHandler.java:27) : info: {"Monitoring java node",'jerlide_3a14ffa@theking-laptop'}
14:53:23,969 F: (LogEventHandler.java:27) : info: {"Start monitor process: ",10000000,50000000}
14:53:23,973 F: (ErlConsoleManager.java:43) : console ADDED to org.erlide.backend.api.BackendData@1b0c052a
14:53:23,985 F: (ErlangLaunchDelegate.java:116) : Started erts: Test >> Test
14:53:39,332 F: (ErlRuntime.java:382) : Runtime Test@theking-laptop terminated
14:55:06,906 F: (BackendManager.java:118) : create execution backend Test
14:55:06,907 F: (BackendFactory.java:75) : Create backend Test
14:55:06,908 F: (ManagedErlRuntime.java:56) : START node :> [/usr/lib/erlang/bin/erl, -sname, Test@theking-laptop, -setcookie, erlide] *** /home/theking/Downloads/eclipse/www
14:55:06,908 F: (ErlRuntime.java:409) : Runtime Test@theking-laptop starting
14:55:07,112 F: (ErlRuntime.java:273) : using cookie 'erlide...'6 (info: 'erlide')
14:55:07,113 F: (ErlRuntime.java:278) : Test@theking-laptop: waiting connection to peer...
14:55:07,322 F: (ErlRuntime.java:414) : Runtime Test@theking-laptop running
14:55:07,328 W: (CodeBundle.java:73) : Can't access path ebin, plugin may be incorrectly built
14:55:07,366 F: (LogEventHandler.java:27) : info: {"Monitoring java node",'jerlide_3a2e3e7@theking-laptop'}
14:55:07,367 F: (LogEventHandler.java:27) : info: {"Start monitor process: ",10000000,50000000}
14:55:07,367 F: (ErlConsoleManager.java:43) : console ADDED to org.erlide.backend.api.BackendData@4c067d1b
14:55:07,382 F: (ErlangLaunchDelegate.java:116) : Started erts: Test >> Test

theking-laptop avatar Mar 21 '14 07:03 theking-laptop

Thanks. I'm investigating, it looks like the build produced defective plugins.

vladdu avatar Mar 21 '14 10:03 vladdu

Ok, found it. It was a stupid misspelling (latin-1 instead of latin1)... It's fixed and will be available in the nightly in about 15 minutes.

Please remember that the console has many issues and it hasn't been upgraded to fully support unicode.

vladdu avatar Mar 21 '14 11:03 vladdu

Yes, it works. But now I have an other issue: slow response when I type in Eshell. I type 'a' and it's shown in the display about a second later.

theking-laptop avatar Mar 21 '14 12:03 theking-laptop

Is this always, i.e. for every character you are entering? The code completion, when called for the first time, takes a second or two. After that it should work instantly.

vladdu avatar Mar 21 '14 19:03 vladdu

Yes, I mean every character, always takes about a second.

theking-laptop avatar Mar 22 '14 06:03 theking-laptop

Hmm, I can't reproduce this... As I said before, the console is at the top of the list with larger problems that will get fixed.

Workaround: start an Erlang node manually, with the same name as the one that would be started by erlide (usually <project_name>@<machine_name>) and with cookie 'erlide'. Then when running the project from erlide, this node will get used and you can use its console to interact with your code. Saving files will still get them reloaded and the debugger will still work as usual. When shutting down, you have also to do it manually.

vladdu avatar Mar 22 '14 18:03 vladdu