Ticket #42471

Don't try to write log messages to the TCP listener file descriptor

Eröffnet am: 2021-06-05 07:43 Letztes Update: 2022-02-19 18:55

Auswertung:
(del#120837)
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Gefixt
Datei:
1

Details

When starting a new game from the main menu the client spawns an instance of freeciv-server. When no --log argument was specified for the client the logfile variable is NULL and client_start_server ends up closing stdout and stderr without opening any file to replace them. The next file descriptor that is allocated happens to belong to the TCP listener. lsof for the server process:

freeciv-s 824527 gunnar 0r CHR 1,3 0t0 4 /dev/null

freeciv-s 824527 gunnar 1u IPv6 1362042 0t0 TCP [::1]:farenet (LISTEN)

freeciv-s 824527 gunnar 2u IPv4 1362043 0t0 TCP 127.0.0.1:farenet (LISTEN)

freeciv-s 824527 gunnar 3u IPv6 1341307 0t0 TCP [::1]:farenet->[::1]:54822 (ESTABLISHED)

This results in further log messages to be written to the TCP listener file descriptor.

Ticket-Verlauf (3/10 Historien)

2021-06-05 07:43 Aktualisiert von: (del#120837)
  • New Ticket "Don't try to write log messages to the TCP listener file descriptor" created
2021-06-05 07:45 Aktualisiert von: (del#120837)
  • Details Updated
2021-06-05 07:47 Aktualisiert von: (del#120837)
  • Typ Update from Fehler to Patches
2021-06-16 13:56 Aktualisiert von: cazfi
Kommentar

Isn't the FIXME comment about port related to command line parameters and not the logfile? Moving it inside the "if (logfile)" block makes no sense then.

2022-02-07 16:27 Aktualisiert von: cazfi
  • Meilenstein Update from (Keine) to 3.0.1 (closed)
  • Komponente Update from (Keine) to Client common
2022-02-13 22:51 Aktualisiert von: cazfi
  • Verantwortlicher Update from (Keine) to cazfi
  • Lösung Update from Keine to Accepted
Kommentar

Reply To cazfi

Isn't the FIXME comment about port related to command line parameters and not the logfile? Moving it inside the "if (logfile)" block makes no sense then.

Looking closer, it does make sense. No need to change the patch.

2022-02-19 16:38 Aktualisiert von: cazfi
  • Status Update from Offen to Geschlossen
  • Lösung Update from Accepted to Gefixt
2022-02-19 16:58 Aktualisiert von: cazfi
Kommentar

Occurred to me a bit late, but opening "/dev/null" might not work too well on Windows. Checking situation...

2022-02-19 18:55 Aktualisiert von: cazfi
Kommentar

Reply To cazfi

Occurred to me a bit late, but opening "/dev/null" might not work too well on Windows. Checking situation...

Ok, that particular code block is not used in Windows, at least as long as msys2 or cygwin implements fork() that is good enough for freeciv's configure check.

Bearbeiten

Please login to add comment to this ticket » Anmelden