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

Goffioul Michael goffioul at imec.be
Tue Apr 25 01:32:03 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.

Michael.




More information about the ecl-devel mailing list