Incidencia #42471

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

Abrir Fecha: 2021-06-05 07:43 Última actualización: 2022-02-19 18:55

Informador:
(del#120837)
Propietario:
Tipo:
Estado:
Cerrado
Componente:
Prioridad:
5 - Medium
Gravedad:
5 - Medium
Resolución:
Fixed
Fichero:
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 History (3/10 Histories)

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

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 Updated by: cazfi
  • Hito Update from (Ninguno) to 3.0.1 (cerrado)
  • Componente Update from (Ninguno) to Client common
2022-02-13 22:51 Updated by: cazfi
  • Propietario Update from (Ninguno) to cazfi
  • Resolución Update from Ninguno to Accepted
Comentario

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 Updated by: cazfi
  • Estado Update from Open to Cerrado
  • Resolución Update from Accepted to Fixed
2022-02-19 16:58 Updated by: cazfi
Comentario

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

2022-02-19 18:55 Updated by: cazfi
Comentario

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.

Editar

Please login to add comment to this ticket » Entrar