emacs slime can not connect to swank - emacs

After I type M-x:slime-connect with emacs on windows7-64,and enter host and port: host:127.0.0.1 / port:4005.
It shows the error:
Connecting to Swank on port 4005..
open-network-stream: make client process failed: too many open files, :name, SLIME Lisp, :buffer, nil, :host, 127.0.0.1, :service, 4005, :nowait, nil
How can I fix that and what is the reason behind it?

Related

Connecting to remote swank: can't locate module swank-io-package::swank-trace-dialog

So, I am using
sbcl --dynamic-space-size 1024 \
--noinform \
--load $HOME/quicklisp/setup.lisp \
--eval '(ql:quickload :myapp)' \
--eval "(sb-ext:save-lisp-and-die \"myapp\" :toplevel #'myapp::main :executable t :compression t)"
to generate myapp locally, and uploading the resulting binary to the server.
The function myapp:main executes the following (along with several other initialization things for the server) as pointed here:
(bt:make-thread (lambda () (swank:create-server :port swank-port ; consider it to be 8080
:dont-close t)))
I also do the port forwarding on my local machine:
ssh -L8080:127.0.0.1:8080 user#remote
I can slime-connect to it, when myapp is run on my local machine, with me connecting to it from the same machine.
However, when I try to slime-connect to localhost, 8080 on my local machine, with myapp running on remote, I get the error as
Can't locate module: SWANK-IO-PACKAGE::SWANK-TRACE-DIALOG
[Condition of type SIMPLE-ERROR]
Restarts:
0: [*ABORT] Return to SLIME's top level.
1: [ABORT] abort thread (#<THREAD "worker" RUNNING {1005B6EB73}>)
If I choose [*ABORT], emacs gives me error in process filter: No catch for tag: slime-result-2-212, (error "Synchronous Lisp Evaluation aborted") (in the minibuffer), with no SLIME REPL.
Choosing [ABORT] also gives the almost same error in process filter: Synchronous Lisp Evaluation aborted.
Also, if I try to evaluate something in the frame, too, I get the error in process filter: Invalid message protocol.
PS: I am using AWS, in case the details about Security Groups are relevant.

Emacs+Slime inferior-lisp exited abnormally with code 5

I try to install slime in emacs. I follow many manuals and got one oucome.
"M-x slime" trow exeption "process inferior-lisp exited abnormally with code 5"
OS Windows 8.1
GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of
2018-05-30
SBCL 1.4.2
SLIME 2.22
My .emacs file text
(setq inferior-lisp-program "C:/SBCL/sbcl.exe")
(add-to-list 'load-path "C:/slime/")
(require 'slime)
Following the comment, I tried to understand where the installation falls
-(load #P"C:/slime/swank-loader")
-T
-(swank-loader::init :reload t)
-WARNING: redefining EMACS-INSPECT (#(SB-PCL:SYSTEM-CLASS COMMON-LISP:T)) in DEFMETHOD
NIL
-(swank:create-server :port 7777)
;;Swank started at port:7777
In Emacs
-M-x slime-connect
Host: localhost
Port: 7777
-Lisp connection closed unexpectedly: connection broken by remote peer
In other topics where i saw that error message, peoples run complex sourcecode with mistakes. The problem was solved by correcting errors. It seems like different situation or i don't understand something.
This is too long for a comment.
You need to find out at which layer the problem occurs. Try for example to run SBCL in a shell with the same command-line (e.g. C:/SBCL/sbcl.exe); if it works, in the REPL:
CL-USER> (load #P"C:/slime/swank-loader")
If that works, you can manually init the swank backend (the Common Lisp part of the Slime/Swank protocol).
CL-USER> (swank-loader::init :reload t)
Then, try to start a server (the port value is arbitrary):
CL-USER> (swank:create-server :port 7777)
If a server starts, you can try to run slime-connect from Emacs, using the localhost port and the same port.
Oleg, try to give ip address 127.0.0.1 instead of localhost when doing slime-connect. I have similar problem on OSX when connecting to a remote SLIME server.

failed to find free socket port for process dispatcher when trying remote debug

Highlights:
windows 10 host machine
ubuntu vagrant box (virtualbox) as guest vm
using vagrant port forwarding as like this: config.vm.network "forwarded_port", guest: 1234, host: 12340
IDE: IntelliJ IDEA with Ruby plugin
The Issue:
I've tried to set up remote ruby debug following this guide and getting an error in IDE: "failed to find free socket port for process dispatcher". It looks this issue is not IntelliJ-specific, I was able to reproduce it with latest RubyMine as well.
From IDEA's log
2017-07-07 21:53:03,515 [8879188] INFO - tion.impl.ExecutionManagerImpl - Failed to find free socket port for process dispatcher
com.intellij.execution.ExecutionException: Failed to find free socket port for process dispatcher
at org.jetbrains.plugins.ruby.ruby.debugger.RubyProcessDispatcher.<init>(RubyProcessDispatcher.java:46)
at org.jetbrains.plugins.ruby.ruby.debugger.RubyRemoteDebugRunner.doExecute(RubyRemoteDebugRunner.java:62)
...
Caused by: java.net.BindException: Address already in use: JVM_Bind
at java.net.TwoStacksPlainSocketImpl.socketBind(Native Method)
at java.net.TwoStacksPlainSocketImpl.socketBind(TwoStacksPlainSocketImpl.java:137)
...
I can understand it says Address already in use: JVM_Bind, but how remote debug supposed to work at all then? (I mean Is there any way to access guest vm port not forwarding it before? Clearly no) Any help to solve this issue is much appreciated.
For me the issue was due to another debug session that was open in the background. To prevent that from happening again (and also close all other currently open sessions, once you run the configuration again) select "Single instance only" in the Debug Configuration:

error in process sentinel: Could not start nREPL server

attempting to start cider with M-x cider-jack-in with clojure project file in current buffer on Emacs 24.4.1. I get error in process sentinel: Could not start nREPL server
does nREPL need separate installation...is this an error anyone else is experiencing with 24.4.1?
messages buffer:
Starting nREPL server via /usr/bin/lein update-in :dependencies conj \[org.clojure/tools.nre\
|11:56:07 hello: |pl\ \"0.2.12\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.14.0-SNAPSHOT\"\] -- re\
|11:56:07 hello: |pl :headless...
|11:56:08 hello: |error in process sentinel: nrepl-server-sentinel: Could not start nREPL server: ^[[?25h^[[0G\
Simple matter of having the correct versions of lein and clojure(script) and rtfm on https://github.com/clojure-emacs/cider-nrepl. To solve this I had to upgrade clojure to 1.7+ and lein to 2.5.2. After these upgrades everything worked nicely.

Connecting to DBus from emacs daemon

I recently tried to set up AucTeX SyncTeX with evince under GNU Emacs 24.4. From an ordinary emacs session it work oput of the box after activating TeX-source-correlate-mode, but under my standard Daemon session Dbus refuses to work properly. TeX-Evince-sync-view fails with a DBus 'no conncetion' error, so I tried M-: (dbus-init-bus :system) but that returns ((:signal :system "org.freedesktop.DBus.Local" "Disconnected") (nil "/org/freedesktop/DBus/Local" dbus-handle-bus-disconnect))
and M-: dbus-init-bus :session fails accordingly with 'no connection'.
Does anyone know how to get DBus running properly under Emacs in Daemon mode?
When you connect to D-Bus from Emacs, it must know where the respective dbus-daemon resides. Usually, it knows it via the environment variable $DBUS_SESSION_BUS_ADDRESS. So set this variable in your daemonized Emacs before you call (dbus-init-bus :session) or alike