[Ecls-list] debugging erros in different thread

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Sun Dec 7 20:40:51 UTC 2008

On Sun, Dec 7, 2008 at 2:39 AM, Anton Vodonosov <avodonosov at yandex.ru> wrote:
> Running the following from REPL:
>  (mp:process-run-function 'test (lambda () (error "test error")))
> [...]
> At this point no break-look commands (:h, :b) are available:
> [...]
> Is it a bug or known limitation

It is a limitation or a race condition if you want to call it that
way. Right after you enter the form (mp:process-run...), the toplevel
calls (read-char) to begin reading the next form. However, after this
or simultaneously, the second thread starts and signals an error. It
tries to invoke the toplevel for debugging, but the input stream is
already captured by the main toplevel, which knows nothing about the
error. The following, on the other hand, seems to work:
  (mp:process-run-function 'test (lambda () (error "test error")))
  (loop (sleep 10)))

Is there a way to solve this? Perhaps, but we run the risk of
interfering with other people's uses of threads. One possibility would
be to register any thread that invokes the toplevel, and when a new
toplevel is invoked, suspend that other thread and thus gain control
of the input stream. This cannot be done with the current version of
ECL and will have to wait for the new interrupt system.


Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28009 (Spain)

More information about the ecl-devel mailing list