[Openmcl-devel] Exception in foreign context

Patrick May patrick.may at mac.com
Sun Sep 13 09:36:18 PDT 2009


On Sep 13, 2009, at 10:53 AM, Patrick May wrote:
> 	I just got the following problem.  I don't know if it's related to  
> Clozure or to Hunchentoot (64-bit Linux):
> Welcome to Clozure Common Lisp Version 1.3-r12755M  (LinuxX8664)!
> ? STRING-OUTPUT-STREAM  #x300041AC43AD> is not of the expected  
> tyexception in foreign context
> Exception occurred while executing foreign code
> at create_exception_callback_frame + 80
> ? for help
> [5067] Clozure CL kernel debugger: ?
> (G)  Set specified GPR to new value
> (R)  Show raw GPR/SPR register values
> (L)  Show Lisp values of tagged registers
> (F)  Show FPU registers
> (S)  Find and describe symbol matching specified name
> (B)  Show backtrace
> (T)  Show info about current thread
> (X)  Exit from this debugger, asserting that any exception was handled
> (K)  Kill Clozure CL process
> (?)  Show this help
> [5067] Clozure CL kernel debugger: b
> current thread: tcr = 0x7fd6b38177b0, native thread ID = 0x1e96,  
> interrupts disabled
>
>
> [5067] Clozure CL kernel debugger: t
> Current Thread Context Record (tcr) = 0x7fd6b38177b0
> Control (C) stack area:  low = 0x7fd6b35c4000, high = 0x7fd6b3818000
> Value (lisp) stack area: low = 0x7fd6b33a2000, high = 0x7fd6b35b3000
> Exception stack pointer = 0x7fd6b35c3788
> [5067] Clozure CL kernel debugger: k
>
> Any idea what could be causing this?  Is anyone here running a  
> website with Clozure and Hunchentoot?

	I finally managed to get a backtrace on this problem.  I've reduced  
the deployment down to the latest Clozure running on 64-bit Linux with  
Hunchentoot 1.0.0 hosting only static files.  These files are  
generated from Dreamweaver, so I put them in a directory named  
'static' and configure Hunchentoot like this:

(push (hunchentoot:create-folder-dispatcher-and-handler
        "/"
        (make-pathname
         :directory (concatenate 'string *web-path* "/static")))
       hunchentoot:*dispatch-table*)

;; (register-static-file "crossdomain.xml")

(defun display-home-page ()
   "Display the home page."
   (hunchentoot:redirect "/index.html"))

(push (hunchentoot:create-regex-dispatcher "^/$" 'display-home-page)
       hunchentoot:*dispatch-table*)

I start the server like this:

(defparameter hunchentoot:*message-log-pathname*
   "/tmp/hunchentoot-message.log")
(defparameter hunchentoot:*access-log-pathname*
   "/tmp/hunchentoot-access.log")

(defparameter *web-acceptor*
   (make-instance 'hunchentoot:acceptor :port 8080))

(hunchentoot:start *web-acceptor*)

	This works for a random amount of time, then I get errors like this  
in the Hunchentoot message log:

[2009-09-13 15:35:16 [ERROR]] Error while processing connection: Input  
timeout o
n #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/13) #x300041C5834D>
[2009-09-13 15:35:16 [ERROR]] Error while processing connection: Input  
timeout o
n #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/6) #x300041C5E9AD>
[2009-09-13 15:35:16 [ERROR]] Error while processing connection: Input  
timeout o
n #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/14) #x300041C599AD>

And this in the output log (I'm running via detachtty, if that makes a  
difference):

Welcome to Clozure Common Lisp Version 1.3-r12755M  (LinuxX8664)!
? STRING-OUTPUT-STREAM  #x300041A9E7CD> is not of the expected type
STRUCTURE.#<STRING-OUTPUT-STREAM  #x300041A9E7CD> is not of the  
expected type ST
RUCTURE.Error:
  is not of the expected type STRUCTURE.
 > Error: value #<STRING-OUTPUT-STREAM  #x30004197E41D> is not of the  
expected ty
pe STRUCTURE.
 > While executing: CCL::CREATE-STRING-OUTPUT-STREAM-IOBLOCK
 > Error: value #<STRING-OUTPUT-STREAM  #x30004197E41D> is not of the  
expected ty
pe STRUCTURE.
 > While executing: CCL::CREATE-STRING-OUTPUT-STREAM-IOBLOCK
 > Error: value #<STRING-OUTPUT-STREAM  #x30004197E41D> is not of the  
expected ty
pe STRUCTURE.
 > While executing: CCL::CREATE-STRING-OUTPUT-STREAM-IOBLOCK, in  
process Hunchent
oot worker (client: 67.86.101.207:62566)(28).
, in process Hunchentoot worker (client: 67.86.101.207:62564)(26).
, in process Hunchentoot listener (*:8080)(3).

 > Error: value #<STRING-OUTPUT-STREAM  #x30004197E41D> is not of the  
expected type STRUCTURE.
 > While executing: CCL::CREATE-STRING-OUTPUT-STREAM-IOBLOCK, in  
process Hunchentoot worker (client: 67.86.101.207:62567)(29).


;;;
;;; #<PROCESS Hunchentoot listener (*:8080)(3) [Reset] #x30004193F0FD>  
requires
access to Shared Terminal Input
;;; Type (:y 3) to yield control to this thread.
;;;

When I connect with attachtty and yield control to thread 3, I get this:

(:y 3)


;;;
;;; Shared Terminal Input is now owned by #<PROCESS Hunchentoot  
listener (*:8080
)(3) [Reset] #x30004193F0FD>
;;;

 > Type :POP to abort, :R for a list of available restarts.
 > Type :? for other options.
1 > :r
 >   Type (:C <n>) to invoke one of the following restarts:
0. Return to break level 1.
1. #<RESTART ABORT-BREAK #x7FC397FF6BDD>
2. Reset this thread
3. Kill this thread
1 > :b
*(7FC398197CC0) : 0 (CREATE-STRING-OUTPUT-STREAM-IOBLOCK :STREAM  
#<STRING-OUTPUT
-STREAM  :CLOSED #x300042D1C64D> :STRING "" :ELEMENT-TYPE  
CHARACTER :WRITE-CHAR-
FUNCTION CCL::STRING-OUTPUT-STREAM-IOBLOCK-WRITE-CHAR :WRITE-CHAR-WHEN- 
LOCKED-FU
NCTION CCL::STRING-OUTPUT-STREAM-IOBLOCK-WRITE-CHAR :WRITE-SIMPLE- 
STRING-FUNCTIO
N CCL::STRING-OUTPUT-STREAM-IOBLOCK-WRITE-SIMPLE-STRING :FORCE-OUTPUT- 
FUNCTION #
<Compiled-function FALSE #x300040018DCF> :CLOSE-FUNCTION #<Compiled- 
function CCL
::%CLOSE-STRING-OUTPUT-STREAM #x3000403672CF>) 236
  (7FC398197D50) : 1 (%%MAKE-STRING-OUTPUT-STREAM #<BUILT-IN-CLASS  
STRING-OUTPUT-
STREAM> "" CCL::STRING-OUTPUT-STREAM-IOBLOCK-WRITE-CHAR CCL::STRING- 
OUTPUT-STREA
M-IOBLOCK-WRITE-SIMPLE-STRING) 269

. . .

(7FC39824ADA8) : 7733 (FUNCALL #'#<#<STANDARD-METHOD  
HUNCHENTOOT:HANDLE-INCOMIN
G-CONNECTION (HUNCHENTOOT:ONE-THREAD-PER-CONNECTION-TASKMASTER T)>>  
#<HUNCHENTOO
T:ONE-THREAD-PER-CONNECTION-TASKMASTER #x30004194057D>  
#<USOCKET:STREAM-USOCKET
#x3000420BB88D>) 181
  (7FC39824ADD0) : 7734 (FUNCALL #'#<#<STANDARD-METHOD  
HUNCHENTOOT:ACCEPT-CONNECT
IONS (HUNCHENTOOT:ACCEPTOR)>> #<ACCEPTOR (host *, port 8080)>) 1061
  (7FC39824AE70) : 7735 (FUNCALL #'#<(:INTERNAL BORDEAUX- 
THREADS::BINDING-DEFAULT
-SPECIALS)>) 805
  (7FC39824AEB8) : 7736 (RUN-PROCESS-INITIAL-FORM #<PROCESS  
Hunchentoot listener
(*:8080)(3) [Reset] #x30004193F0FD> (#<COMPILED-LEXICAL-CLOSURE #  
#x30004193F06F
 >)) 717
  (7FC39824AF48) : 7737 (FUNCALL #'#<(:INTERNAL CCL::%PROCESS-PRESET- 
INTERNAL)> #
<PROCESS Hunchentoot listener (*:8080)(3) [Reset] #x30004193F0FD>  
(#<COMPILED-LE
XICAL-CLOSURE # #x30004193F06F>)) 389
  (7FC39824AF98) : 7738 (FUNCALL #'#<(:INTERNAL CCL::THREAD-MAKE- 
STARTUP-FUNCTION
)>) 301
1 >

	The full backtrace is available at http://www.softwarematters.org/ccl64-dribble.gz 
.

	Is this a Clozure or Hunchentoot issue?

Thanks,

Patrick




More information about the Openmcl-devel mailing list