Raymond Toy pushed to branch rtoy-mmap-anon-control-and-binding-stacks at cmucl / cmucl

Commits:

2 changed files:

Changes:

  • src/lisp/Linux-os.c
    --- a/src/lisp/Linux-os.c
    +++ b/src/lisp/Linux-os.c
    @@ -454,17 +454,17 @@ sigsegv_handler(HANDLER_ARGS)
     #ifdef i386
         interrupt_handle_now(signal, contextstruct);
     #else
    -#define CONTROL_STACK_TOP (((char*) CONTROL_STACK_START) + control_stack_size)
    +#define CONTROL_STACK_TOP (((char*) control_stack) + control_stack_size)
     
         addr = arch_get_bad_addr(signal, code, context);
     
         if (addr != NULL && context->sc_regs[reg_ALLOC] & (1 << 63)) {
     	context->sc_regs[reg_ALLOC] -= (1 << 63);
     	interrupt_handle_pending(context);
    -    } else if (addr > CONTROL_STACK_TOP && addr < BINDING_STACK_START) {
    +    } else if (addr > CONTROL_STACK_TOP && addr < (os_vm_address_t)binding_stack) {
     	fprintf(stderr, "Possible stack overflow at 0x%08lX!\n", addr);
     	/* try to fix control frame pointer */
    -	while (!(CONTROL_STACK_START <= *current_control_frame_pointer &&
    +	while (!((lispobj)control_stack <= *current_control_frame_pointer &&
     		 *current_control_frame_pointer <= CONTROL_STACK_TOP))
     	    ((char *) current_control_frame_pointer) -= sizeof(lispobj);
     	ldb_monitor();
    

  • src/lisp/gencgc.c
    --- a/src/lisp/gencgc.c
    +++ b/src/lisp/gencgc.c
    @@ -7501,16 +7501,16 @@ scavenge_interrupt_handlers(void)
     static void
     scavenge_control_stack(void)
     {
    -    unsigned long control_stack_size;
    +    unsigned long current_stack_size;
     
    -    control_stack_size = current_control_stack_pointer - control_stack;
    +    current_stack_size = current_control_stack_pointer - control_stack;
     
     #ifdef PRINTNOISE
         printf("Scavenging the control stack (%d bytes) ...\n",
    -	   control_stack_size * sizeof(lispobj));
    +	   current_stack_size * sizeof(lispobj));
     #endif
     
    -    scavenge(control_stack, control_stack_size);
    +    scavenge(control_stack, current_stack_size);
     
     #ifdef PRINTNOISE
         printf("Done scavenging the control stack.\n");