Opened 12 years ago

Closed 12 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:
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)

0001-getrlimit-with-RLIMIT_STACK-now-returns-USER_MAIN_TH.patch (894 bytes ) - added by edglex 12 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by edglex, 12 years ago

patch: 01

comment:2 by anevilyak, 12 years ago

Owner: changed from nobody to bonefish
Status: newassigned
Version: R1/alpha3R1/Development

comment:3 by bonefish, 12 years ago

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

comment:4 by anevilyak, 12 years ago

Resolution: fixed
Status: assignedclosed

Applied in hrev44581. Thanks!

Note: See TracTickets for help on using tickets.