Vanilla Netrek Server Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[VANILLA-L:820] Metaserver Solicitation Daemon Crash



Problem

	Daemon crashes with core dump when player "d" or "e" joins.
	Core dump on DIGITAL UNIX not usable; stack corruption.

Cause

	Size of metaserver solicitation message exceeds buffer length,
	Manual estimate for maximum message size was in error,
	"\n" results in two bytes, not one, when used in sprintf(),
	No code to check for limit.

Workaround

	Remove .metaservers file from LIBDIR and restart daemon.

Solution

	Double the buffer size on servers and metaserver,
	Apply attached metaserver.scan.c.patch to metaserver,
	(Can I have confirmation from metaserver guys when it's done?)
	Apply attached server.solicit.c.patch to server.
	
Discussion

	This problem had been plaguing the Australian server at
netrek.syd.att.net.au for some months.  It was initially thought to be a
compiler or operating system problem.  It appears nobody else is using
the metaserver solicitation mode of the server, or that the fault was
not diagnosed before.

	The metaserver packet size limit was 1024 characters, but the number of
characters required depends on the number of players.  Assuming a
maximum size for player names, login names, and host names, the
following table shows the packet size for the number of players.

   player count    header size      item size    packet size
              1             69             65            134
              2             69            130            199
              3             69            195            264
              4             69            260            329
              5             69            325            394
              6             69            390            459
              7             69            455            524
              8             69            520            589
              9             69            585            654
             10             69            650            719
             11             69            715            784
             12             69            780            849
             13             69            845            914
             14             69            910            979
             15             69            975           1044
             16             69           1040           1109

-- 
James Cameron                                    (cameron@stl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800
*** scan.c.orig	Thu Mar 26 13:54:06 EST 1998
--- scan.c	Thu Mar 26 13:55:26 EST 1998
***************
*** 881,887 ****
  
  /* Maximum size of a UDP packet accepted */
  /* ??? need to have this documented and agreed */
! #define MAXMETABYTES 1024
  
  /* Port on metaserver for incoming UDP */
  #define USOCKPORT 3521
--- 881,887 ----
  
  /* Maximum size of a UDP packet accepted */
  /* ??? need to have this documented and agreed */
! #define MAXMETABYTES 2048
  
  /* Port on metaserver for incoming UDP */
  #define USOCKPORT 3521
*** solicit.c.orig	Thu Mar 26 15:03:48 EST 1998
--- solicit.c	Thu Mar 26 15:04:35 EST 1998
***************
*** 9,15 ****
  #include "data.h"
  
  /* bytes to reserve for outgoing packet to metaserver */
! #define MAXMETABYTES 1024
  
  /* maximum number of metaservers supported */
  #define MAXMETASERVERS 3
--- 9,15 ----
  #include "data.h"
  
  /* bytes to reserve for outgoing packet to metaserver */
! #define MAXMETABYTES 2048
  
  /* maximum number of metaservers supported */
  #define MAXMETASERVERS 3

Follow-Ups: