Comment 1 for bug 484143

Revision history for this message
Alastair Bridgewater (alastair-bridgewater) wrote :

A quick analysis: one hundred thousand elements times four bytes each (eight bytes on x86-64) is four hundred KB (eight hundred on x86-64). And that's from the APPLY, d-x listifying the rest-arg costs twice as much. You are attempting to blow your stack here (about 2.4 megs of stack usage for one call on x86-64).

The "corruption warning" failure mode is because LISTIFY-REST-ARGS performs a bulk allocation and then fills the space from low addresses to high, while the stack grows downwards on x86oids. This can easily miss the guard page completely (and can do so for as few as 1025 parameters on x86 or 513 on x86-64).

For some reason CALL-ARGUMENTS-LIMIT is set to MOST-POSITIVE-FIXNUM, which is a theoretical limit in some sense, but far beyond the practical limit imposed by the size of the control stack (then again, we have the same issue with array dimensions).

So, given that this is what the situation is, what is the correct behavior for when the user blows his stack in this manner, why, and how do we make it happen?