Problems in botlib/be_aas_route.c ?

vincent at cojot.name vincent at cojot.name
Fri Nov 4 11:43:28 EST 2005


I'm trying to find the source of the botlib segfaults on Solaris/Sparc.

I'm running the dedicated server with:

gdb> ....3ded
gdb> b AAS_AreaTravelTime
gdb> r +set vm_game 1 +set vm_cgame 1 +set vm_ui 1 +set sv_pure 1 +set ttycon 0 +map q3dm17

On Linux/i386/RHEL3, I get this run:

------------ Map Loading ------------
trying to load maps/q3dm17.aas
loaded maps/q3dm17.aas
found 29 level items
-------------------------------------
32 bots parsed
35 arenas parsed

Breakpoint 1, AAS_AreaTravelTime (areanum=4, start=0xbfff8bc0, 
end=0xb622b69c)
     at ../botlib/be_aas_route.c:480
480             VectorSubtract(start, end, dir);
(gdb) n
481             dist = VectorLength(dir);
(gdb) n
483             if (AAS_AreaCrouch(areanum)) dist *= 
DISTANCEFACTOR_CROUCH;
(gdb) n
485             else if (AAS_AreaSwim(areanum)) dist *= 
DISTANCEFACTOR_SWIM;
(gdb) n
487             else dist *= DISTANCEFACTOR_WALK;
(gdb) n
489             intdist = (int) dist;
(gdb) print dir
$6 = {0, 5.1000061, 0.125}
(gdb) print dist
$7 = 1.68350756
(gdb) print intdist
$8 = 0

On Solaris/Sparc, I get this run:
------------ Map Loading ------------
trying to load maps/q3dm17.aas
loaded maps/q3dm17.aas
found 29 level items
-------------------------------------
32 bots parsed
35 arenas parsed

Breakpoint 1, AAS_AreaTravelTime (areanum=4, start=0xffbf9d28, 
end=0x496b1bc) at ../botlib/be_aas_route.c:480
480             VectorSubtract(start, end, dir);
(gdb) n
481             dist = VectorLength(dir);
(gdb) n
483             if (AAS_AreaCrouch(areanum)) dist *= 
DISTANCEFACTOR_CROUCH;
(gdb) n
485             else if (AAS_AreaSwim(areanum)) dist *= 
DISTANCEFACTOR_SWIM;
(gdb) n
487             else dist *= DISTANCEFACTOR_WALK;
(gdb) n
489             intdist = (int) dist;
(gdb) print dir
$5 = {0, 5.1000061, 0.125}
(gdb) print dist
$6 = 1.68350756
(gdb) print intdist
$7 = 4543008

I cannot understand why intdist would be so different in both cases.. I 
cannot understand either why it isn't being cast as 'unsigned short' since 
that's what AAS_AreaTravelTime should return..

Eventually, this results in segfaults on Solaris/Sparc..

Program received signal SIGSEGV, Segmentation fault.
0x000a4a24 in AAS_CalculateAreaTravelTimes () at 
../botlib/be_aas_route.c:543
543                             aasworld.areatraveltimes[i][l] = (unsigned short *) ptr;

I can override that segfault by using playing with LittleShort but then it 
dies on line 522 on be_aas_route.c...

*Sigh*

Vincent



More information about the quake3 mailing list