From 02a05f63d5d84e1adedf2352721c418ef3ba8c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 10 Oct 2023 19:23:43 +0200 Subject: [PATCH] core: fix zombie processes remaining after the end of forked processes (closes #1994) The clean of processes with waitpid() is now delayed after the kill(), so that there are no more zombies. In addition, this can be done manually if needed with `/sys waitpid`. --- ChangeLog.adoc | 1 + po/cs.po | 6 +- po/de.po | 178 ++++--------------------------- po/es.po | 6 +- po/fr.po | 12 ++- po/hu.po | 6 +- po/it.po | 6 +- po/ja.po | 6 +- po/pl.po | 6 +- po/pt.po | 6 +- po/pt_BR.po | 6 +- po/ru.po | 6 +- po/sr.po | 14 ++- po/tr.po | 6 +- po/weechat.pot | 6 +- src/core/hook/wee-hook-connect.c | 2 +- src/core/hook/wee-hook-process.c | 3 +- src/core/wee-command.c | 16 ++- src/core/wee-hook.c | 30 ++++++ src/core/wee-hook.h | 1 + src/core/wee-sys.c | 19 ++++ src/core/wee-sys.h | 1 + src/plugins/xfer/xfer-network.c | 3 +- 23 files changed, 156 insertions(+), 190 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index 90d704911..862be39a2 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -51,6 +51,7 @@ New features:: Bug fixes:: + * core: fix zombie processes after fork (hook process or connect) (issue #1994) * core: fix generation of TOTP on Big Endian systems (issue #2021) * core: fix cursor position after `/plugin list -i` or `/plugin list -il` * core: display focus hashtable for debug even if no key is matching diff --git a/po/cs.po b/po/cs.po index e382329f0..6b00ea00c 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-10-01 16:11+0200\n" +"POT-Creation-Date: 2023-10-10 19:22+0200\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -2728,7 +2728,9 @@ msgid "" "\"man getrlimit\")\n" " rusage: display resource usage (see \"man getrusage\")\n" "suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP " -"to the WeeChat process" +"to the WeeChat process\n" +"waitpid: acknowledge the end of children processes (to prevent \"zombie\" " +"processes)" msgstr "" #, fuzzy diff --git a/po/de.po b/po/de.po index 004287f63..77f54bdca 100644 --- a/po/de.po +++ b/po/de.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-10-01 16:11+0200\n" +"POT-Creation-Date: 2023-10-10 19:22+0200\n" "PO-Revision-Date: 2023-10-05 08:04+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -74,12 +74,10 @@ msgstr "" "Die Systemzeit ist nicht korrekt (%+ld Sekunden), reinitialisiere alle Uhren" #, c-format -#| msgid "curl error %d (%s) (URL: \"%s\")\n" msgid "%sURL transfer error: %s (URL: \"%s\")" msgstr "%sURL Transferfehler: %s (URL: \"%s\")" #, c-format -#| msgid "End of command '%s', timeout reached (%.1fs)" msgid "End of URL transfer '%s', timeout reached (%.1fs)" msgstr "Ende der URL-Übertragung „%s“, Zeitüberschreitung erreicht (%.1fs)" @@ -1059,16 +1057,12 @@ msgid "WeeChat session saved (files *.upgrade)" msgstr "WeeChat Sitzung gesichert (Dateien *.upgrade)" #, c-format -#| msgid "" -#| "%sCan't upgrade: there is one or more background process (hook type " -#| "'process' or 'connect')" msgid "" "%sCan't upgrade: there is one or more background process/thread running " "(hook type: process, connect or url)" msgstr "" -"%sAktualisierung nicht möglich: Es laufen ein oder mehrere" -" Hintergrundprozesse/-threads" -"(Hook-Typ: 'process', 'connect' oder 'url')" +"%sAktualisierung nicht möglich: Es laufen ein oder mehrere " +"Hintergrundprozesse/-threads(Hook-Typ: 'process', 'connect' oder 'url')" #, c-format msgid "%sCan't upgrade: WeeChat binary \"%s\" does not exist" @@ -1680,11 +1674,6 @@ msgid "debug functions" msgstr "Debug-Funktionen" #. TRANSLATORS: only text between angle brackets (eg: "") must be translated -#| msgid "" -#| "list || set || dump|hooks [] || buffer|certs|" -#| "color|dirs|infolists|libs|memory|tags|term|windows || callbacks " -#| "[] || mouse|cursor [verbose] || hdata [free] || time " -#| " || unicode " msgid "" "list || set || dump|hooks [] || buffer|certs|color|" "dirs|infolists|libs|memory|tags|term|url|windows || callbacks " @@ -1696,50 +1685,6 @@ msgstr "" "[] || mouse|cursor [verbose] || hdata [free] || time " " || unicode " -#| msgid "" -#| " list: list plugins with debug levels\n" -#| " set: set debug level for plugin\n" -#| " plugin: name of plugin (\"core\" for WeeChat core)\n" -#| " level: debug level for plugin (0 = disable debug)\n" -#| " dump: save memory dump in WeeChat log file (same dump is written " -#| "when WeeChat crashes)\n" -#| " hooks: display infos about hooks (with a plugin: display detailed " -#| "info about hooks created by the plugin)\n" -#| " buffer: dump buffer content with hexadecimal values in WeeChat log " -#| "file\n" -#| "callbacks: write hook and bar item callbacks that took more than " -#| "\"duration\" in the WeeChat log file (0 = disable), where optional unit " -#| "is one of:\n" -#| " us: microseconds (default)\n" -#| " ms: milliseconds\n" -#| " s: seconds\n" -#| " m: minutes\n" -#| " h: hours\n" -#| " certs: display number of loaded trusted certificate authorities\n" -#| " color: display infos about current color pairs\n" -#| " cursor: toggle debug for cursor mode\n" -#| " dirs: display directories\n" -#| " hdata: display infos about hdata (with free: remove all hdata in " -#| "memory)\n" -#| "infolists: display infos about infolists\n" -#| " key: enable keyboard and mouse debug: display raw codes, expanded " -#| "key name and associated command ('q' to quit this mode)\n" -#| " libs: display infos about external libraries used\n" -#| " memory: display infos about memory usage\n" -#| " mouse: toggle debug for mouse\n" -#| " tags: display tags for lines\n" -#| " term: display infos about terminal\n" -#| " windows: display windows tree\n" -#| " time: measure time to execute a command or to send text to the " -#| "current buffer\n" -#| " unicode: display information about string and unicode chars (evaluated, " -#| "see /help eval)\n" -#| "\n" -#| "Examples:\n" -#| " /debug set irc 1\n" -#| " /debug mouse verbose\n" -#| " /debug time /filter toggle\n" -#| " /debug unicode ${chars:${\\u26C0}-${\\u26CF}}" msgid "" " list: list plugins with debug levels\n" " set: set debug level for plugin\n" @@ -1820,8 +1765,8 @@ msgstr "" " mouse: schaltet den debug-Modus für den Maus-Modus ein/aus\n" " tags: zeigt für jede einzelne Zeile die dazugehörigen Schlagwörter an\n" " term: zeigt Informationen über das Terminal an\n" -" url: zeigt Debug-Informationen für hook_url Aufrufe an (Ausgabe als" -" Hashtable)\n" +" url: zeigt Debug-Informationen für hook_url Aufrufe an (Ausgabe als " +"Hashtable)\n" " windows: zeigt die Fensterstruktur an\n" " time: misst die Zeit um einen Befehl auszuführen oder um einen Text in " "den aktuellen Buffer zu senden\n" @@ -3575,13 +3520,23 @@ msgstr "" msgid "system actions" msgstr "Systemaktionen" +#, fuzzy +#| msgid "" +#| " get: display system info\n" +#| " rlimit: display resource limits (see /help weechat.startup.sys_rlimit " +#| "and \"man getrlimit\")\n" +#| " rusage: display resource usage (see \"man getrusage\")\n" +#| "suspend: suspend WeeChat and go back to the shell, by sending signal " +#| "SIGTSTP to the WeeChat process" msgid "" " get: display system info\n" " rlimit: display resource limits (see /help weechat.startup.sys_rlimit and " "\"man getrlimit\")\n" " rusage: display resource usage (see \"man getrusage\")\n" "suspend: suspend WeeChat and go back to the shell, by sending signal SIGTSTP " -"to the WeeChat process" +"to the WeeChat process\n" +"waitpid: acknowledge the end of children processes (to prevent \"zombie\" " +"processes)" msgstr "" " get: Systeminformationen anzeigen\n" " rlimit: Ressourcengrenzen anzeigen (siehe /help weechat.startup.sys_rlimit " @@ -6454,16 +6409,13 @@ msgid "not enough memory" msgstr "nicht genügend Speicher" #, c-format -#| msgid "%sFilter \"%s\" not found" msgid "file \"%s\" not found" msgstr "Datei \"%s\", nicht gefunden" #, c-format -#| msgid "%sCannot create file \"%s\"" msgid "can not write file \"%s\"" msgstr "Datei \"%s\" kann nicht erstellt werden" -#| msgid "fork error" msgid "transfer error" msgstr "Übertragungsfehler" @@ -7006,87 +6958,6 @@ msgstr "" msgid "bar item with list of buffers" msgstr "Bar-Item mit der Liste von Buffern" -#| msgid "" -#| " enable: enable buflist\n" -#| "disable: disable buflist\n" -#| " toggle: toggle buflist\n" -#| " bar: add the \"buflist\" bar\n" -#| "refresh: force the refresh of the bar items (buflist, buflist2 buflist3, " -#| "buflist4 and buflist5)\n" -#| "\n" -#| "The lines with buffers are displayed using string evaluation (see /help " -#| "eval for the format), with these options:\n" -#| " - buflist.look.display_conditions: conditions to display a buffer in " -#| "the list\n" -#| " - buflist.format.buffer: format for a buffer which is not current " -#| "buffer\n" -#| " - buflist.format.buffer_current: format for the current buffer\n" -#| "\n" -#| "The following variables can be used in these options:\n" -#| " - bar item data (see hdata \"bar_item\" in API doc for a complete " -#| "list), for example:\n" -#| " - ${bar_item.name}\n" -#| " - window data, where the bar item is displayed (there's no window in " -#| "root bars, see hdata \"window\" in API doc for a complete list), for " -#| "example:\n" -#| " - ${window.number}\n" -#| " - ${window.buffer.full_name}\n" -#| " - buffer data (see hdata \"buffer\" in API doc for a complete list), " -#| "for example:\n" -#| " - ${buffer.number}\n" -#| " - ${buffer.name}\n" -#| " - ${buffer.full_name}\n" -#| " - ${buffer.short_name}\n" -#| " - ${buffer.nicklist_nicks_count}\n" -#| " - irc_server: IRC server data, defined only on an IRC buffer (see hdata " -#| "\"irc_server\" in API doc)\n" -#| " - irc_channel: IRC channel data, defined only on an IRC channel buffer " -#| "(see hdata \"irc_channel\" in API doc)\n" -#| " - extra variables added by buflist for convenience:\n" -#| " - ${format_buffer}: the evaluated value of option buflist.format." -#| "buffer; this can be used in option buflist.format.buffer_current to just " -#| "change the background color for example\n" -#| " - ${current_buffer}: a boolean (\"0\" or \"1\"), \"1\" if this is the " -#| "current buffer; it can be used in a condition: ${if:" -#| "${current_buffer}?...:...}\n" -#| " - ${merged}: a boolean (\"0\" or \"1\"), \"1\" if the buffer is " -#| "merged with at least another buffer; it can be used in a condition: ${if:" -#| "${merged}?...:...}\n" -#| " - ${format_number}: indented number with separator (evaluation of " -#| "option buflist.format.number)\n" -#| " - ${number}: indented number, for example \" 1\" if there are between " -#| "10 and 99 buffers; for merged buffers, this variable is set with number " -#| "for the first buffer and spaces for the next buffers with same number\n" -#| " - ${number2}: indented number, for example \" 1\" if there are " -#| "between 10 and 99 buffers\n" -#| " - ${number_displayed}: \"1\" if the number is displayed, otherwise " -#| "\"0\"\n" -#| " - ${indent}: indentation for name (channel, private and list buffers " -#| "are indented) (evaluation of option buflist.format.indent)\n" -#| " - ${format_nick_prefix}: colored nick prefix for a channel " -#| "(evaluation of option buflist.format.nick_prefix)\n" -#| " - ${color_nick_prefix}: color of nick prefix for a channel (set only " -#| "if the option buflist.look.nick_prefix is enabled)\n" -#| " - ${nick_prefix}: nick prefix for a channel (set only if the option " -#| "buflist.look.nick_prefix is enabled)\n" -#| " - ${format_name}: formatted name (evaluation of option buflist.format." -#| "name)\n" -#| " - ${name}: the short name (if set), with a fallback on the name\n" -#| " - ${color_hotlist}: the color depending on the highest hotlist level " -#| "for the buffer (evaluation of option buflist.format.hotlist_xxx where xxx " -#| "is the level)\n" -#| " - ${format_hotlist}: the formatted hotlist (evaluation of option " -#| "buflist.format.hotlist)\n" -#| " - ${hotlist}: the raw hotlist\n" -#| " - ${hotlist_priority}: \"none\", \"low\", \"message\", \"private\" or " -#| "\"highlight\"\n" -#| " - ${hotlist_priority_number}: -1 = none, 0 = low, 1 = message, 2 = " -#| "private, 3 = highlight\n" -#| " - ${format_lag}: the lag for an IRC server buffer, empty if there's " -#| "no lag (evaluation of option buflist.format.lag)\n" -#| " - ${format_tls_version}: indicator of TLS version for a server " -#| "buffer, empty for channels (evaluation of option buflist.format." -#| "tls_version)" msgid "" " enable: enable buflist\n" "disable: disable buflist\n" @@ -7170,9 +7041,9 @@ msgstr "" "disable: buflist deaktivieren\n" " toggle: buflist umschalten\n" " bar: fügt eine \"buflist\" Bar hinzu\n" -"refresh: erzwingt die Aktualisierung einiger Bar-Items (wenn kein Element" -" angegeben ist, werden alle Bar-Items aktualisiert, entsprechend der Option" -" buflist.look.use_items)\n" +"refresh: erzwingt die Aktualisierung einiger Bar-Items (wenn kein Element " +"angegeben ist, werden alle Bar-Items aktualisiert, entsprechend der Option " +"buflist.look.use_items)\n" "\n" "Jede Zeile die einen Buffer anzeigt, wird mittels Zeichenketten-Evaluation " "dargestellt (siehe /help eval für das Format), dazu werden folgende Optionen " @@ -7251,7 +7122,6 @@ msgstr "" " - ${format_tls_version}: Indikator der TLS Version für den Serverbuffer, " "Channels bleiben unberührt (evaluiert aus Option buflist.format.tls_version)" -#| msgid "list of bar items" msgid "buflist bar items" msgstr "Buflist Bar-Items" @@ -13836,8 +13706,8 @@ msgstr "" msgid "" "%s%s: zstd compression is not available, logger files will not be compressed" msgstr "" -"%s%s: zstd Komprimierung ist nicht verfügbar, Logger-Dateien werden nicht" -" komprimiert" +"%s%s: zstd Komprimierung ist nicht verfügbar, Logger-Dateien werden nicht " +"komprimiert" msgid "" "logging level for this buffer (0 = logging disabled, 1 = a few messages " @@ -16820,8 +16690,7 @@ msgstr "verwaltet Trigger, das Schweizer Armeemesser für WeeChat" msgid "" "list [-o|-ol|-i|-il] || listfull || listdefault || add|addoff|addreplace " " " -"[\"\" [\"\" [\"\" [\"\" [\"<" -"return_code>\" [\"\"]]]]]] " +"[\"\" [\"\" [\"\" [\"\" [\"\" [\"\"]]]]]] " "|| addinput [] || input|output|recreate || set