Re: Use of alternate stack for signal handler



Kasper Dupont <57203463996516718595@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
> Madhav wrote:
>> Can anyone tell me about typical uses of having a different
>> stack for signal handlers? and what may be the disadvantages
>> of using the default stack?
>
> One advantage of using a different stack is, that it will
> still work if the usual stack is full.

I didn't think userland stacks could get "full" without
ulimit(). There's a guard page at bottom that will
automagically map in another page. I don't know if
kernel stacks do this.

> In a multithreaded program, you will have a stack per thread.

Of course, but they will be CoW and buried stack
won't be replicated.

-- Robert

.



Relevant Pages

  • Re: [PATCH 0/4] coredump: core dump masking support v3
    ... realistically the only one I have run into were stack overflows, ... Duff SIGSEGV or SIGBUS signal handlers are just as realistic. ... And any time you say "by carefully setting up" you can guarantee someone's ... we should just give up the coredumping in kernel. ...
    (Linux-Kernel)
  • [PATCH] PPC: fix stack alignment for signal handlers
    ... Both the PPC32 and PPC64 ABIs specify that the stack should be kept aligned ... In addition to the PPC64 signal frame itself being of misaligned size, ... For PPC32 signal handlers, while the frame itself was of properly aligned ...
    (Linux-Kernel)
  • Re: When to use automatic variables and when to use malloc
    ... You could do the old 'stack address subtraction' trick, ... However, when I write a handler for SIGSEGV, the ... One thing you might find in the system's documentation is ... that signal handlers might not be called if there's no stack ...
    (comp.lang.c)
  • Use of alternate stack for signal handler
    ... stack for signal handlers? ... and what may be the disadvantages of using ... Prev by Date: ...
    (comp.os.linux.development.system)
  • Re: Shared pagetables
    ... >> Obviously CoW page tables will be more complicated. ... > to the stack page and force CoW to give parent and child ... only the second level. ... have large mmaped files or shared memory, ...
    (comp.os.linux.development.system)