[Ecls-list] Problem in compiled code with nargs > 64

Goffioul Michael goffioul at imec.be
Tue Apr 25 01:48:01 UTC 2006

> Hi,
> Still trying to make CMN work with ECL, I succeeded in 
> interpreted form, thanks to recent changes. However, I get a 
> segmentation fault in compiled form.
> Itracked down the problem and the crash occurs when loading 
> the compiled cmn0.fasl file at a cl_list() call with 73 
> arguments (it corresponds to a class definition with a lot of 
> slots). When I follow the code:
> 1) cl__va_start() sets up the args object, but sets the stack pointer
> (sp) to a
> negative number (cl_stack_index() => 10 and args[0].narg => 
> 73); however, the stack pointer is an unsigned int, so it is 
> actually set to a very large number, due to underflow
> 2) at the first cl_va_arg() call, the code tries to access 
> cl_env.stack[args[0].sp++] and segfaults; indeed the computed 
> index is very large due to unsigned underflow from step 1.

The attached file reproduces the problem.
Compile and load the FAS file.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: testcmp.lsp
Type: application/octet-stream
Size: 622 bytes
Desc: testcmp.lsp
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060425/205a1dac/attachment.obj>

More information about the ecl-devel mailing list