#38999 closed defect (fixed)
base/src/pextlib1.0/tracelib.c setrlimit failure
Reported by: | ajdudman | Owned by: | neverpanic (Clemens Lang) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | base | Version: | 2.1.3 |
Keywords: | Cc: | ||
Port: |
Description (last modified by mf2k (Frank Schima))
Say OSX is 10.8.3 and open files are:
ulimit -Sn 10240 ulimit -Hn 12288
Then the current code will have rl.rlim_max as 12288, which is greater than OPEN_MAX. This produces an error in setrlimit() at line 438. See the attached log. OSX's setrlimit(2) is tricky and recently its behavior has changed. The manual page gives highlights. This problem is analogous to closed, fixed ticket:35612 for bsdmake and the solution is similar.
Attachments (4)
Change History (12)
Changed 12 years ago by ajdudman
comment:1 Changed 12 years ago by ajdudman
Say OSX is 10.8.3 and open files are:
ulimit -Sn 10240 ulimit -Hn 12288
The current code uses RLIM_INFINITY. This produces an error in setrlimit() at line 438. See the attached log. OSX's setrlimit(2) is tricky and recently its behavior has changed. The manual page gives highlights. This problem is like closed, fixed Ticket 35612 for bsdmake and the solution is similar.
comment:2 Changed 12 years ago by ajdudman
Sorry for the ugly ticket. I am having trouble editing the description. Please strike out the first sentence of the second paragraph. That applied to the old code for bsdmake port and is not valid here.
comment:3 Changed 12 years ago by neverpanic (Clemens Lang)
Cc: | cal@… removed |
---|---|
Owner: | changed from macports-tickets@… to cal@… |
Status: | new → assigned |
Thanks, r105748.
comment:4 Changed 12 years ago by neverpanic (Clemens Lang)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I wonder why I never saw this message, though.
comment:5 Changed 12 years ago by mf2k (Frank Schima)
Description: | modified (diff) |
---|
comment:6 Changed 12 years ago by ajdudman
Cal, Did you set rlim_max to something less than default unlimited in your shell, before running "port -t" command? That is when I see it.
comment:7 Changed 12 years ago by ajdudman
I do not like my patch from yesterday nor r105748 as they are incomplete. The rl structure must be initialized first by calling getrlimit().
comment:8 Changed 12 years ago by neverpanic (Clemens Lang)
You're right, the struct might not be initialized; I should have seen that before commiting.
My shell seems to have a default soft limit on the number of open files (I never changed any limit settings). It currently is 2560, but I recall it being 256 when I checked last time. Maybe the OS (or my shell) is doing some magic… The hard limit is unlimited, though.
Your patch looks good, but if getrlimit failed, setrlimit would work on unitialized data structures, so I thought it might be better to only run setrlimit when getrlimit succeeds. See r105765.
log showing setrlimit warning