Changeset 14692


Ignore:
Timestamp:
Mar 22, 2011, 9:40:43 PM (9 years ago)
Author:
gb
Message:

Try to reserve a little more space at the bottom of the altstack
on Linux to avoid SIGBUS on newer Linux kernels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-exceptions.c

    r14672 r14692  
    23732373  stack.ss_flags = 0;
    23742374  mmap(stack.ss_sp,stack.ss_size, PROT_READ|PROT_WRITE|PROT_EXEC,MAP_FIXED|MAP_ANON|MAP_PRIVATE,-1,0);
     2375#ifdef LINUX
     2376  /* The ucontext pushed on the altstack may not contain the (largish)
     2377     __fpregs_mem field; copy_ucontext() wants to copy what it thinks
     2378     is a pointer to a full ucontext.  That'll touch a page beyond the
     2379     bottom of the altstack, and when this happens on the initial
     2380     thread's stack on a recent (2.6.32+?) kernel, we'll SIGBUS instead
     2381     of mapping that page.
     2382     It's easier to just reserve that page here than it would be to
     2383     change copy_ucontext().
     2384  */
     2385  stack.ss_size -= sizeof(struct ucontext);
     2386#endif
    23752387  if (sigaltstack(&stack, NULL) != 0) {
    23762388    perror("sigaltstack");
Note: See TracChangeset for help on using the changeset viewer.