The new alarm handlers are causing instability in both the pret and newbie
processes.  Kathy/Merlin will ghostbust sometime between a new player
logging in, and the terminating of one of the robots.  With newbie, it was
inconsistent as to when Merlin would crash.  However with preT, Kathy
crashes upon the first login attempt in which the game is at 4v4
condition, with 1 human and 3 bots on one team, and 4 bots on the other.
Unapplied the patch which modified pret, and stability was fine.  Will
monitor newbie stability as well, so far it is stable with the patch
unapplied.
Bill

On Wed, 23 Aug 2006, James Cameron wrote:

> The attached patch is an attempt to fix some of the use of unsafe
> functions in the daemon.  It also fixes it in basep, for comparison.
>
> Unsafe functions are those that may not be called in the context of a
> signal handler.  The "man signal" page lists them.  The existing code
> calls some of these functions from within the alarm signal handler
> move() in daemonII.c.
>
> Please review and comment.
>
> Testing has been limited ... a minute of play against "*" robots.
>
> The patch is also in my repository:
> http://james.tooraweenah.com/darcs/netrek-server/
>
> My plan is to extend the feature to the remaining uses of SIGALRM in
> particular, and other signal functions as I locate them.  I may also
> ponder the exitDaemon function, although this isn't as critical.
>
> Design features:
>
> - the use of SIGALRM is placed into a single file, alarm.c in ntserv/,
>   with a new prototype file alarm.h in include/,
>
> - rather than executing the body of the processing in signal context,
>   the main loop is altered so that a counter is incremented when a
>   signal is received,
>
> - the pause(2) call in the main loop is augmented with a check of the
>   counter, and at this point the function that used to be the signal
>   handler is executed.
>
> [fix use of unsafe functions in signal handler, daemon, basep
> quozl at us.netrek.org**20060823014948
>
>         * alarm.c, alarm.h: merge common alarm signal handling functions.
>
>         * basep.c, daemonII.c: use common functions and change main loop to
>           execute always in non-signal context.
>
> ]
>
> --
> James Cameron    mailto:quozl at us.netrek.org     http://quozl.netrek.org/
>