[Openmcl-devel] Threads want *terminal-io*, but do nothing once they get it.

Gary Byers gb at clozure.com
Tue Jul 12 01:14:31 UTC 2005



On Mon, 11 Jul 2005, [ISO-8859-1] Christian Nybø wrote:

>
> On Jun 22, 2005, at 11:34, Christian Nybø wrote:
>
>> > Break in process slave(3115): Expected newpos to be 9, fd is at 2048
>> > While executing: "Unknown"
>> 
>> 
>> ;;;
>> ;;; #<PROCESS slave(3115) [Active] #x68BAB2E> requires access to Shared 
>> Terminal Input
>> ;;;
>> 
>> ()
>> NIL
>> ? (:y 3115)
>> ?
>> 
>> Should it not give me a debugger prompt here?

Sorry; I missed this a few weeks ago.

>
> I guess I could add some context to the question above.
> I run slime 1.2.1, openmcl 0.14.3, xemacs 21.4.
>
> A thread hangs, and has output a message like the above in the 
> *inferior-lisp* buffer.
> With slime, I was wondering what am I supposed to do to get to the debugger 
> that's waiting in the process slave(3115)?
>
> :y calls this function from l1-streams.lisp:
> (defun %%yield-terminal-to (&optional process)
>  (let* ((shared-resource
>      (if (typep *terminal-io* 'two-way-stream)
>        (input-stream-shared-resource
>         (two-way-stream-input-stream *terminal-io*)))))
>    (when shared-resource (%yield-shared-resource shared-resource process))))
>
> When running under Slime, *terminal-io* is a synonym-stream, and there is no 
> method for (two-way-stream-input-stream *terminal-io*)
>
> I changed %%yield-terminal to:
>
> (defun %%yield-terminal-to (&optional process)
>  (let* ((stream (if (typep *terminal-io* 'synonym-stream)
>             (symbol-value (synonym-stream-symbol *terminal-io*))
>             *terminal-io*))
>     (shared-resource
>      (if (typep stream 'two-way-stream)
>          (input-stream-shared-resource
>           (two-way-stream-input-stream stream)))))
>    (when shared-resource (%yield-shared-resource shared-resource process))))
>
> and then (:y <process>) works in Slime.

That's good.  I'm not sure if it makes sense to try to make this
more general (e.g., to define some sort of STREAM-SHARED-INPUT-RESOURCE
generic function) or to just special-case SYNONYM-STREAM here.

>
> (:y) does not work yet, though, because there's a misplaced paren in the 
> definition of the toplevel command :y in l1-readloops-lds.lisp:
>
> (define-toplevel-command
>    :global y (&optional p) "Yield control of terminal-input to process
> whose name or ID matches <p>, or to any process if <p> is null"
>    (if p
>    (let* ((proc (find-process p)))
>      (%%yield-terminal-to proc)    ;may be nil
>      (%%yield-terminal-to nil))))
>

Yecch.  Thanks for pointing this out & fixing it.


More information about the Openmcl-devel mailing list