[Ecls-list] Weird problem with Exscribe on ECL

Juan Jose Garcia-Ripoll jjgarcia at users.sourceforge.net
Sat Mar 24 10:41:13 UTC 2007

2007/3/13, Faré <fahree at gmail.com>:
> 1- When I dump an image, the resulting image seems to bug out during
> initialization, way before the epilogue-code gets a chance to run, and
> I am dropped at the REPL. However, it is not possible to debug the
> code as is, because the stack is emptied before the REPL is activated
> (no backtrace).

Well, it is not that the stack is emptied, but rather that the
debugger is designed so as to inspect the stack only up to the
previous call of top-level. If you have errors before initialization,
then the problem is the toplevel is invoked for the first time with
the debugger and you see nothing on the stack.

In any case the best solution to this problem is to use a real world
debugger and set breakpoints at the appropiate functions (cl_error,
cl_cerror, etc), and then inspecting the C variables for their lisp
values. With the backtrace you will also get information on the C
functions which caused the error. This is important because compiled
code cannot be debugged from the ordinary lisp debugger, as the latter
knows nothing about C variables.

> 2- When I run ECL without dumping an image, it works. But I can't seem
> to be able to call compile-file recursively, so I have to load without
> compiling. (style files are normal lisp programs and work better when
> they are compiled).

The compiler is an old beast and it assumes that it can do whatever it
wants with its global variables. Since, when you invoke the compiler,
the value of special variables is simply reset rather than saved in a
LET form this makes it impossible to call the compiler recursively.

The ideal solution for this would be to store compiler data in a sort
of "environment" data structure that can be created from scratch for
each compiler invocation. Compilation should then be both thread safe
and reentrant. Not difficult, but quite some work.


Facultad de Fisicas, Universidad Complutense,
Ciudad Universitaria s/n Madrid 28040 (Spain)

More information about the ecl-devel mailing list