I don't know exactly when the symptoms started, since I haven't been using SLIME for a while, but a CVS update doesn't make them go away.
When I start Emacs and do M-x slime RET it fails trying to connect to port 0 of localhost. I don't understand, since a problem of this magnitude (can't use SLIME at all) would certainly be noticed by others, and I saw no previous posts about this. Presumably it is something peculiar about my configuration. I'm using Debian GNU/Linux 3.0 + 2.6.2 kernel + GNU Emacs 21.3.50.9. If you need more info, just ask. The output is included below.
Regards,
Dirk Gerrits
CMU Common Lisp CVS release-18e-branch + minimal debian patches, running on willow With core: /usr/lib/cmucl/lisp.core Dumped on: Sat, 2004-02-07 00:05:30+01:00 on willow For support see http://www.cons.org/cmucl/support.html Send bug reports to the debian BTS. or to pvaneynd@debian.org type (help) for help, (quit) to exit, and (demo) to see the demos
Loaded subsystems: Python 1.1, target Intel x86 CLOS 18e (based on PCL September 16 92 PCL (f)) * ; Loading #p"/home/dirk/slime/swank-loader.lisp". ;; Loading #p"/home/dirk/slime/swank-backend.x86f". ;; Loading #p"/home/dirk/slime/swank.x86f". ;; Loading #p"/home/dirk/slime/swank-source-path-parser.x86f". ;; Loading #p"/home/dirk/slime/swank-cmucl.x86f". Warning: DEFIMPLEMENTATION of undefined interface (DESCRIBE-PRIMITIVE-TYPE) Warning: DEFIMPLEMENTATION of undefined interface (INSPECTED-PARTS) Warning: These Swank interfaces are unimplemented: (RESTART-FRAME RETURN-FROM-FRAME THREAD-ALIVE-P WHO-MACROEXPANDS WHO-SPECIALIZES) T *
Error in function CREATE-INET-LISTENER: Error binding socket to port 0: Cannot assign requested address
Restarts: 0: [ABORT] Return to Top-Level.
Debug (type H for help)
(CREATE-INET-LISTENER 0 :STREAM :HOST 16777343 ...) Source: ; File: target:code/internet.lisp (ERROR "Error binding socket to port ~a: ~a" PORT (UNIX:GET-UNIX-ERROR-MSG)) 0] :backtrace
0: (CREATE-INET-LISTENER 0 :STREAM :HOST 16777343 ...) 1: ("DEFIMPLEMENTATION CREATE-SOCKET" #<unused-arg> #<unused-arg> 0) 2: (SWANK::SETUP-SERVER 0 #<Closure Over Function "DEFUN START-SERVER" {484ED931}> :SIGIO) 3: (INTERACTIVE-EVAL (SWANK:START-SERVER "/tmp/slime.2936")) 4: (COMMON-LISP::%TOP-LEVEL) 5: (COMMON-LISP::RESTART-LISP)
0]
generally speaking when slime (smank) attempts to open a socket on port 0 what it means is "one port on any socket, i don't care which." on cmucl on osx (ext:create-inet-listener 0) does work.
[however there is another bug in swank:create-socket not returning the socket unless the MP feature was defined. since i don't know where helmut is taking the multithreading support i'm not going to commit a fix of this, but a temporary fix is to jsut comment the #+MP read conditional in swank::create-socket]
-- Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen
As Macro explained, port 0 just means let the OS select a random port. The problem is not the port number, but the IP address of the interface. (CMUCL's error message is bit misleading here.) SLIME used to bind the socket to the interface "localhost", which is usually the loopback device 127.0.0.1. Apparently this is not the case in your configuration.
I changed SLIME so that it binds the socket explicitly to 127.0.0.1. If this doesn't work, you can set SWANK::*LOOPBACK-INTERFACE* to a more suitable value, e.g., your hostname or "0.0.0.0" (which means "all interfaces").
I also fixed the bug Macro mentioned. That was just a stupid typo.
Helmut.
Helmut Eller wrote:
As Macro explained, port 0 just means let the OS select a random port. The problem is not the port number, but the IP address of the interface. (CMUCL's error message is bit misleading here.) SLIME used to bind the socket to the interface "localhost", which is usually the loopback device 127.0.0.1. Apparently this is not the case in your configuration.
Ah thanks for the quick response guys. It's working again!
I thought SLIME was broken, when I had actually fouled up my /etc/network/interfaces. Sorry!
Embarrassed-ly yours,
Dirk Gerrits
Helmut Eller e9626484@stud3.tuwien.ac.at writes:
As Macro explained, port 0 just means let the OS select a random port.
[...]
I also fixed the bug Macro mentioned. That was just a stupid typo.
Marco should be proud: you are praising his Lisp skills :)
Paolo
I'm sorry for misspelling Marco's name two times. I'll try to be more careful in the future.
Sorry again, Helmut.
I'm sorry for misspelling Marco's name two times. I'll try to be more careful in the future.
no problem, i didn't even notice (not mention the fact that i do that myself all the time :)).
-- Marco Ring the bells that still can ring. Forget the perfect offering. There is a crack in everything. That's how the light gets in. -Leonard Cohen