任务单 #42471

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

开放日期: 2021-06-05 07:43 最后更新: 2022-02-19 18:55

报告人:
(del#120837)
属主:
类型:
状态:
关闭
组件:
里程碑:
优先:
5 - Medium
严重性:
5 - Medium
处理结果:
Fixed
文件:
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.

任务单历史 (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)
  • 类型 Update from Bugs to Patches
2021-06-16 13:56 Updated by: 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.

2022-02-07 16:27 Updated by: cazfi
  • 里程碑 Update from (无) to 3.0.1 (关闭)
  • 组件 Update from (无) to Client common
2022-02-13 22:51 Updated by: cazfi
  • 属主 Update from (无) to cazfi
  • 处理结果 Update from to Accepted
评论

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
  • 状态 Update from 开启 to 关闭
  • 处理结果 Update from Accepted to Fixed
2022-02-19 16:58 Updated by: cazfi
评论

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
评论

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.

编辑

Please login to add comment to this ticket » 登录名