chicken-hackers
[Top][All Lists]
Advanced

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

Re: Re: [Chicken-hackers] Detecting incipient stack overflow


From: Zbigniew
Subject: Re: Re: [Chicken-hackers] Detecting incipient stack overflow
Date: Sun, 1 Oct 2006 01:14:29 -0500

The initial chain goes like this:

C_main_entry_point [main] -> CHICKEN_main ->
CHICKEN_parse_command_line [optionally set nursery size] ->
CHICKEN_initialize ->

stack_size = stack ? stack : DEFAULT_STACK_SIZE;

-> CHICKEN_run ->

C_stack_limit = (C_word *)((C_byte *)C_stack_pointer - stack_size);

and subsequently it could be modified by C_do_resize_stack or
C_callback_adjust_stack_limits.

Does that get you started?

On 9/30/06, John Cowan <address@hidden> wrote:
felix winkelmann scripsit:
> On 9/30/06, John Cowan <address@hidden> wrote:
> >How does the Chicken runtime detect incipient C stack overflow
> >reliably?  I tried to RTFS, but got lost in a maze.
>
> You mean the stack-overflow that triggers a minor GC? Very simple,
> it regularly compares the current stack-pointer with a precomputed limit
> (see C_demand in chicken.h).

Yes, I was able to trace that far.  But how does C_stack_limit
actually get set?  Looking for assignments to it just confused me
further.

--
John Cowan  address@hidden  http://ccil.org/~cowan
The competent programmer is fully aware of the strictly limited size of his own
skull; therefore he approaches the programming task in full humility, and among
other things he avoids clever tricks like the plague.  --Edsger Dijkstra


_______________________________________________
Chicken-hackers mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-hackers





reply via email to

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