project-navigation
Personal tools

Author Topic: Log of an attempt to compile a universal binary for 10.5.6 for 2.3-dev (trunk)  (Read 13390 times)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
I am the first to admit that I do not know what to look for. But, playing around with GDB, I found something that looks interesting.

It looks like the map data is being generated bad.
Code: [Select]
(gdb) down
#0  0x00147458 in TR_TestBoxInBrush (trace_data=0xbfffa3bc, brush=0x1062e9bc) at src/common/tracing.c:800
800 plane = side->plane;
(gdb) down
Bottom (i.e., innermost) frame selected; you cannot go down.
(gdb) list
795 return;
796
797 for (i = 0; i < brush->numsides; i++) {
798 side = &myTile->brushsides[brush->firstbrushside + i];
799 #ifdef COMPILE_UFO
800 plane = side->plane;
801 #else
802 plane = myTile->planes + side->planenum;
803 #endif
804
(gdb) p i
$15 = 0
(gdb) p side
$16 = (cBspBrushSide_t *) 0x3a8ab02c
(gdb) p *side
Cannot access memory at address 0x3a8ab02c

(gdb) p *brush
$17 = {
  contentFlags = 16777216,
  numsides = 134217728,
  firstbrushside = 571998208,
  checkcount = 1
}

(gdb) up
#1  0x00147a30 in TR_TestInLeaf (trace_data=0xbfffa3bc, leafnum=11) at src/common/tracing.c:900
900 TR_TestBoxInBrush(trace_data, b);
(gdb) list
895 continue; /* already checked this brush in another leaf */
896 b->checkcount = checkcount;
897
898 if (!(trace_data->contents && b->contentFlags & trace_data->contents) || (b->contentFlags & trace_data->rejects))
899 continue;
900 TR_TestBoxInBrush(trace_data, b);
901 if (!trace_data->trace.fraction)
902 return;
903 }
904 }
(gdb) p b
$18 = (cBspBrush_t *) 0x1062e9bc
(gdb) p *b
$19 = {
  contentFlags = 16777216,
  numsides = 134217728,
  firstbrushside = 571998208,
  checkcount = 1
}

877 static void TR_TestInLeaf (boxtrace_t *trace_data, int leafnum)
878 {
879 int k;
880 const TR_LEAF_TYPE *leaf;
881 TR_TILE_TYPE *myTile = trace_data->tile;
882
883 assert(leafnum > LEAFNODE);
884 assert(leafnum <= myTile->numleafs);
(gdb)
885
886 leaf = &myTile->leafs[leafnum];
887 if (!(leaf->contentFlags & trace_data->contents) || (leaf->contentFlags & trace_data->rejects))
888 return;
889
890 /* trace line against all brushes in the leaf */
891 for (k = 0; k < leaf->numleafbrushes; k++) {
892 const int brushnum = myTile->leafbrushes[leaf->firstleafbrush + k];
893 cBspBrush_t *b = &myTile->brushes[brushnum];
894 if (b->checkcount == checkcount)
(gdb) p brushnum
$20 = 537
(gdb) p leaf
$21 = (const cBspLeaf_t *) 0x29c6f084
(gdb) p *leaf
$22 = {
  contentFlags = 1,
  firstleafbrush = 2,
  numleafbrushes = 1
}

Leaf looks good, but brushnum looks bad. So part of trace_data looks good, and part of it scrambled.

(gdb) p myTile
$23 = (mapTile_t *) 0x5bfbf54
(gdb) p *myTile
$24 = {
  name = "wilderness", '\0' <repeats 53 times>,
  numbrushsides = 8155,
  brushsides = 0x29cab02c,
  numtexinfo = 1767,
  surfaces = 0x29c4e02c,
  numplanes = 9290,
  planes = 0x29c7d02c,
  numnodes = 6939,
  nodes = 0x29cbb02c,
  numleafs = 6946,
  leafs = 0x29c6f02c,
  emptyleaf = 1,
  numleafbrushes = 2598,
  leafbrushes = 0x1062b22c,
  nummodels = 258,
  models = 0x2950902c,
  numbrushes = 732,
  brushes = 0x1062c82c,
  box_planes = 0x29caa5f4,
  box_headnode = 6939,
  box_brush = 0x1062f5ec,
  box_leaf = 0x29c7c93c,
  tnodes = 0x29cf902c,
  numtheads = 6,
  thead = {0, 24, 920, 1680, 6412, 6478, 0 <repeats 252 times>},
  theadlevel = {0 <repeats 258 times>},
  numcheads = 153,
  cheads = {{
      cnode = 0,
      level = 0
    }, {
      cnode = 17,
      level = 0
    }, {
      cnode = 24,
      level = 252
    }, {
      cnode = 157,
      level = 252
    }, {
      cnode = 331,
      level = 252
    }, {
      cnode = 361,
      level = 252
    }, {
... snip ...
    }, {
      cnode = 6922,
      level = 257
    }, {
      cnode = 6928,
      level = 257
    }, {
      cnode = 0,
      level = 0
    } <repeats 65383 times>},
  wpMins = {128, 118, 0},
  wpMaxs = {193, 197, 7}
}

There's enough obvious meaningful information in there that I don't suspect an invalid pointer, but some of the data in there is invalid -- it's crashing in the next subroutine down.

(gdb) p k
$25 = 0
(gdb) p leafnum
$26 = 11
(gdb) p leaf
$27 = (const cBspLeaf_t *) 0x29c6f084
(gdb) p *leaf
$28 = {
  contentFlags = 1,
  firstleafbrush = 2,
  numleafbrushes = 1
}
(gdb) p brushnum
$29 = 537

Looks a little high

Some earlier looking around:

(gdb) up
#2  0x00148720 in TR_BoxTrace (tile=0x5bfbf54, start=0xbfffba10, end=0xbfffba10, mins=0xbfffb9f8, maxs=0xbfffba04, headnode=0, brushmask=-1, brushreject=0, fraction=2) at src/common/tracing.c:1106
1106 TR_TestInLeaf(&trace_data, leafs[i]);
(gdb) list
1101 c2[i] += 1;
1102 }
1103
1104 numleafs = TR_BoxLeafnums_headnode(&trace_data, c1, c2, leafs, MAX_LEAFS, headnode, &topnode);
1105 for (i = 0; i < numleafs; i++) {
1106 TR_TestInLeaf(&trace_data, leafs[i]);
1107 if (trace_data.trace.allsolid)
1108 break;
1109 }
1110 VectorCopy(start, trace_data.trace.endpos);
(gdb) p i
$12 = 4
(gdb) p numleafs
$13 = 11
(gdb) p leafs
$14 = {1, 6, 8, 10, 11, 12, 13, 14, 15, 17, 18, 0, 0, 0, 0, -- snip --
Numleafs looks good, and this isn't the first time through the loop. So the data seems to be partially valid, and partially invalid.

As a side note: Do not use "i" as an array subscript. Reason: The notation "[ i ]" in code triggers bbcode ...

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
the brush num doesn't look bad - i mean 537 isn't really that high.

if you activate the developer mode (developer cvar to 1) you can see how many nodes, leafs brushes and so on are loaded on map start. please try to compare them with the numsides, numbrushes, numleafs and so on. i had a look too, and i can't find any missing endian swap for the bsp data. maybe there is some memory corruption. did you ever use valgrind (is it even available for macosx?). if you could run it in valgrind (execute ./contrib/scritps/valgrind.sh ufo from trunk/), please send the output (but be warned, it's damn slow in valgrind ;))

did you compile the wilderness map yourself?

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Valgrind turned out to be real fast:
Kleiman-ibook:trunk michael$ ./contrib/scripts/valgrind.sh ufo
readlink: illegal option -- f
usage: readlink [-n] [file ...]
 is no executable
Kleiman-ibook:trunk michael$

Kleiman-ibook:trunk michael$ valgrind
-bash: valgrind: command not found
Kleiman-ibook:trunk michael$ man valgrind
No manual entry for valgrind

I don't think it's there.

Yes, I compiled wilderness myself.
===

Now a question on "make maps" versus "./ufo2map". "Make maps" normally adds in "-extra", and we were told by another mac developer that it takes about 5 days. I have used ./ufo2map, without -extra; when I removed that from the makefile, it only took overnight.

I'm going to try a map with -extra, and see what that's like.

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
I think something got missed on a recent check-in:

This is from a make clean.

...
 * [GAM] src/game/lua/lvm.c
 * [GAM] src/game/lua/lzio.c
 * [GAM] src/game/lua/print.c
 * [GAM] ... linking -rdynamic ()
Undefined symbols:
  "_AI_Cleanup", referenced from:
      _G_EndGame in g_main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Undefined symbols:
  "_AI_Cleanup", referenced from:
      _G_EndGame in g_main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/rE/rEdMXgrOG7WDErrJmyTTEE+++TM/-Tmp-//ccYDb4iZ.out (No such file or directory)
make: *** [base/game.dylib] Error 1
Kleiman-ibook:trunk michael$ svn up
At revision 23625.
Kleiman-ibook:trunk michael$

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Alright, if you can tell me what to look for, I can provide you with any information you want. I've got a null pointer dereference right now.

Svn: 23627.
All maps compiled locally.
"Wilderness" compiled with -extra

Currently sitting there in GDB, waiting for instructions.
Code: [Select]
.. done
S_Music_Start: Playing music: 'music/van_theme'
R_RegisterModelShort: Could not find: 'weapons/autocannon/autocannon'
CL_LanguageInit: language settings are stored in configuration: en
...using language: en_US.UTF-8
SDL_ttf version 2.0.9 - we need at least 2.0.7
...registering 10 fonts
126 static models loaded
====== UFO Initialized ======

Switch grab input off
Reading symbols for shared libraries .. done
Reading symbols for shared libraries . done
r console
Unknown command "r" - wasn't sent to server
r_checkerror 1
r_programs 0
r_developer 1
Unknown command "r_developer" - wasn't sent to server
developer 1
^C
Program received signal SIGINT, Interrupt.
0x92f17d20 in select$DARWIN_EXTSN ()
(gdb) break CM_AddMapTile
Breakpoint 1 at 0x11f26c: file src/common/cmodel.c, line 1033.
(gdb) c
Continuing.
ExecuteString: '+leftmouse 200 626573'
ExecuteString: 'mn_push singleplayer'
ExecuteString: ''
ExecuteString: '-leftmouse 200 626747'
ExecuteString: '-select 200 626747'
ExecuteString: '+leftmouse 200 641034'
ExecuteString: 'mn_push skirmish'
ExecuteString: ''
ExecuteString: 'game_setmode'
Change gametype to 'Skirmish mode'
ExecuteString: 'set ai_numaliens 8'
ExecuteString: 'set difficulty 0'
ExecuteString: ''
ExecuteString: 'set mn_serverday 1'
ExecuteString: 'mn_getmaps'
ExecuteString: ''
ExecuteString: '-leftmouse 200 641546'
ExecuteString: '-select 200 641546'
ExecuteString: '+leftmouse 200 645356'
ExecuteString: 'mn_prevmap'
ExecuteString: ''
ExecuteString: '-leftmouse 200 645490'
ExecuteString: '-select 200 645490'
ExecuteString: '+leftmouse 200 650140'
ExecuteString: 'sk_start'
Could not find rank 'rifleman'
No valid name definitions for gender 0 in category 'phalanx'
Could not find rank 'rifleman'
Could not find rank 'rifleman'
Could not find rank 'rifleman'
Could not find rank 'rifleman'
No valid name definitions for gender 0 in category 'phalanx'
Could not find rank 'rifleman'
Could not find rank 'rifleman'
Could not find rank 'rifleman'
No valid name definitions for gender 0 in category 'phalanx'
ExecuteString: ''
ExecuteString: 'map day wilderness '
Set server state to 0
------- Loading game.dylib -------
Reading symbols for shared libraries . done
LoadLibrary (./base/game.dylib)
==== InitGame ====
SpawnServer: wilderness
Set server state to 0
CM_LoadMap: token: wilderness

Breakpoint 1, 0x0011f26c in CM_AddMapTile (name=0xbfffbde0 "wilderness", day=qtrue, sX=0, sY=0, sZ=0 '\0') at src/common/cmodel.c:1033
1033 {
(gdb) # First call
Current language:  auto; currently c
(gdb) c
Continuing.
CM_AddMapTile: wilderness at 0,0,0
...surfaces: 1767
...leafs: 6946
...leafbrushes: 2598
...planes: 9290
...brushes: 732
...brushsides: 8155
...submodels: 258
...nodes: 6939
Map:wilderness  Offset:(0, 0, 0)
wpMins:(128, 118, 0) wpMaxs:(193, 197, 7)
Shifted wpMins:(128, 118, 0) wpMaxs:(193, 197, 7)
Tile bounds: (128, 118, 0) to (193, 197, 7)
Source bounds: (128, 118, 0) to (193, 197, 7)
Done copying data.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x0014839c in TR_TestBoxInBrush (trace_data=0xbfffa3bc, brush=0x10613dbc) at src/common/tracing.c:808
808 if (plane->normal[j] < 0)
(gdb) p j
$1 = 0
(gdb) p plane
$2 = (cBspPlane_t *) 0x0
(gdb) bt
#0  0x0014839c in TR_TestBoxInBrush (trace_data=0xbfffa3bc, brush=0x10613dbc) at src/common/tracing.c:808
#1  0x00148950 in TR_TestInLeaf (trace_data=0xbfffa3bc, leafnum=11) at src/common/tracing.c:899
#2  0x00149640 in TR_BoxTrace (tile=0x5bfcf54, start=0xbfffba10, end=0xbfffba10, mins=0xbfffb9f8, maxs=0xbfffba04, headnode=0, brushmask=-1, brushreject=0, fraction=2) at src/common/tracing.c:1105
#3  0x00149f50 in TR_TileBoxTrace (myTile=0x5bfcf54, start=0xbfffba10, end=0xbfffba10, mins=0xbfffb9f8, maxs=0xbfffba04, levelmask=511, brushmask=-1, brushreject=0, fraction=2) at src/common/tracing.c:1237
#4  0x0014a70c in TR_CompleteBoxTrace (start=0xbfffba10, end=0xbfffba10, mins=0xbfffb9f8, maxs=0xbfffba04, levelmask=511, brushmask=-1, brushreject=0) at src/common/tracing.c:1319
#5  0x0011d7a4 in CM_EntCompleteBoxTrace (start=0xbfffba10, end=0xbfffba10, mins=0xbfffb9f8, maxs=0xbfffba04, levelmask=511, brushmask=-1, brushreject=0) at src/common/cmodel.c:741
#6  0x0014b578 in RT_GetMapSize (map_min=0x4432014, map_max=0x4432008) at src/common/routing.c:177
#7  0x0011ecd8 in CMod_LoadRouting (name=0xbfffbde0 "wilderness", l=0xbfffbce8, sX=0, sY=0, sZ=0) at src/common/cmodel.c:915
#8  0x0011f8b0 in CM_AddMapTile (name=0xbfffbde0 "wilderness", day=qtrue, sX=0, sY=0, sZ=0 '\0') at src/common/cmodel.c:1107
#9  0x00120434 in CM_LoadMap (tiles=0xbfffbf9a "", day=qtrue, pos=0x0, mapchecksum=0xbfffbed0) at src/common/cmodel.c:1258
#10 0x00157dc8 in SV_SpawnServer (day=qtrue, server=0xbfffbf90 "wilderness", param=0x0) at src/server/sv_init.c:1111
#11 0x001583fc in SV_Map (day=qtrue, levelstring=0xbfffbf90 "wilderness", assembly=0x0) at src/server/sv_init.c:1224
#12 0x00151fd0 in SV_Map_f () at src/server/sv_ccmds.c:187
#13 0x00116d58 in Cmd_ExecuteString (text=0xbffff254 "map day wilderness ") at src/common/cmd.c:912
#14 0x0011524c in Cbuf_Execute () at src/common/cmd.c:229
#15 0x00036f28 in CL_SendCommand () at src/client/cl_main.c:931
#16 0x00037794 in CL_Frame (now=650140, data=0x0) at src/client/cl_main.c:1111
#17 0x00128920 in tick_timer (now=650140, data=0x183a071c) at src/common/common.c:1084
#18 0x00128d44 in Qcommon_Frame () at src/common/common.c:1165
#19 0x0019ccd8 in main (argc=1, argv=0xbffff8ac) at src/ports/macosx/osx_main.m:142
(gdb)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
I'd like help understanding "numTiles" in the file src/common/cmodel.c

As far as I can tell, this is a global that counts the current tile being loaded into the map.

It is initialized to zero in CM_LoadMap.
It gets incremented in CM_AddMapTile
It is increased just before calling CMod_LoadRouting
It is down in CMod_LoadRouting that I'm crashing.

Is this a trivial "Oppsie", or am I looking at the wrong thing?

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Ok, I really think this is a bug.


As mentioned, AddMapTile increments numTiles and then makes these calls:

Stack trace:
Code: [Select]
#8  0x0011f8b0 in CM_AddMapTile (name=0xbfffbde0 "wilderness", day=qtrue, sX=0, sY=0, sZ=0 '\0') at src/common/cmodel.c:1107
1107 CMod_LoadRouting(name, &header.lumps[LUMP_ROUTING], sX, sY, sZ);
(gdb) down
#7  0x0011ecd8 in CMod_LoadRouting (name=0xbfffbde0 "wilderness", l=0xbfffbce8, sX=0, sY=0, sZ=0) at src/common/cmodel.c:915
915 RT_GetMapSize(map_min, map_max);
(gdb) down
#6  0x0014b578 in RT_GetMapSize (map_min=0x4432014, map_max=0x4432008) at src/common/routing.c:177
177 trace = RT_COMPLETEBOXTRACE(origin, origin, mins, maxs, 0x1FF, MASK_ALL, 0);
(gdb) down
#5  0x0011d7a4 in CM_EntCompleteBoxTrace (start=0xbfffba10, end=0xbfffba10, mins=0xbfffb9f8, maxs=0xbfffba04, levelmask=511, brushmask=-1, brushreject=0) at src/common/cmodel.c:741
741 trace = TR_CompleteBoxTrace(start, end, mins, maxs, levelmask, brushmask, brushreject);
(gdb) down
#4  0x0014a70c in TR_CompleteBoxTrace (start=0xbfffba10, end=0xbfffba10, mins=0xbfffb9f8, maxs=0xbfffba04, levelmask=511, brushmask=-1, brushreject=0) at src/common/tracing.c:1319
1319 newtr = TR_TileBoxTrace(myTile, start, end, mins, maxs, levelmask, brushmask, brushreject, tr.fraction);

At this point, we have this code:

Code: [Select]
1281 trace_t TR_CompleteBoxTrace (const vec3_t start, const vec3_t end, const vec3_t mins,
     const vec3_t maxs, const int levelmask, const int brushmask, const int brushreject)
1282 {
1283     trace_t newtr, tr;
1284     int tile, i;
1285     vec3_t smin, smax, emin, emax, wpmins, wpmaxs;
1286     const vec3_t offset = {UNIT_SIZE / 2, UNIT_SIZE / 2, UNIT_HEIGHT / 2};
1287
1288     memset(&tr, 0, sizeof(tr));
1289     tr.fraction = 2.0f;
1290
1291     /* Prep the mins and maxs */
1292     for (i = 0; i < 3; i++) {
1293         smin[i] = start[i] + min(mins[i], maxs[i]);
1294         smax[i] = start[i] + max(mins[i], maxs[i]);
1295         emin[i] = end[i] + min(mins[i], maxs[i]);
1296         emax[i] = end[i] + max(mins[i], maxs[i]);
1297     }
1298
1299     /* trace against all loaded map tiles */
1300     for (tile = 0; tile < numTiles; tile++) {

And we're looking one tile past anything that has been loaded.

Testing ...

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
It got a lot farther.

Code: [Select]
====== UFO Initialized ======

Switch grab input off
developer 1
ExecuteString: '+leftmouse 200 81775'
ExecuteString: 'mn_push options'
ExecuteString: ''
ExecuteString: 'mn_init_keylist'
ExecuteString: 'mn_textupdated keylist'
Unknown command "mn_textupdated" - wasn't sent to server
ExecuteString: 'optionkey_count 0'
ExecuteString: ''
ExecuteString: '-leftmouse 200 81951'
ExecuteString: '-select 200 81951'
ExecuteString: '+leftmouse 200 86667'
ExecuteString: 'copy mn_vidmode vid_mode'
ExecuteString: ''
ExecuteString: '-leftmouse 200 86820'
ExecuteString: '-select 200 86820'
ExecuteString: '+leftmouse 200 90735'
ExecuteString: '-leftmouse 200 90905'
ExecuteString: '-select 200 90905'
ExecuteString: '+leftmouse 200 98807'
ExecuteString: 'mn_pop'
ExecuteString: ''
ExecuteString: '-leftmouse 200 98958'
ExecuteString: '-select 200 98958'
ExecuteString: 'toggleconsole'
ExecuteString: '-turnup 114 258507'
ExecuteString: '-hudradar 104 259605'
ExecuteString: '-turnup 114 261267'
ExecuteString: '-turnup 114 261457'
ExecuteString: '-turnup 114 261760'
r_checkerror 1
ExecuteString: 'r_checkerror 1'
ExecuteString: '-turnup 114 269564'
ExecuteString: '-turnup 114 275134'
ExecuteString: '-turnup 114 276309'
ExecuteString: '-shiftleft 97 276428'
ExecuteString: '-shiftdown 115 276754'
r_programs
ExecuteString: 'r_programs '
"r_programs" is "0"
ExecuteString: '-turnup 114 286054'
ExecuteString: '-turnup 114 286872'
ExecuteString: '-turnup 114 287434'
ExecuteString: '-shiftleft 97 287570'
ExecuteString: '-shiftdown 115 287931'
r_programs 1
ExecuteString: 'r_programs 1'
R_LoadProgram: 'default' loaded.
R_LoadProgram: 'warp' loaded.
ExecuteString: '-turnup 114 308121'
ExecuteString: '-turnup 114 309742'
ExecuteString: '-turnup 114 310329'
ExecuteString: '-shiftleft 97 310569'
ExecuteString: '-shiftdown 115 311208'
r_programs 0
ExecuteString: 'r_programs 0'
ExecuteString: '+leftmouse 200 326474'
ExecuteString: 'mn_push singleplayer'
ExecuteString: ''
ExecuteString: '-leftmouse 200 326620'
ExecuteString: '-select 200 326620'
ExecuteString: '+leftmouse 200 327685'
ExecuteString: 'mn_push skirmish'
ExecuteString: ''
ExecuteString: 'game_setmode'
Change gametype to 'Skirmish mode'
ExecuteString: 'set ai_numaliens 8'
ExecuteString: 'set difficulty 0'
ExecuteString: ''
ExecuteString: 'set mn_serverday 1'
ExecuteString: 'mn_getmaps'
ExecuteString: ''
ExecuteString: '-leftmouse 200 328351'
ExecuteString: '-select 200 328351'
ExecuteString: '+leftmouse 200 331987'
ExecuteString: 'mn_prevmap'
ExecuteString: ''
ExecuteString: '-leftmouse 200 332114'
ExecuteString: '-select 200 332114'
ExecuteString: '+leftmouse 200 334809'
ExecuteString: 'sk_start'
Could not find rank 'rifleman'
Could not find rank 'rifleman'
Could not find rank 'rifleman'
Could not find rank 'rifleman'
No valid name definitions for gender 0 in category 'phalanx'
Could not find rank 'rifleman'
Could not find rank 'rifleman'
Could not find rank 'rifleman'
Could not find rank 'rifleman'
ExecuteString: ''
ExecuteString: 'map day wilderness '
Set server state to 0
------- Loading game.dylib -------
LoadLibrary (./base/game.dylib)
==== InitGame ====
SpawnServer: wilderness
Set server state to 0
CM_LoadMap: token: wilderness
CM_AddMapTile: wilderness at 0,0,0
...surfaces: 1767
...leafs: 6946
...leafbrushes: 2598
...planes: 9290
...brushes: 732
...brushsides: 8155
...submodels: 258
...nodes: 6939
Map:wilderness  Offset:(0, 0, 0)
wpMins:(128, 118, 0) wpMaxs:(193, 197, 7)
Shifted wpMins:(128, 118, 0) wpMaxs:(193, 197, 7)
Tile bounds: (128, 118, 0) to (193, 197, 7)
Source bounds: (128, 118, 0) to (193, 197, 7)
Done copying data.
Loaded routing for tile wilderness in   0.0s
checksum for the map 'wilderness': 261412033
ufo script checksum 849594367
Set server state to 1
Entity:0 class:(null) key:classname
entity: model () num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 0 0 0
Entity:1 class:noclass key:angle
Entity:1 class:noclass key:origin
Entity:1 class:noclass key:classname
entity: model () num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 176 912 292
Entity:2 class:noclass key:model
Entity:2 class:noclass key:spawnflags
Entity:2 class:noclass key:origin
Entity:2 class:noclass key:classname
entity: model (models/aircraft/drop_firebird/firebird_top.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 448 2080 292
Entity:2 class:noclass key:model
Entity:2 class:noclass key:origin
Entity:2 class:noclass key:spawnflags
Entity:2 class:noclass key:classname
entity: model (models/aircraft/drop_firebird/firebird_glass.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 448 2080 292
Entity:2 class:noclass key:spawnflags
Entity:2 class:noclass key:model
Entity:2 class:noclass key:origin
Entity:2 class:noclass key:classname
entity: model (models/aircraft/drop_firebird/firebird.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 448 2080 292
Entity:2 class:noclass key:origin
Entity:2 class:noclass key:classname
entity: model () num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 304 1904 284
Entity:3 class:noclass key:team

... snip ...

Entity:19 class:noclass key:classname
entity: model () num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 2064 1520 92
Entity:20 class:noclass key:angles
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:model
Entity:20 class:noclass key:spawnflags
Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/tropic/tropic01.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 1862 1926 170
Entity:20 class:noclass key:spawnflags
Entity:20 class:noclass key:angle
Entity:20 class:noclass key:model
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/plants/plant_a.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 516 474 116
Entity:20 class:noclass key:modelscale_vec
ED_ParseField: modelscale_vec is not a valid field
Entity:20 class:noclass key:spawnflags
Entity:20 class:noclass key:model
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/plant/plant2.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 689 1232 222
Entity:20 class:noclass key:modelscale_vec
ED_ParseField: modelscale_vec is not a valid field
Entity:20 class:noclass key:skin
ED_ParseField: skin is not a valid field
Entity:20 class:noclass key:model
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:spawnflags
Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/fir/fir.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 1904 1072 90
Entity:20 class:noclass key:modelscale_vec
ED_ParseField: modelscale_vec is not a valid field
Entity:20 class:noclass key:angle
Entity:20 class:noclass key:model
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:spawnflags
Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/tree02/tree2_a.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 1744 944 88
Entity:20 class:noclass key:angle
Entity:20 class:noclass key:model
Entity:20 class:noclass key:origin

... massive snip ...

Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/tree02/tree2_a.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 400 1232 216
Entity:20 class:noclass key:angles
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:model
Entity:20 class:noclass key:spawnflags
Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/tropic/tropic04.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 276 1218 236
Entity:20 class:noclass key:angle
Entity:20 class:noclass key:team
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:classname
entity: model () num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 1904 272 76
Entity:20 class:noclass key:angle
Entity:20 class:noclass key:team
Entity:20 class:noclass key:origin
Eter
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
Created AI player (team 7)
0 groups with 0 entities
Set server state to 2
-------------------------------------
CL_SetClientState: Set new state to 3 (old was: 1)
s key:classname
entity: model (models/objects/vegi/water_lily/lily_leaf.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 1712 512 32
No civilian spawn points in this map or civilians deactivated
No valid name definitions for gender 2 in category 'ortnok'
No valid name definitions for gender 1 in category 'ortnok'
No valid name definitions for gender 2 in category 'ortnok'
No valid name definitions for gender 1 in category 'ortnok'
No valid name definitions for gender 2 in category 'ortnok'
No valid name definitions for gender 2 in category 'ortnok'
No valid name definitions for gender 2 in category 'ortnok'
No valid name definitions for gender 1 in category 'ortnok'
CHRSH_CharGetBody: use 'aliens/ortnok/body01' as body model path for character
CHRSH_CharGetBody: use 'aliens/ortnok/head02' as head model path for character
INVSH_EquipActor: no weapon picked in equipment 'multiplayer_alien', defaulting to the most expensive secondary weapon without reload.
No valid name definitions for gender 1 in category 'ortnok'
No valid name definitions for gender 1 in category 'ortnok'
CHRSH_CharGetBody: use 'aliens/ortnok/body01' as body model path for character
CHRSH_CharGetBody: use 'aliens/ortnok/head01' as head model path for character
INVSH_EquipActor: no weapon picked in equipment 'multiplayer_alien', defaulting to the most expensive secondary weapon without reload.

... snip ...

CHRSH_CharGetBody: use 'aliens/ortnok/body01' as body model path for character
CHRSH_CharGetBody: use 'aliens/ortnok/head01' as head model path for character
No valid name definitions for gender 2 in category 'ortnok'
CHRSH_CharGetBody: use 'aliens/ortnok/body01' as body model path for character
CHRSH_CharGetBody: use 'aliens/ortnok/head01' as head model path for charac2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 1712 480 32
Entity:20 class:noclass key:angle
Entity:20 class:noclass key:spawnflags
Entity:20 class:noclass key:model
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/water_lily/lily_stem.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 1712 480 32
Entity:20 class:noclass key:spawnflags
Entity:20 class:noclass key:model
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/water_lily/lily_stem.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 1744 496 32
Entity:20 class:noclass key:modelscale_vec
ED_ParseField: modelscale_vec is not a valid field
Entity:20 class:noclass key:spawnflags
Entity:20 class:noclass key:model
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/water_lily/lily_leaf.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 1744 496 32
Entity:20 class:noclass key:angle
Entity:20 class:noclass key:spawnflags
Entity:20 class:noclass key:model
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/water_lily/lily_stem.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 1712 512 32
Entity:20 class:noclass key:modelscale_vec
ED_ParseField: modelscale_vec is not a valid field
Entity:20 class:noclass key:angle
Entity:20 class:noclass key:spawnflags
Entity:20 class:noclass key:model
Entity:20 class:noclass key:origin
Entity:20 class:noclass key:classname
entity: model (models/objects/vegi/water_lily/lily_leaf.md2) num: 0 solid:0 mins: 0 0 0 maxs: 0 0 0 absmins: 0 0 0 absmaxs: 0 0 0 origin: 1712 512 32
No civilian spawn points in this map or civilians deactivated
No valid name definitions for gender 2 in category 'ortnok'
No valid name definitions for gender 1 in category 'ortnok'
No valid name definitions for gender 2 in category 'ortnok'
No valid name definitions for gender 1 in category 'ortnok'
No valid name definitions for gender 2 in category 'ortnok'
No valid name definitions for gender 2 in category 'ortnok'
No valid name definitions for gender 2 in category 'ortnok'
No valid name definitions for gender 1 in category 'ortnok'
CHRSH_CharGetBody: use 'aliens/ortnok/body01' as body model path for character
CHRSH_CharGetBody: use 'aliens/ortnok/head02' as head model path for character
INVSH_EquipActor: no weapon picked in equipment 'multiplayer_alien', defaulting to the most expensive secondary weapon without reload.
... snip ...

CHRSH_CharGetBody: use 'aliens/ortnok/body01' as body model path for character
CHRSH_CharGetBody: use 'aliens/ortnok/head01' as head model path for character
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '12' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
new event '22' for mask 0
Created AI player (team 7)
0 groups with 0 entities
Set server state to 2
-------------------------------------
CL_SetClientState: Set new state to 3 (old was: 1)
Connecting to localhost...
New stream at index: 0
New stream at index: 1
Packet : connect
SVC_DirectConnect()
Set state for client 'michael' to 1
server OOB:
CL_SetClientState: Set new state to 4 (old was: 3)
0   ufo                                 0x0019c790 Sys_Mkdir + 180
1   ufo                                 0x0019c808 Sys_Mkdir + 300
2   libSystem.B.dylib                   0x92f3399c _sigtramp + 68
Wrote keys.cfg

^CReceived signal 2, quitting..
recursive shutdown
Kleiman-ibook:trunk michael$

Yep, it really takes that long and does that much on entity 20.

Now, sometimes I can get it to display a black map (cannot even see my team), and sometimes it crashes like this.
However, it does get that little bit farther -- the map does load now.

Investigation continues ...

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
I think I see the problem.

There are some places where "numTiles" is used as "past the upper limit of valid tiles" -- things like for(i=0; i<numTiles; i++), where if "numTiles == 0", for the start of the level load, will be skipped completely; and other places where "numTiles" is used as a valid current index into an array.

I don't pretend to know all of it, but it seems that numTiles is being used inconsistently, like its meaning has changed over the course of the code development.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools