-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Michael,

On 7/18/16 8:53 AM, Michael Diener wrote:
> On 6 July 2016 at 00:09, Christopher Schultz
> <ch...@christopherschultz.net> wrote:
> 
>>> From what I understand a buffer overflow would only happen for 
>>> FD_SET if the fd_set gets over 1024 descriptors. I made sure
>>> that my ulimit for open files is set and applied large enough,
>>> so that's not it.
>> 
>> There's nothing magic about the ulimit. An fd_set should size 
>> appropriately for your OS. On my Linux system, FD_SETSIZE happens
>> to be set to 1024. Reading through the byzantine labyrinth of
>> includes, it appears that FD_SET has zero boundary-checking, so
>> it's therefore possible that overflow will occur.
> 
> 
> Regarding the FD_SETSIZE, it is also set for me to 1024 although
> the ulimit is set higher.

Well, the FD_SETSIZE is just the maximum size of the fd set that can
be passed-into select() specifically. That doesn't limit the number of
file descriptors your processes can open. The ulimit settings are the
limits on those.

> I'm a bit lost now on what I should do now. What makes me wonder
> is, that nobody else seems to hit this limitation of FD_SET and
> this makes me think something on my Linux machine is not right.

Well, not everyone is using the same setup. For example, using NIO
through Java is likely to get you the poll() call under the hood, so
supporting more than e.g. 1024 file descriptors is not an issue there.
That's just a guess, but I think it's a reasonable guess.

I think tcnative+APR is not widely deployed. I have no numbers to back
that up, but we don't get a huge volume of questions in the list about i
t.

> What would you guys suggest? Should I file a bug report? My system
> runs stable now after the change to poll() and I don't hit that
> problem anymore.

You should absolutely file the bug report and attach your patch to it.
Thanks for your great analysis and a proposed patch.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJXjONYAAoJEBzwKT+lPKRYW/4QAJs/o5JFxPHhv5+mNLquUxCS
VwaDoqQX2t8jXkkpAauRYxpotTBKl3XYOnXzB8XDtuGhdKzuuIDga6EQiRj0vGMP
/wOcLoXBzXsEt03ORiIv/KJMiH3VGHkl9EXtbkEcuX/qLjsv9hdsALmtmzR/v8sY
1VZqPMJ7PT3Lzs62Jf+WpVH9yp+88SDbT8LlS1PijvOe9t/2jzTThmH/Tfm5cYjh
Fay4Klbvye98hzB60sF9ReesDd6O0nxjksPnSgae3DHXF4nbMpgwtn3VQKALzbMG
wFPRGUFJWPmEpvsyM3kdVINuXxakk7bh3xDXhiMJ4etjQZbT0blMA7ZM0hoMAK3d
PH0KC9Y10IwUqv/98BjBx+4Y6zT59m9fEMeX54upDplMP/muR9SCezWWMfgG+CeG
2xJKZjjHAB0WEdpARPgbraYvxm5oyXiBdYlYuK7Wum+jt6bpd1cIQwrlKSKsexIg
YhLaU2zR5pcu2OBxuK7E9C3isQ35ESfd7ErS/v366rwBdsbKHilV7afWJilpjtnI
w4ui+58fpPSt5+L+X5udk13nbTEYfXcIaejvXRTL33+wiqIfr87r+B4PdTfzb3Gh
7apf0rdMLBb57/KqJfMy75L95vtbyzMhIase/cB7WjGu5CO0CGL05xypTq6oh6hY
a1VE+7031PBgjOhnC3qR
=jplT
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to