[Ecls-list] TOP LEVEL REPL crash on

Dean O'Connor dean.oconnor at ite.com.au
Thu May 3 08:45:27 UTC 2007


Sorry to have this deluge of posts ...

I've tried searching the archive (but SourceForge is a dog and keeps 
timing out).

I have a pretty standard top-level that I use embedded in my C++ 
program. Looks almost same as in cinit.c. The REPL works, sorta.
I can type simple "correct" things, but anything that would be an error 
(eg. using undefined symbol) causes a crash.

Then I get these errors in the command screen along with an access 
violation.
"0 is an illegal frs index.
Broken at |SI|:|TOP-LEVEL|.No restarts available"

I guess there is a simple reason why. Do I have to setup some error 
handler or something ?
How do I go about that ?

Here's the basic REPL setup code:

cl_object top_level = _ecl_intern("TOP-LEVEL", cl_core.system_package);
cl_def_c_function(top_level, si_simple_toplevel, 0);
l_object res = funcall(1, top_level);

cl_object
si_simple_toplevel ()
 {
     cl_object sentence;
     int i;

    #define MAXPAGE 16834            // Not sure why this is needed ???

     /* Simple minded top level loop */
     printf(";*** Lisp core booted ****\nECLS (Embeddable Common Lisp)  
%d pages\n", MAXPAGE);
     fflush(stdout);
     for (i = 1; i<fix(si_argc()); i++) {
       cl_object arg = si_argv(MAKE_FIXNUM(i));
       cl_load(1, arg);
     }
     while (1) {
       printf("\n> ");
       sentence = cl_read(3, Cnil, Cnil, OBJNULL);
       if (sentence == OBJNULL)
          return0();
      ecl_prin1(cl_safe_eval(sentence, Cnil, OBJNULL), Cnil);
     }
}

STACK DUMP
===========
 >    ecl.dll!GC_clear_fl_marks(char * q=0x01e6fc64)  Line 624 + 0x18 
bytes    C
     ecl.dll!GC_finish_collection()  Line 706 + 0xf bytes    C
     ecl.dll!GC_try_to_collect_inner(int (void)* stop_func=0x100049f0)  
Line 391    C
     ecl.dll!GC_collect_or_expand(unsigned long needed_blocks=1, int 
ignore_off_page=0)  Line 1009 + 0xa bytes    C
     ecl.dll!GC_allocobj(unsigned long sz=6, int kind=1)  Line 1087 + 
0x9 bytes    C
     ecl.dll!GC_generic_malloc_inner(unsigned long lb=20, int k=1)  Line 
138 + 0xd bytes    C
     ecl.dll!GC_generic_malloc(unsigned long lb=20, int k=1)  Line 194 + 
0xd bytes    C
     ecl.dll!GC_malloc(unsigned int lb=20)  Line 319 + 0xb bytes    C
     ecl.dll!cl_alloc_object(cl_type t=t_base_string)  Line 107 + 0x10 
bytes    C
     ecl.dll!make_simple_base_string(char * s=0x10150f7c)  Line 130 + 
0x7 bytes    C
     ecl.dll!FEerror(const char * s=0x10150f7c, int narg=0, ...)  Line 
64 + 0x16 bytes    C
     ecl.dll!handle_signal(int sig=11)  Line 118 + 0xc bytes    C
     ecl.dll!signal_catcher(int sig=11)  Line 166 + 0x9 bytes    C
     msvcr80d.dll!_XcptFilter(unsigned long xcptnum=3221225477, 
_EXCEPTION_POINTERS * pxcptinfoptrs=0x00033428)  Line 369 + 0xa bytes    C
     vizeq_lisp.exe!__tmainCRTStartup()  Line 614 + 0x17 bytes    C
     msvcr80d.dll!@_EH4_CallFilterFunc at 8()  + 0x12 bytes    Asm
     msvcr80d.dll!_except_handler4_common(unsigned int * 
CookiePointer=0x0041a040, void (unsigned int)* 
CookieCheckFunction=0x00411023, _EXCEPTION_RECORD * 
ExceptionRecord=0x00033534, _EXCEPTION_REGISTRATION_RECORD * 
EstablisherFrame=0x0012ffa8, _CONTEXT * ContextRecord=0x00033584, void * 
DispatcherContext=0x00033510)  + 0xba bytes    C
     vizeq_lisp.exe!_except_handler4(_EXCEPTION_RECORD * 
ExceptionRecord=0x00033534, _EXCEPTION_REGISTRATION_RECORD * 
EstablisherFrame=0x0012ffa8, _CONTEXT * ContextRecord=0x00033584, void * 
DispatcherContext=0x00033510)  + 0x22 bytes    C
     ntdll.dll!7d61ec22()    





More information about the ecl-devel mailing list