From: Joe C. <hol...@gm...> - 2013-03-18 03:12:33
|
Hello: I'm just getting started using cl-modlisp (http://cl-modlisp.b9.com/) under SBCL, but I see an error like the following whenever I load a web page: ;; Error There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION SB-BSD-SOCKETS:SOCKET-CLOSE (1)> when called with arguments (#<SB-SYS:FD-STREAM for "socket 127.0.0.1:20123, peer: 127.0.0.1:58955" {B53CAE9}>). [1-modlisp-worker] The relevant function is actually close-active-socket in the kmrcl package, which is implemented like this: (defun close-active-socket (socket) #+sbcl (sb-bsd-sockets:socket-close socket) #-sbcl (close socket)) This error message or a related one seems to have been discussed in IRC before (http://ircarchive.info/lisp/2007/3/15/6.html) and also in the TBNL mailing list (http://comments.gmane.org/gmane.lisp.lib.tbnl.general/532), but I'm not clear on the current fix. Thanks for any help or advice! Joe |
From: Joe C. <hol...@gm...> - 2013-03-18 06:51:17
|
After some further work with the system, I now have an interesting "test case" - http://arxana.net/decipher loads without producing that error - http://arxana.net/decipher/model/1 produces the error and doesn't load Throwing in a break reveals that the version without the error doesn't call the `close-active-socket' function at all, but the version with the error seems to try twice, yielding two slightly different backtraces: Backtrace: 0: (BREAK "break") 1: (KMRCL:CLOSE-ACTIVE-SOCKET #<SB-SYS:FD-STREAM for "socket 127.0.0.1:20123, peer: 127.0.0.1:48912" {C46F4C1}>) 2: ((FLET #:CLEANUP-FUN-34 :IN MODLISP::MODLISP-COMMAND-ISSUER))[:CLEANUP] 3: (MODLISP::MODLISP-COMMAND-ISSUER #<SB-SYS:FD-STREAM for "socket 127.0.0.1:20123, peer: 127.0.0.1:48912" {C46F4C1}> #<MODLISP::ML-SERVER {E28F049}>) 4: ((LAMBDA () :IN INITIALIZE-INSTANCE)) 5: ((FLET #:WITHOUT-INTERRUPTS-BODY-223578 :IN SB-THREAD:MAKE-THREAD)) 6: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD:MAKE-THREAD)) 7: ((FLET #:WITHOUT-INTERRUPTS-BODY-88894 :IN SB-THREAD::CALL-WITH-MUTEX)) 8: (SB-THREAD::CALL-WITH-MUTEX ..) 9: (SB-THREAD::INITIAL-THREAD-FUNCTION) 10: ("foreign function: call_into_lisp") 11: ("foreign function: funcall0") 12: ("foreign function: new_thread_trampoline") 13: ("foreign function: #xB7FB4D4C") Backtrace: 0: (BREAK "break") 1: (KMRCL:CLOSE-ACTIVE-SOCKET #<SB-BSD-SOCKETS:INET-SOCKET 127.0.0.1:20123, peer: 127.0.0.1:49159, fd: 21 {C680BD1}>) 2: ((FLET #:CLEANUP-FUN-298 :IN INITIALIZE-INSTANCE))[:CLEANUP] 3: ((LAMBDA () :IN INITIALIZE-INSTANCE)) 4: ((FLET #:WITHOUT-INTERRUPTS-BODY-223578 :IN SB-THREAD:MAKE-THREAD)) 5: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD:MAKE-THREAD)) 6: ((FLET #:WITHOUT-INTERRUPTS-BODY-88894 :IN SB-THREAD::CALL-WITH-MUTEX)) 7: (SB-THREAD::CALL-WITH-MUTEX ..) 8: (SB-THREAD::INITIAL-THREAD-FUNCTION) 9: ("foreign function: call_into_lisp") 10: ("foreign function: funcall0") 11: ("foreign function: new_thread_trampoline") 12: ("foreign function: #xB7FB4D4C") On Mon, Mar 18, 2013 at 3:12 AM, Joe Corneli <hol...@gm...> wrote: > Hello: > > I'm just getting started using cl-modlisp (http://cl-modlisp.b9.com/) > under SBCL, but I see an error like the following whenever I load a > web page: > > ;; Error There is no applicable method for the generic function > #<STANDARD-GENERIC-FUNCTION SB-BSD-SOCKETS:SOCKET-CLOSE (1)> > when called with arguments > (#<SB-SYS:FD-STREAM > for "socket 127.0.0.1:20123, peer: 127.0.0.1:58955" > {B53CAE9}>). [1-modlisp-worker] > > The relevant function is actually close-active-socket in the kmrcl > package, which is implemented like this: > > (defun close-active-socket (socket) > #+sbcl (sb-bsd-sockets:socket-close socket) > #-sbcl (close socket)) > > This error message or a related one seems to have been discussed in > IRC before (http://ircarchive.info/lisp/2007/3/15/6.html) and also in > the TBNL mailing list > (http://comments.gmane.org/gmane.lisp.lib.tbnl.general/532), but I'm > not clear on the current fix. > > Thanks for any help or advice! > > Joe |
From: Nikodemus S. <nik...@ra...> - 2013-03-18 10:00:41
|
On 18 March 2013 05:12, Joe Corneli <hol...@gm...> wrote: > ;; Error There is no applicable method for the generic function > #<STANDARD-GENERIC-FUNCTION SB-BSD-SOCKETS:SOCKET-CLOSE (1)> > when called with arguments > (#<SB-SYS:FD-STREAM > for "socket 127.0.0.1:20123, peer: 127.0.0.1:58955" > (defun close-active-socket (socket) > #+sbcl (sb-bsd-sockets:socket-close socket) > #-sbcl (close socket)) Just on the basis of the error message, that should read (defun close-active-socket (socket) (close socket)) instead. It is however possible that there is some confusion elsewhere in the code, mixing up socket objects and socket streams -- if that's what's going on, then the confusion needs to be sorted out first. Cheers, -- Nikodemus |
From: Joe C. <hol...@gm...> - 2013-03-18 10:33:53
|
On Mon, Mar 18, 2013 at 10:00 AM, Nikodemus Siivola <nik...@ra...> wrote: >> (defun close-active-socket (socket) >> #+sbcl (sb-bsd-sockets:socket-close socket) >> #-sbcl (close socket)) > > Just on the basis of the error message, that should read > > (defun close-active-socket (socket) > (close socket)) > > instead. > > It is however possible that there is some confusion elsewhere in the > code, mixing up socket objects and socket streams -- if that's what's > going on, then the confusion needs to be sorted out first. Hi Nikodemus: I saw this idea in the IRC post I mentioned -- and I tried the change, but this led to another similar error: ;; Error The function COMMON-LISP-USER::PREM is undefined. [11-modlisp-worker] Error: There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION SB-GRAY::PCL-CLOSE (2)> when called with arguments (#<SB-BSD-SOCKETS:INET-SOCKET fd: 7 {ACFABF1}>). Joe |
From: Joe C. <hol...@gm...> - 2013-03-18 18:58:19
|
Given the second error message, one related issue I find online is this: https://bugs.launchpad.net/sbcl/+bug/839937 Maybe I just need to implement the equivalent of (defmethod close ((stream my-stream) &key abort) (close stream :abort abort)) ?? |
From: Stelian I. <sio...@cd...> - 2013-03-18 19:40:34
Attachments:
signature.asc
|
On Mon, 2013-03-18 at 18:58 +0000, Joe Corneli wrote: > Given the second error message, one related issue I find online is this: > > https://bugs.launchpad.net/sbcl/+bug/839937 > > Maybe I just need to implement the equivalent of > > (defmethod close ((stream my-stream) &key abort) > (close stream :abort abort)) > > ?? The biggest issue here is why you are trying to use cl-modlisp. That used to be popular 10 years ago, but in the meanwhile better alternatives in web programming have appeared. -- Stelian Ionescu a.k.a. fe[nl]ix Quidquid latine dictum sit, altum videtur. http://common-lisp.net/project/iolib |
From: Joe C. <hol...@gm...> - 2013-03-18 19:25:10
|
On Mon, Mar 18, 2013 at 7:23 PM, Stelian Ionescu <sio...@cd...> wrote: > The biggest issue here is why you are trying to use cl-modlisp. That > used to be popular 10 years ago, but in the meanwhile better > alternatives in web programming have appeared. Trying to make legacy code work for my job. Modernizing the web server does seem like a good idea but I'd prefer to start renovations from a working system if possible! |
From: Joe C. <hol...@gm...> - 2013-03-18 20:21:04
|
This seems to have worked. ;; Add this method to avoid getting an error (defmethod close ((stream sb-bsd-sockets:socket) &key abort) (close stream :abort abort)) ; (defun close-active-socket (socket) ; #+sbcl (sb-bsd-sockets:socket-close socket) ; #-sbcl (close socket)) (defun close-active-socket (socket) (close socket)) |