From: Alexander Turenko <alexander.turenko@tarantool.org> To: Konstantin Osipov <kostja.osipov@gmail.com>, Kirill Yukhin <kyukhin@tarantool.org> Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>, tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH] libev: unlimited select flag did not work on mac Date: Mon, 20 Apr 2020 09:30:50 +0300 [thread overview] Message-ID: <20200420063050.twyrcveukpfwt7cu@tkn_work_nb> (raw) In-Reply-To: <20200217074052.GA15384@atlas> On Mon, Feb 17, 2020 at 10:40:52AM +0300, Konstantin Osipov wrote: > * Alexander Turenko <alexander.turenko@tarantool.org> [20/02/15 23:22]: > > > Is it fixed in the upstream? Why is noone complaining in the > > > upstream? Is there a bug in the upstream? > > > > Let me read changelog for you: > > Well, I guess the commit comment should say that this is only an > update from the upstream. > > Let me read third_party/README for you! > > How to update libev > =================== > > Remove Tarantool patches (see csv diff -U8). > cvs up > Add patches back. > > Did the patch follow the procedure? If it did, it should clearly > state that it updated libev, and to which version. This have sense. But I would include the backport of the fix in the upcoming release. Pushed to Totktonada/gh-3867-fix-select-on-mac-os-full-ci and shown below. CCed Kirill. commit aba11b2742393abc660726cefc0ca63f6920e700 Author: Alexander Turenko <alexander.turenko@tarantool.org> Date: Mon Apr 20 02:50:27 2020 +0300 libev: backport select()'s limit workaround As stated in the 'OS/X AND DARWIN BUGS' section of the libev documentation [1], kqueue() and poll() have known problems on Mac OS, so the library uses select() on Mac OS (it is the build time default). The library however uses the trick to overcome 1024 fds limit: libev sets the undocumented macro _DARWIN_UNLIMITED_SELECT, which enables linking against select() implementation without the limit. The magic macro stops working at some point around Mac OS 10.10 (see [2]), because it was defined after <sys/time.h> inclusion. For recent Mac OS versions the macro has effect only when it is defined before <sys/time.h> inclusion. The macro definition was [moved][3] in libev 4.25. Excerpt from the changelog [4]: | 4.25 Fri Dec 21 07:49:20 CET 2018 | <...> | - move the darwin select workaround higher in ev.c, as newer versions of | darwin managed to break their broken select even more. More proper fix would be updating of libev to a newer version, however I would postpone it until a moment when we'll have a time to properly test everything with a new version of the library. [1]: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#OS_X_AND_DARWIN_BUGS [2]: http://lists.schmorp.de/pipermail/libev/2018q2/002788.html [3]: http://cvs.schmorp.de/libev/ev.c?r1=1.482&r2=1.483 [4]: http://cvs.schmorp.de/libev/Changes?view=markup Fixes #3867 Fixes #4673 Investigated-by: Maria Khaydich <maria.khaydich@tarantool.org> Co-authored-by: Maria Khaydich <maria.khaydich@tarantool.org> diff --git a/third_party/libev/ev.c b/third_party/libev/ev.c index 6a2648591..8f0045901 100644 --- a/third_party/libev/ev.c +++ b/third_party/libev/ev.c @@ -164,6 +164,16 @@ #endif +/* OS X, in its infinite idiocy, actually HARDCODES + * a limit of 1024 into their select. Where people have brains, + * OS X engineers apparently have a vacuum. Or maybe they were + * ordered to have a vacuum, or they do anything for money. + * This might help. Or not. + * Note that this must be defined early, as other include files + * will rely on this define as well. + */ +#define _DARWIN_UNLIMITED_SELECT 1 + #include <stdlib.h> #include <string.h> #include <fcntl.h> @@ -211,14 +221,6 @@ # undef EV_AVOID_STDIO #endif -/* OS X, in its infinite idiocy, actually HARDCODES - * a limit of 1024 into their select. Where people have brains, - * OS X engineers apparently have a vacuum. Or maybe they were - * ordered to have a vacuum, or they do anything for money. - * This might help. Or not. - */ -#define _DARWIN_UNLIMITED_SELECT 1 - /* this block tries to deduce configuration from header-defined symbols and defaults */ /* try to deduce the maximum number of signals on this platform */
next prev parent reply other threads:[~2020-04-20 6:31 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-02-10 18:45 Maria Khaydich 2020-02-13 0:14 ` Vladislav Shpilevoy 2020-02-15 17:50 ` Konstantin Osipov 2020-02-15 20:19 ` Alexander Turenko 2020-02-17 7:40 ` Konstantin Osipov 2020-02-17 10:00 ` Alexander Turenko 2020-03-03 14:58 ` [Tarantool-patches] [PATCH] libev: update to version 4.32 Maria Khaydich 2020-04-20 6:30 ` Alexander Turenko [this message] 2020-04-20 7:59 ` [Tarantool-patches] [PATCH] libev: unlimited select flag did not work on mac Kirill Yukhin 2020-04-21 17:01 ` Alexander Turenko
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200420063050.twyrcveukpfwt7cu@tkn_work_nb \ --to=alexander.turenko@tarantool.org \ --cc=kostja.osipov@gmail.com \ --cc=kyukhin@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH] libev: unlimited select flag did not work on mac' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox