Hello;
I have just installed TBNL on debian sarge, using SBCL 0.8.19.39. The Kevin Rosemberg packages were installed using apt-get, and TBNL and other dependencies were installed using asdf-install
The example seems to work fine, except for the "session" page. The page is displayed fine initially, but when I try to submit a change it displays the "An error has occured" message. (The upload files example works fine).
This error occurs using both mod_lisp and 'stand-alone' tbnl. When using mod_lisp, thefollwing messaged is logged in the apache error log:
[Fri Mar 18 20:28:55 2005] [error] (20014)Error string not specified yet: [TBNL] The assertion (NOT [Fri Mar 18 20:28:55 2005] [error] (20014)Error string not specified yet: [TBNL] (EQL SB-THREAD::NEW-VALUE [Fri Mar 18 20:28:55 2005] [error] (20014)Error string not specified yet: [TBNL] (SB-THREAD:MUTEX-VALUE SB-THREAD::LOCK))) failed.
Any hint about why this error appears? Is there anything I can do to get a more detailed description of the error in the lisp repl or in the browser?
Thanks, Sergio
On Fri, 18 Mar 2005 19:48:35 +0100, Sergio Garcia sergio.garcia@gmail.com wrote:
[Fri Mar 18 20:28:55 2005] [error] (20014)Error string not specified yet: [TBNL] The assertion (NOT [Fri Mar 18 20:28:55 2005] [error] (20014)Error string not specified yet: [TBNL] (EQL SB-THREAD::NEW-VALUE [Fri Mar 18 20:28:55 2005] [error] (20014)Error string not specified yet: [TBNL] (SB-THREAD:MUTEX-VALUE SB-THREAD::LOCK))) failed.
That seems to a problem with SBCL's threading. Do you use an x86 processor? Are threads enabled in your build of SBCL? Do you use a 2.4 or a 2.6 kernel?
Any hint about why this error appears? Is there anything I can do to get a more detailed description of the error in the lisp repl or in the browser?
Yes, see here: http://weitz.de/tbnl/#log.
You can, for example, show backtraces in the error log or in the browser.
HTH, Edi.
That seems to a problem with SBCL's threading. Do you use an x86 processor? Are threads enabled in your build of SBCL? Do you use a 2.4 or a 2.6 kernel?
Ah!. I just read SBCL threading is only supported on 2.6 kernels, and I am using a 2.4. Thanks.
Sergio
Ah!. I just read SBCL threading is only supported on 2.6 kernels, and I am using a 2.4. Thanks.
Sergio
I upgraded to a 2.6 kernel, and the error message stopped. However, the problem changed. Now, the browser just freezed, and in the sbcl REPL I got:
WARNING: recursive lock attempt #S(SB-THREAD:MUTEX :NAME "session-data-lock" :LOCK 0 :DATA NIL :VALUE 5041)
I had a look at the code of session, and it seems to me that setting-f a session-value when a session has not been created, creates a nested "with-lock-held" on a same object by calling start-session. I just put a start-session at the beggining of the session test, and it seems to work fine now. Is this right?
On Sat, 19 Mar 2005 19:50:22 +0100, Sergio Garcia sergio.garcia@gmail.com wrote:
I upgraded to a 2.6 kernel, and the error message stopped. However, the problem changed. Now, the browser just freezed, and in the sbcl REPL I got:
WARNING: recursive lock attempt #S(SB-THREAD:MUTEX :NAME "session-data-lock" :LOCK 0 :DATA NIL :VALUE 5041)
I had a look at the code of session, and it seems to me that setting-f a session-value when a session has not been created, creates a nested "with-lock-held" on a same object by calling start-session. I just put a start-session at the beggining of the session test, and it seems to work fine now. Is this right?
The analysis is right, but the cure isn't. (Well, in this particular case it probably is.) The problem is that parts of TBNL assume that locks /can/ be nested which is the case for CMUCL, LW, and AllegroCL. You might want to ask on the SBCL mailing list how to get locks that can be nested or alternatively ask Kevin Rosenberg to patch KMRCL.
The easiest way is to switch to CMUCL, though... :)
Cheers, Edi.
Ok, thanks!
I just switched to SBCL from CMUCL because of the lack of unicode support in CMUCL :( *sigh*
On Sat, 19 Mar 2005 20:52:34 +0100, Edi Weitz edi@agharta.de wrote:
On Sat, 19 Mar 2005 19:50:22 +0100, Sergio Garcia sergio.garcia@gmail.com wrote:
I upgraded to a 2.6 kernel, and the error message stopped. However, the problem changed. Now, the browser just freezed, and in the sbcl REPL I got:
WARNING: recursive lock attempt #S(SB-THREAD:MUTEX :NAME "session-data-lock" :LOCK 0 :DATA NIL :VALUE 5041)
I had a look at the code of session, and it seems to me that setting-f a session-value when a session has not been created, creates a nested "with-lock-held" on a same object by calling start-session. I just put a start-session at the beggining of the session test, and it seems to work fine now. Is this right?
The analysis is right, but the cure isn't. (Well, in this particular case it probably is.) The problem is that parts of TBNL assume that locks /can/ be nested which is the case for CMUCL, LW, and AllegroCL. You might want to ask on the SBCL mailing list how to get locks that can be nested or alternatively ask Kevin Rosenberg to patch KMRCL.
The easiest way is to switch to CMUCL, though... :)
Cheers, Edi.
On Sat, 19 Mar 2005 20:58:48 +0100, Sergio Garcia sergio.garcia@gmail.com wrote:
I just switched to SBCL from CMUCL because of the lack of unicode support in CMUCL :( *sigh*
Well, I think it's not too hard. Something like (untested):
cd /path/to/tbnl perl -i.bak -p -e 's/kmrcl::with-lock-held/with-lock-held*/' *lisp
Then in specials.lisp add:
#+:sbcl (defvar *locked* nil)
And in util.lisp:
#-:sbcl (defmacro with-lock-held* ((lock) &body body) `(kmrcl::with-lock-held (,lock) ,@body))
#+:sbcl (defmacro with-lock-held* ((lock) &body body) `(cond (*locked* ,@body) (t (let ((*locked* t)) (kmrcl::with-lock-held (,lock) ,@body)))))
Cheers, Edi.
On Sat, 19 Mar 2005 21:17:49 +0100, Edi Weitz edi@agharta.de wrote:
Something like (untested):
This doesn't take into account that newer TBNL versions employ two different locks so the actual solution will be a little more complicated. But the idea should be the same.
Maybe like this (again untested):
#+:sbcl (defvar *locks* nil)
#-:sbcl (defmacro with-lock-held* ((lock) &body body) `(kmrcl::with-lock-held (,lock) ,@body))
#+:sbcl (defmacro with-lock-held* ((lock) &body body) (with-rebinding (lock) `(cond ((find ,lock *locks*) ,@body) (t (let ((*locks* (cons ,lock *locks*))) (kmrcl::with-lock-held (,lock) ,@body))))))
On Sat, 19 Mar 2005 21:30:27 +0100, Edi Weitz edi@agharta.de wrote:
Maybe like this (again untested): [code follows[
I found a "with-recursive-lock" in SBCL that did the trick. Kevin Rosenberg told me on IRC he will modify kmrcl accordingly.
Thanks for your help, and see you in Amsterdam.
Sergio.