[MacPorts] #38999: base/src/pextlib1.0/tracelib.c setrlimit failure
#38999: base/src/pextlib1.0/tracelib.c setrlimit failure ------------------------+-------------------------------- Reporter: ajdudman@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Keywords: | Port: ------------------------+-------------------------------- 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. -- Ticket URL: <https://trac.macports.org/ticket/38999> MacPorts <http://www.macports.org/> Ports system for OS X
#38999: base/src/pextlib1.0/tracelib.c setrlimit failure -------------------------+-------------------------------- Reporter: ajdudman@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | -------------------------+-------------------------------- Comment (by ajdudman@…): Say OSX is 10.8.3 and open files are: {{{ ulimit -Sn 10240 ulimit -Hn 12288 }}} Then 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 analogous to closed, fixed Ticket 35612 for bsdmake and the solution is similar. -- Ticket URL: <https://trac.macports.org/ticket/38999#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#38999: base/src/pextlib1.0/tracelib.c setrlimit failure -------------------------+-------------------------------- Reporter: ajdudman@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | -------------------------+-------------------------------- Comment (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. -- Ticket URL: <https://trac.macports.org/ticket/38999#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#38999: base/src/pextlib1.0/tracelib.c setrlimit failure -------------------------+---------------------- Reporter: ajdudman@… | Owner: cal@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: | Keywords: Port: | -------------------------+---------------------- Changes (by cal@…): * cc: cal@… (removed) * status: new => assigned * owner: macports-tickets@… => cal@… Comment: Thanks, r105748. -- Ticket URL: <https://trac.macports.org/ticket/38999#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#38999: base/src/pextlib1.0/tracelib.c setrlimit failure -------------------------+-------------------- Reporter: ajdudman@… | Owner: cal@… Type: defect | Status: closed Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: fixed | Keywords: Port: | -------------------------+-------------------- Changes (by cal@…): * status: assigned => closed * resolution: => fixed Comment: I wonder why I never saw this message, though. -- Ticket URL: <https://trac.macports.org/ticket/38999#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#38999: base/src/pextlib1.0/tracelib.c setrlimit failure -------------------------+-------------------- Reporter: ajdudman@… | Owner: cal@… Type: defect | Status: closed Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: fixed | Keywords: Port: | -------------------------+-------------------- Description changed by macsforever2000@…: Old description:
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.
New description: 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. -- -- Ticket URL: <https://trac.macports.org/ticket/38999#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#38999: base/src/pextlib1.0/tracelib.c setrlimit failure -------------------------+-------------------- Reporter: ajdudman@… | Owner: cal@… Type: defect | Status: closed Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: fixed | Keywords: Port: | -------------------------+-------------------- Comment (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. -- Ticket URL: <https://trac.macports.org/ticket/38999#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#38999: base/src/pextlib1.0/tracelib.c setrlimit failure -------------------------+-------------------- Reporter: ajdudman@… | Owner: cal@… Type: defect | Status: closed Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: fixed | Keywords: Port: | -------------------------+-------------------- Comment (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(). -- Ticket URL: <https://trac.macports.org/ticket/38999#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
#38999: base/src/pextlib1.0/tracelib.c setrlimit failure -------------------------+-------------------- Reporter: ajdudman@… | Owner: cal@… Type: defect | Status: closed Priority: Normal | Milestone: Component: base | Version: 2.1.3 Resolution: fixed | Keywords: Port: | -------------------------+-------------------- Comment (by cal@…): 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. -- Ticket URL: <https://trac.macports.org/ticket/38999#comment:8> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts