chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] Detect and signal error on stack overflow in `


From: Evan Hanson
Subject: [Chicken-hackers] [PATCH] Detect and signal error on stack overflow in `apply`
Date: Sat, 10 Sep 2016 22:27:21 +1200

Hi Peter,

On 2016-08-15 21:52, Peter Bex wrote:
> With this patch, CHICKEN no longer borks via an assertion failure.
> Instead, it will either loop forever if the stack itself is too small

I think looping forever in this situation is potentially quite nasty for
users, since without an understanding of how `apply` works under the
hood it'd be very difficult to debug. The attached patch makes CHICKEN
raise a Scheme-level exception when this happens, instead. The approach
is extremely simple, please see the commit message for an explanation.

Unless I'm overlooking something this will actually work for most other
procedures, too, but for right now I've only applied it (heh) to C_apply
and C_apply_values since those are the functions most likely to have an
unsatisfiable stack demand. If it looks good, though, it might be worth
investigating as a general safety measure, assuming the performance
impact is negligible.

This patch applies atop the previous one in the thread, so if it looks
OK I'm happy to push that one first.

Cheers,

Evan

Attachment: 0001-Detect-and-signal-error-on-stack-overflow-in-apply.master.patch
Description: Text Data

Attachment: 0001-Detect-and-signal-error-on-stack-overflow-in-apply.chicken-5.patch
Description: Text Data

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]