From 0ccdef528013e2344b9e8ebdab2b4861335a0b4d Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: May 06 2022 14:29:46 +0000 Subject: 0.187-4 - Add elfutils-0.187-mhd_no_dual_stack.patch - Add elfutils-0.187-mhd_epoll.patch --- diff --git a/elfutils-0.187-mhd_epoll.patch b/elfutils-0.187-mhd_epoll.patch new file mode 100644 index 0000000..fbbbdac --- /dev/null +++ b/elfutils-0.187-mhd_epoll.patch @@ -0,0 +1,51 @@ +commit 28f9d86ea89f88b24f1d12c8e9d5ddc3f77da194 +Author: Mark Wielaard +Date: Fri May 6 00:29:28 2022 +0200 + + debuginfod: Use MHD_USE_EPOLL for libmicrohttpd version 0.9.51 or higher + + Also disable MHD_USE_THREAD_PER_CONNECTION when using MHD_USE_EPOLL. + + https://sourceware.org/bugzilla/show_bug.cgi?id=29123 + + Signed-off-by: Mark Wielaard + +diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx +index c02540f1..d4f47bf7 100644 +--- a/debuginfod/debuginfod.cxx ++++ b/debuginfod/debuginfod.cxx +@@ -1,6 +1,6 @@ + /* Debuginfo-over-http server. + Copyright (C) 2019-2021 Red Hat, Inc. +- Copyright (C) 2021 Mark J. Wielaard ++ Copyright (C) 2021, 2022 Mark J. Wielaard + This file is part of elfutils. + + This file is free software; you can redistribute it and/or modify +@@ -3899,7 +3899,14 @@ main (int argc, char *argv[]) + } + } + +- unsigned int mhd_flags = ((connection_pool ++ /* Note that MHD_USE_EPOLL and MHD_USE_THREAD_PER_CONNECTION don't ++ work together. */ ++ unsigned int use_epoll = 0; ++#if MHD_VERSION >= 0x00095100 ++ use_epoll = MHD_USE_EPOLL; ++#endif ++ ++ unsigned int mhd_flags = ((connection_pool || use_epoll + ? 0 : MHD_USE_THREAD_PER_CONNECTION) + #if MHD_VERSION >= 0x00095300 + | MHD_USE_INTERNAL_POLLING_THREAD +@@ -3907,9 +3914,7 @@ main (int argc, char *argv[]) + | MHD_USE_SELECT_INTERNALLY + #endif + | MHD_USE_DUAL_STACK +-#ifdef MHD_USE_EPOLL +- | MHD_USE_EPOLL +-#endif ++ | use_epoll + #if MHD_VERSION >= 0x00095200 + | MHD_USE_ITC + #endif diff --git a/elfutils-0.187-mhd_no_dual_stack.patch b/elfutils-0.187-mhd_no_dual_stack.patch new file mode 100644 index 0000000..3f38e36 --- /dev/null +++ b/elfutils-0.187-mhd_no_dual_stack.patch @@ -0,0 +1,118 @@ +commit ba675ed25a26fd425ffd19b02cf18babf4291b4f +Author: Mark Wielaard +Date: Thu May 5 23:59:57 2022 +0200 + + debuginfod: Try without MHD_USE_DUAL_STACK if MHD_start_daemon fails + + On a systems that have ipv6 disabled debuginfod doesn't start up + anymore because libhttpd MHD_USE_DUAL_STACK only works if it can + open an ipv6 socket. If MHD_start_daemon with MHD_USE_DUAL_STACK + fails try again without that flag set. + + https://sourceware.org/bugzilla/show_bug.cgi?id=29122 + + Signed-off-by: Mark Wielaard + +diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx +index 4aaf41c0..c02540f1 100644 +--- a/debuginfod/debuginfod.cxx ++++ b/debuginfod/debuginfod.cxx +@@ -3899,40 +3899,67 @@ main (int argc, char *argv[]) + } + } + +- // Start httpd server threads. Use a single dual-homed pool. +- MHD_Daemon *d46 = MHD_start_daemon ((connection_pool ? 0 : MHD_USE_THREAD_PER_CONNECTION) ++ unsigned int mhd_flags = ((connection_pool ++ ? 0 : MHD_USE_THREAD_PER_CONNECTION) + #if MHD_VERSION >= 0x00095300 +- | MHD_USE_INTERNAL_POLLING_THREAD ++ | MHD_USE_INTERNAL_POLLING_THREAD + #else +- | MHD_USE_SELECT_INTERNALLY ++ | MHD_USE_SELECT_INTERNALLY + #endif ++ | MHD_USE_DUAL_STACK + #ifdef MHD_USE_EPOLL +- | MHD_USE_EPOLL ++ | MHD_USE_EPOLL + #endif +- | MHD_USE_DUAL_STACK + #if MHD_VERSION >= 0x00095200 +- | MHD_USE_ITC ++ | MHD_USE_ITC + #endif +- | MHD_USE_DEBUG, /* report errors to stderr */ +- http_port, +- NULL, NULL, /* default accept policy */ +- handler_cb, NULL, /* handler callback */ +- MHD_OPTION_EXTERNAL_LOGGER, error_cb, NULL, +- (connection_pool ? MHD_OPTION_THREAD_POOL_SIZE : MHD_OPTION_END), +- (connection_pool ? (int)connection_pool : MHD_OPTION_END), +- MHD_OPTION_END); ++ | MHD_USE_DEBUG); /* report errors to stderr */ + ++ // Start httpd server threads. Use a single dual-homed pool. ++ MHD_Daemon *d46 = MHD_start_daemon (mhd_flags, http_port, ++ NULL, NULL, /* default accept policy */ ++ handler_cb, NULL, /* handler callback */ ++ MHD_OPTION_EXTERNAL_LOGGER, ++ error_cb, NULL, ++ (connection_pool ++ ? MHD_OPTION_THREAD_POOL_SIZE ++ : MHD_OPTION_END), ++ (connection_pool ++ ? (int)connection_pool ++ : MHD_OPTION_END), ++ MHD_OPTION_END); ++ ++ MHD_Daemon *d4 = NULL; + if (d46 == NULL) + { +- sqlite3 *database = db; +- sqlite3 *databaseq = dbq; +- db = dbq = 0; // for signal_handler not to freak +- sqlite3_close (databaseq); +- sqlite3_close (database); +- error (EXIT_FAILURE, 0, "cannot start http server at port %d", http_port); +- } ++ // Cannot use dual_stack, use ipv4 only ++ mhd_flags &= ~(MHD_USE_DUAL_STACK); ++ d4 = MHD_start_daemon (mhd_flags, http_port, ++ NULL, NULL, /* default accept policy */ ++ handler_cb, NULL, /* handler callback */ ++ MHD_OPTION_EXTERNAL_LOGGER, ++ error_cb, NULL, ++ (connection_pool ++ ? MHD_OPTION_THREAD_POOL_SIZE ++ : MHD_OPTION_END), ++ (connection_pool ++ ? (int)connection_pool ++ : MHD_OPTION_END), ++ MHD_OPTION_END); ++ if (d4 == NULL) ++ { ++ sqlite3 *database = db; ++ sqlite3 *databaseq = dbq; ++ db = dbq = 0; // for signal_handler not to freak ++ sqlite3_close (databaseq); ++ sqlite3_close (database); ++ error (EXIT_FAILURE, 0, "cannot start http server at port %d", ++ http_port); ++ } + +- obatched(clog) << "started http server on IPv4 IPv6 " ++ } ++ obatched(clog) << "started http server on" ++ << (d4 != NULL ? " IPv4 " : " IPv4 IPv6 ") + << "port=" << http_port << endl; + + // add maxigroom sql if -G given +@@ -4053,6 +4080,7 @@ main (int argc, char *argv[]) + + /* Stop all the web service threads. */ + if (d46) MHD_stop_daemon (d46); ++ if (d4) MHD_stop_daemon (d4); + + if (! passive_p) + { diff --git a/elfutils.spec b/elfutils.spec index 46de58b..5c7c82f 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,6 +1,6 @@ Name: elfutils Version: 0.187 -%global baserelease 3 +%global baserelease 4 Release: %{baserelease}%{?dist} URL: http://elfutils.org/ %global source_url ftp://sourceware.org/pub/elfutils/%{version}/ @@ -69,6 +69,10 @@ Patch1: elfutils-0.186-fdo-swap.patch Patch2: elfutils-0.187-csh-profile.patch # https://sourceware.org/bugzilla/show_bug.cgi?id=29117 Patch3: elfutils-0.187-debuginfod-client-fd-leak.patch +# https://sourceware.org/bugzilla/show_bug.cgi?id=29122 +Patch4: elfutils-0.187-mhd_no_dual_stack.patch +# https://sourceware.org/bugzilla/show_bug.cgi?id=29123 +Patch5: elfutils-0.187-mhd_epoll.patch %description Elfutils is a collection of utilities, including stack (to show @@ -409,6 +413,10 @@ exit 0 %systemd_postun_with_restart debuginfod.service %changelog +* Fri May 6 2022 Mark Wielaard - 0.187-4 +- Add elfutils-0.187-mhd_no_dual_stack.patch +- Add elfutils-0.187-mhd_epoll.patch + * Thu May 5 2022 Mark Wielaard - 0.187-3 - Add elfutils-0.187-debuginfod-client-fd-leak.patch