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

[VANILLA-L:1055] Re: [VANILLA-L:1052] Solicit code, new metaservers = hosed slots



Bob Tanner wrote:
> The symptom is always the same. Permanent phaser on. I nuke, eject,
> free the slot and still the next player who comes in has perm-phasers.

Assuming it is seen by all players not just by Bob ...

struct.h:

struct phaser {
    int ph_status;              /* What it's up to */
    u_char ph_dir;              /* direction */
    int ph_target;              /* Who's being hit (for drawing) */
    int ph_x, ph_y;             /* For when it hits a torp */
    int ph_fuse;                /* Life left for drawing */
    int ph_damage;              /* Damage inflicted on victim */
};

Probably a ph_fuse value too high.  Where is it set?

phaser.c:  mine->ph_fuse = me->p_ship.s_phaserfuse;

So it is set from a struct ship.

Where is it decremented?

daemonII.c:2114 for initial hit
daemonII.c:2110 for subsequence updates after initial hit

Hmm.  Interesting ... there's a race condition for multi-processors
here; the phaser status can be set before the direction, fuse, target
and damage are set.  I'm guessing it could be possible for the daemon to
check status and use it before the phaser struct is fully filled out.
Under extreme circumstances it might be possible for the fuse to be
decremented below zero; it is only checked for zero.

Nothing clearly wrong in handing of ph_fuse, so how 'bout s_phaserfuse?

Need more data.  gdb the memory when the problem is shown!  Is it a
ph_fuse with big number, or is it s_phaserfuse of the slot with big
number?  Check both.  Does the big number start out at -1?

s_phaserfuse can be refreshed by modifying .sysdef ... Bob, try changing
.sysdef, see that you get the "loading new configuration", and see if
the phaser of that slot becomes fixed.

-- 
James Cameron                                    (cameron@stl.dec.com)
Digital Equipment Corporation (Australia) Pty. Ltd. A.C.N. 000 446 800
+
++ Vanilla-l Mailing List ++
To unsubscribe: send "unsubscribe vanilla-l" to majordomo@real-time.com
For more information: http://archives.real-time.com


Follow-Ups: References: