Current-Users archive

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

bug in stack(7)?



Hi!

stack(7) has these paragraphs:

   Non-main threads
     Threads created with pthread_create(3) have stacks allocated at
     dynamically chosen addresses outside the main thread's stack region by
     default, and their stacks cannot be resized after creation.  On
     architectures where the stack grows down, the layout is:

     +--------------------+ stack base = stackaddr + stacksize + guardsize
     | stack              |
     | .                  |
     | .                  | <-- stack pointer (varies during execution)
     | .                  |
     +--------------------+ stackaddr
     | guard/redzone      |
     +--------------------+ stackaddr - guardsize

     On architectures where the stack grows up, the layout is:

     +--------------------+ stackaddr + stacksize + guardsize
     | guard/redzone      |
     +--------------------+ stackaddr + stacksize
     | .                  |
     | .                  | <-- stack pointer (varies during execution)
     | .                  |
     | stack              |
     +--------------------+ stack base = stackaddr



I think that in the first diagram, instead of "stack base = stackaddr
+ stacksize + guardsize" it should be "stack base = stackaddr +
stacksize".

Can someone please confirm this before I fix the man page?

Thanks,
 Thomas


Home | Main Index | Thread Index | Old Index