Menu

#152 p_pathtraverse "division by zero"

open
3
2007-10-27
2005-02-11
Darren Salt
No

EDGE occasionally falls over with a division-by-zero
error in p_pathtraverse. The attached patch fixes it
for me.

Discussion

  • Darren Salt

    Darren Salt - 2005-02-11

    Avoid division by zero problem

     
  • Andrew Apted

    Andrew Apted - 2005-02-14

    Logged In: YES
    user_id=11869

    While I accept that this patch fixes it for you, it is
    still extremely odd that x1 and x2 can be the same
    and yet xt1 and xt2 somehow become different.

    Unless I'm missing something obvious, the only thing
    I can think of is the "extra precision" issue that some
    CPUs (x86) have, i.e. when FP values get stored in
    memory and then reloaded, they lose the extra bits.
    (This is described in the GCC info pages).

    Could you try reverting your change and compiling
    EDGE with the -ffloat-store option, and see if the
    same problem occurs? (It has never happened to
    me, but I'm on a PowerPC CPU).

     
  • Andy Baker

    Andy Baker - 2005-02-15

    Logged In: YES
    user_id=11266

    Is this occasionally error is totally random? I guess my
    real question is what you tend to be playing map wise when
    it occurs.

     
  • Darren Salt

    Darren Salt - 2005-02-19

    Logged In: YES
    user_id=294680

    Er... memory says Obtic, for example the entrance to a
    roughly '8'-shaped area at the north end of the start
    corridor (MAP03). I've definitely seen it elsewhere, though.

    I've set things up so that the game will (should) be
    automatically paused when the problem occurs.

     
  • Andrew Apted

    Andrew Apted - 2005-05-18
    • priority: 5 --> 3
     
  • Andrew Apted

    Andrew Apted - 2007-10-27
    • assigned_to: nobody --> ajapted
    • status: open --> open-fixed
     
  • Andrew Apted

    Andrew Apted - 2007-10-27

    Logged In: YES
    user_id=11869
    Originator: NO

    I started getting this error with 1.29 when
    playing DM with bots. It is something to do
    with P_SlideMove() doing very small traversals.

    The SlideMove stuff desperately needs a better
    implementation, but for the time being I've
    reworked P_PathTraverse() similar to your
    patch.

     

Log in to post a comment.