Opened 3 years ago
Closed 3 years ago
#8912 closed bug (fixed)
getrlimit with RLIMIT_STACK should return USER_MAIN_THREAD_STACK_SIZE
| Reported by: | edglex | Owned by: | bonefish |
|---|---|---|---|
| Priority: | normal | Milestone: | R1 |
| Component: | System/POSIX | Version: | R1/Development |
| Keywords: | Cc: | ||
| Blocked By: | Blocking: | ||
| Has a Patch: | yes | Platform: | All |
Description
The value returned from getrlimit with RLIMIT_STACK includes the guard pages and TLS area, but in pthread_attr_setstacksize the max stack size is MAX_USER_STACK_SIZE. Calling pthread_attr_setstacksize with the value returned from getrlimit thus fails.
According to posix, getrlimit should return the maximum size of the initial thread's stack
http://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html
i.e. USER_MAIN_THREAD_STACK_SIZE (which is the same as MAX_USER_STACK_SIZE).
Patch to follow.
Attachments (1)
Change History (5)
Changed 3 years ago by edglex
comment:1 Changed 3 years ago by edglex
- Has a Patch set
comment:2 Changed 3 years ago by anevilyak
- Owner changed from nobody to bonefish
- Status changed from new to assigned
- Version changed from R1/alpha3 to R1/Development
comment:3 Changed 3 years ago by bonefish
comment:4 Changed 3 years ago by anevilyak
- Resolution set to fixed
- Status changed from assigned to closed
Applied in hrev44581. Thanks!
Note: See
TracTickets for help on using
tickets.

The patch looks OK. Not sure when I get around to apply it. So, if anyone wants to beat me to it...