diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-07-11 10:29:19 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-07-11 10:29:19 +0100 |
commit | f9a53aec073578673710687755db617717dd87d3 (patch) | |
tree | 9e9642aae0c5bc25cac799d6a2437229bbb76a76 /dev-libs/libevent | |
parent | 7e110ec617b903791c3d309845e11a8b27f441cc (diff) |
gentoo auto-resync : 11:07:2023 - 10:29:18
Diffstat (limited to 'dev-libs/libevent')
-rw-r--r-- | dev-libs/libevent/Manifest | 3 | ||||
-rw-r--r-- | dev-libs/libevent/files/libevent-2.2.1-disable-signalfd.patch | 152 | ||||
-rw-r--r-- | dev-libs/libevent/libevent-2.2.1-r2.ebuild (renamed from dev-libs/libevent/libevent-2.2.1-r1.ebuild) | 8 |
3 files changed, 161 insertions, 2 deletions
diff --git a/dev-libs/libevent/Manifest b/dev-libs/libevent/Manifest index 16bc7bccd513..e29df131a5dd 100644 --- a/dev-libs/libevent/Manifest +++ b/dev-libs/libevent/Manifest @@ -1,10 +1,11 @@ AUX libevent-2.1.12-clang16.patch 3562 BLAKE2B d2cf6b7d9499330f0ea5abddd935b2370da2f82e8941a82b81ed9821297d77f1ac39195b12f7966edd06f909491e6ab519fc28c11d97fe6014a646e6431eb038 SHA512 e6d2dbd3e0db9afc4d60a23c7302d56be74aed355d975b6a401fec1c33d7252f67854354249683a0722cccb0176f554e641d2366e9ac00c47edf7d381fbe3de3 AUX libevent-2.1.12-libressl.patch 1237 BLAKE2B 796e4138fa97ff99c6431ee0de84f8ff23469d2b761f83190679b1c7bf19a3354087948707fbcf1b5e6172e65c91b0848acf701e907ab7b08f6a3e712208ce15 SHA512 491311429b0ec63b90c27228271830d55590090623cac4b4400bec4b46bed3f0e7542ef671f467afc1732e3b76eec448179734c2c642d13cbccf8508fae1bf20 +AUX libevent-2.2.1-disable-signalfd.patch 4755 BLAKE2B b4154198a4a0687a89a2ba35361a1e7ecd2095dc9074fe21b0905abf025a1e79d45ac0085ee0a42c3d7121d9e5addd7d0e9e1ef244d96f166db5c1816d0514fe SHA512 bc5389c4d735d19ed19019c41e436f1474fd486b11494cc3724cf4fdb38419b9e6a7f651817ce9aff95c8aff51040c90e237213eff61cbb3c1e8f1f14407aa03 DIST libevent-2.1.12-stable.tar.gz 1100847 BLAKE2B bc1ace15f639ecef2e6b3f95976b8830c1d86f1d06606dd949e2978611fdf9859ed4eb9292d13e6e90e3835063edb94aae64a15c518d5dabe680f37d5a7f5290 SHA512 88d8944cd75cbe78bc4e56a6741ca67c017a3686d5349100f1c74f8a68ac0b6410ce64dff160be4a4ba0696ee29540dfed59aaf3c9a02f0c164b00307fcfe84f DIST libevent-2.1.12-stable.tar.gz.asc 488 BLAKE2B 629109913fe57110d0d78f5a7f18f36a7556b6b438ca65d9ce7c8f1d46e04cb9af4df8d7504d31165b510869154ea3a546e55a83bd7b1247bcfdf7c7d9509312 SHA512 841b57a0f6ba645b1871f257b9929093b11b7d6fd03332e6339adceddda233e78f6190faa2339e2b67b26dc2a56ddd7ce622792820b582168b31a2d1d1854f1f DIST libevent-2.2.1-alpha-dev.tar.gz 1166550 BLAKE2B 4ab460a521aab90852ade14c937c06a21f8e5649a1a1dc4114f978a99272deb77b4e05923861e979f4ee5f50e04149d7b8f8e38294279757f27779597f407d79 SHA512 3e0ef283979a30cce11065c3b9a1078f3f006dbab86e8b49f75dc3aac2384085cb74477d95e5bc4e88c0d81ee2359fcd1cf292107d4791de87191019f2fcdfa5 DIST libevent-2.2.1-alpha-dev.tar.gz.asc 488 BLAKE2B d3e2b2782edd3bcabe42183b5b6647b6e55cd52292813901015a96c6eeec40e1ce57e9be731b2bd027c787f22b8ac5a587b7bed1dff95993bedde8b88fc1e89c SHA512 af720bce0829e806fb8bbb043eaf973fa6765ee17f059367b72344ce111a68f878b7a2fe361e4a3db61c7b4724c7dff19f960636b98e4208e7e27a2a077b8848 EBUILD libevent-2.1.12-r1.ebuild 2015 BLAKE2B a8fe8d23b918969de69f419c3f4ed6d444b26e5f195e628a32e00e5d097068dbd6c03ad6fdb42278ff93cee45df5b1825fe5aaa1cba0fa5d75656d7dff58f1f2 SHA512 9ce251a11c6c598a3f9bf9f03d818bd54a25c367b1bf3f012b7ad846f48d709c0f35a74eeaa6bcadf3f2bbd6b98aed6ec881bd259d27ded97db3580b0727c04a -EBUILD libevent-2.2.1-r1.ebuild 1761 BLAKE2B a65f600e2f01af7ce54127e9587f836fc8cac15726922e509e4e91f92ec7f771ae378aa91148fecedb92e265eba402fd5047fbb817f72b1841c6ffe1e8da6030 SHA512 aef8ffa4cadd6c0002f4fa2f5fa9b0a95f8351de9f4f44983b5f97d4261526ad1b567106347d92e8cd914a581cf7c220bbfcb3d1547d9691c0896f2854a398e5 +EBUILD libevent-2.2.1-r2.ebuild 1925 BLAKE2B 446fd9abfcf1497af8909e373bd3aef4c00903338c8c0c01811fb87d9c42145a41b290e4ebf21caa0fed5f3fef20a4bbec0328141f8e30a601010309d08670be SHA512 cbc195813136ed7eccacbe6ca58bc63bd3049896f04d0a3c6a6c547ec13ff4f5e6b202332f60f85fdca4f9ea8759b1ce993bd98ec2d0c656a1568fb7c2e094ad EBUILD libevent-9999.ebuild 1394 BLAKE2B f1c6080e3315545c7af5341498f8e8d3df9eeb71fc57e22ec7b6471be61a969a4a65e4b7a47a269cad258adbeb8fbd97fd0c6c5d67ff97bd8f4ee68c2c6cc840 SHA512 685ce4c93fefb5d08c005e4f3002749d2a6a71a3e8ad8806da16b870f609a1e0d75dcb8de9bbbeffcc393532a83713fbc21138be0a2d504c1004dc2e539ab304 MISC metadata.xml 935 BLAKE2B 45e1677dd467a0b9f0de89bf9966cec3368da090bc330c7b31aa8528d19440e3523ef3afb67d27102cbf4b40ad8343dc03d040f5961629e2a43d55fe46d7e5a6 SHA512 a7a5ac5c59e2a767bbb511c4eefb53535d894a936d5cd0e9206c176a4f50dfc90387a46a35ece2b48740974f9352793ab56026573678ab74e3e1e5250799bdcf diff --git a/dev-libs/libevent/files/libevent-2.2.1-disable-signalfd.patch b/dev-libs/libevent/files/libevent-2.2.1-disable-signalfd.patch new file mode 100644 index 000000000000..6dfce3db3497 --- /dev/null +++ b/dev-libs/libevent/files/libevent-2.2.1-disable-signalfd.patch @@ -0,0 +1,152 @@ +From 594ab34f1dfc73db85e8f95ec51892cadecaa76c Mon Sep 17 00:00:00 2001 +From: Azat Khuzhin <azat@libevent.org> +Date: Mon, 10 Jul 2023 10:40:49 +0200 +Subject: [PATCH] Disable signalfd by default + +signalfd may behave differently to sigaction/signal, so to avoid +breaking libevent users (like [1], [2]) disable it by default. + + [1]: https://github.com/tmux/tmux/pull/3621 + [2]: https://github.com/tmux/tmux/pull/3626 + +Also signalfd is not that perfect: +- you need to SIG_BLOCK the signal before + - blocked signals are not reset on exec + - blocked signals are allowed to coalesce - so in case of multiple + signals sent you may get the signal only once (ok for most of the + signals, but may be a problem for SIGCHLD, though you may call + waitpid() in a loop or use pidfd) +- and also one implementation problem - + sigprocmask is unspecified in a multithreaded process + +Refs: +- https://lwn.net/Articles/415684/ +- https://ldpreload.com/blog/signalfd-is-useless + +Refs: https://github.com/libevent/libevent/issues/1460 +Refs: #1342 (cc @dmantipov) +--- + CMakeLists.txt | 1 + + include/event2/event.h | 6 ++++-- + signalfd.c | 4 ++-- + test/include.am | 2 ++ + test/test.sh | 11 +++++++++-- + 5 files changed, 18 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cd41d16e57..9c402ec0c1 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1509,6 +1509,7 @@ if (NOT EVENT__DISABLE_TESTS) + else() + add_backend_test(${BACKEND} "${BACKEND_ENV_VARS}") + endif() ++ add_backend_test(signalfd_${BACKEND} "${BACKEND_ENV_VARS};EVENT_USE_SIGNALFD=1") + endforeach() + + # +diff --git a/include/event2/event.h b/include/event2/event.h +index 384a84178b..9b971edf1d 100644 +--- a/include/event2/event.h ++++ b/include/event2/event.h +@@ -599,9 +599,11 @@ enum event_base_config_flag { + */ + EVENT_BASE_FLAG_EPOLL_DISALLOW_TIMERFD = 0x40, + +- /** Do not use signalfd(2) to handle signals even if supported. ++ /** Use signalfd(2) to handle signals over sigaction/signal. ++ * ++ * But note, that in some edge cases signalfd() may works differently. + */ +- EVENT_BASE_FLAG_DISALLOW_SIGNALFD = 0x80, ++ EVENT_BASE_FLAG_USE_SIGNALFD = 0x80, + }; + + /** +diff --git a/signalfd.c b/signalfd.c +index 376a04d539..ed31014e5f 100644 +--- a/signalfd.c ++++ b/signalfd.c +@@ -205,8 +205,8 @@ sigfd_del(struct event_base *base, int signo, short old, short events, void *p) + int sigfd_init_(struct event_base *base) + { + EVUTIL_ASSERT(base != NULL); +- if ((base->flags & EVENT_BASE_FLAG_DISALLOW_SIGNALFD) || +- getenv("EVENT_DISALLOW_SIGNALFD")) ++ if (!(base->flags & EVENT_BASE_FLAG_USE_SIGNALFD) && ++ !getenv("EVENT_USE_SIGNALFD")) + return -1; + base->evsigsel = &sigfdops; + return 0; +diff --git a/test/include.am b/test/include.am +index e061c937b7..9b50759da7 100644 +--- a/test/include.am ++++ b/test/include.am +@@ -80,6 +80,8 @@ test_runner_changelist: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b "" -c + test_runner_timerfd_changelist: $(top_srcdir)/test/test.sh + $(top_srcdir)/test/test.sh -b "" -T ++test_runner_timerfd_changelist: $(top_srcdir)/test/test.sh ++ $(top_srcdir)/test/test.sh -b "" -S + + DISTCLEANFILES += test/regress.gen.c test/regress.gen.h + +diff --git a/test/test.sh b/test/test.sh +index dfdd2bf098..79362888c5 100755 +--- a/test/test.sh ++++ b/test/test.sh +@@ -50,6 +50,7 @@ setup () { + done + unset EVENT_EPOLL_USE_CHANGELIST + unset EVENT_PRECISE_TIMER ++ unset EVENT_USE_SIGNALFD + } + + announce () { +@@ -138,10 +139,12 @@ do_test() { + EVENT_EPOLL_USE_CHANGELIST=yes; export EVENT_EPOLL_USE_CHANGELIST + elif test "$2" = "(timerfd)" ; then + EVENT_PRECISE_TIMER=1; export EVENT_PRECISE_TIMER ++ elif test "$2" = "(signalfd)" ; then ++ EVENT_USE_SIGNALFD=1; export EVENT_USE_SIGNALFD + elif test "$2" = "(timerfd+changelist)" ; then + EVENT_EPOLL_USE_CHANGELIST=yes; export EVENT_EPOLL_USE_CHANGELIST + EVENT_PRECISE_TIMER=1; export EVENT_PRECISE_TIMER +- fi ++ fi + + run_tests + } +@@ -153,6 +156,7 @@ usage() + -t - run timerfd test + -c - run changelist test + -T - run timerfd+changelist test ++ -S - run signalfd test + EOL + } + main() +@@ -161,13 +165,15 @@ main() + timerfd=0 + changelist=0 + timerfd_changelist=0 ++ signalfd=0 + +- while getopts "b:tcT" c; do ++ while getopts "b:tcTS" c; do + case "$c" in + b) backends="$OPTARG";; + t) timerfd=1;; + c) changelist=1;; + T) timerfd_changelist=1;; ++ S) signalfd=1;; + ?*) usage && exit 1;; + esac + done +@@ -179,6 +185,7 @@ main() + [ $timerfd_changelist -eq 0 ] || do_test EPOLL "(timerfd+changelist)" + for i in $backends; do + do_test $i ++ [ $signalfd -eq 0 ] || do_test $i "(signalfd)" + done + + if test "$FAILED" = "yes"; then diff --git a/dev-libs/libevent/libevent-2.2.1-r1.ebuild b/dev-libs/libevent/libevent-2.2.1-r2.ebuild index 63ff06976ccb..ea1d05922dfd 100644 --- a/dev-libs/libevent/libevent-2.2.1-r1.ebuild +++ b/dev-libs/libevent/libevent-2.2.1-r2.ebuild @@ -21,7 +21,7 @@ SRC_URI=" S=${WORKDIR}/${MY_P} LICENSE="BSD" -SLOT="0/2.2" +SLOT="0/2.2.1-r2" KEYWORDS="" IUSE=" +clock-gettime debug malloc-replacement mbedtls +ssl static-libs @@ -49,6 +49,12 @@ MULTILIB_WRAPPED_HEADERS=( ) VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/libevent.asc +PATCHES=( + # signalfd-by-default breaks at least app-misc/tmux + # https://github.com/libevent/libevent/pull/1486 + "${FILESDIR}/${P}-disable-signalfd.patch" +) + multilib_src_configure() { # fix out-of-source builds mkdir -p test || die |