project-navigation
Personal tools

Author Topic: Problem with build 23768 (03/29/09)  (Read 6583 times)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Problem with build 23768 (03/29/09)
« on: March 27, 2009, 04:32:12 pm »
Ufo is in an infinite loop after trying to abort a game after loading the map.

This GDB was configured as "powerpc-apple-darwin".
(gdb) attach 5329
Unable to access task for process-id 5329: (os/kern) failure.
(gdb) quit
Kleiman-ibook:trunk michael$ ps -p 5329
  PID TTY           TIME CMD
 5329 ttys000    2:36.76 ./ufo
Kleiman-ibook:trunk michael$

Quote
[STATS] 2009/03/27 08:13:10 - End of game - Team 7 is the winner
[STATS] 2009/03/27 08:13:10 - Soldier Harpreet Kaul earned 46 experience points in skill #0 (total experience: 46). It is now 0 higher.

[STATS] 2009/03/27 08:13:10 - Soldier Harpreet Kaul earned 0 experience points in skill #1 (total experience: 0). It is now 0 higher.

[STATS] 2009/03/27 08:13:10 - Soldier Harpreet Kaul earned 0 experience points in skill #2 (total experience: 0). It is now 0 higher.

[STATS] 2009/03/27 08:13:10 - Soldier Harpreet Kaul earned 0 experience points in skill #3 (total experience: 0). It is now 0 higher.

[STATS] 2009/03/27 08:13:10 - Soldier Harpreet Kaul earned 0 experience points in skill #4 (total experience: 0). It is now 0 higher.

[STATS] 2009/03/27 08:13:10 - Soldier Harpreet Kaul earned 0 experience points in skill #5 (total experience: 0). It is now 0 higher.

[STATS] 2009/03/27 08:13:10 - Soldier Harpreet Kaul earned 0 experience points in skill #6 (total experience: 0). It is now 0 higher.
[STATS] 2009/03/27 08:13:10 - Soldier Harpreet Kaul earned 0 experience points in skill #7 (total experience: 0). It is now 0 higher.
[STATS] 2009/03/27 08:13:10 - Soldier Harpreet Kaul earned 0 experience points in skill #8 (total experience: 0). It is now 0 higher.
[STATS] 2009/03/27 08:13:10 - Soldier Harpreet Kaul earned 23 experience points in skill #9 (total experience: 23). It is now 0 higher.
[STATS] 2009/03/27 08:13:10 - Soldier Badieh Velez earned 46 experience points in skill #0 (total experience: 46). It is now 0 higher.
[STATS] 2009/03/27 08:13:10 - Soldier Badieh Velez earned 0 experience points in skill #1 (total experience: 0). It is now 0 higher.
[STATS] 2009/03/27 08:13:10 - Soldier Badieh Velez earned 0 experience points in skill #2 (total experience: 0). It is now 0 higher.
[STATS] 2009/03/27 08:13:10 - Soldier Badieh Velez earned 0 experience points in skill #3 (total experience: 0). It is now 0 higher.
[STATS] 2009/03/27 08:13:10 - Soldier Badieh Velez earned 0 experience points

Yes, it cut off in mid sentence there.

Locally compiled maps are still having the byteswap issue with brushes (which I correct for), and still displaying with the same ugly "polygon faces" that I mentioned before.

Lets see if I have the diskspace to build a .dmg to upload

Sadly:
msgfmt -v -o base/i18n/th/LC_MESSAGES/ufoai.mo src/po/ufoai-th.po
1125 translated messages, 603 fuzzy translations, 446 untranslated messages.
msgfmt -v -o base/i18n/zh_CN/LC_MESSAGES/ufoai.mo src/po/ufoai-zh_CN.po
src/po/ufoai-zh_CN.po:14483: `msgid' and `msgstr' entries do not both end with '\n'
src/po/ufoai-zh_CN.po:14488: `msgid' and `msgstr' entries do not both end with '\n'
msgfmt: found 2 fatal errors
2165 translated messages, 9 untranslated messages.
make: *** [base/i18n/zh_CN/LC_MESSAGES/ufoai.mo] Error 1
Kleiman-ibook:trunk michael$

Can't make the .dmg.
« Last Edit: March 29, 2009, 05:50:39 pm by keybounce »

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Problem with build 23711
« Reply #1 on: March 27, 2009, 06:26:59 pm »
please try the latest revision - both issues should be fixed now

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with build 23711
« Reply #2 on: March 27, 2009, 09:53:32 pm »
And maps has changed in 23726, so another 2 days to compile those :-)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with build 23726
« Reply #3 on: March 27, 2009, 10:09:22 pm »
Maps fails on build 23726
Code: [Select]
./ufo2map -nice 19 -extra -t 1 maps/./africa/af_drop_firebird.map
nice = 19
extrasamples = true
threads: #1
---- ufo2map 1.2.4 ----
path: 'maps/./africa/af_drop_firebird.map'

---- filesystem initialization -----
Adding game dir: /usr/local/lib/ufoai/base
Adding game dir: /usr/local/share/ufoai/base
Adding game dir: /Users/michael/.ufoai/2.3-dev/base
Adding game dir: ./base
using ./base for writing
...map: 'maps/./africa/af_drop_firebird.map'
...bsp: 'maps/./africa/af_drop_firebird.bsp'
entering maps/./africa/af_drop_firebird.map
     LEVEL: 0...1...2...3...4...5...6...7...8...9... (time:      0s, #: 258)
 UNITCHECK: 0...1...2...3...4...5...6...7...8...9... (time:      1s, #: 131072)
 CONNCHECK: 0...1...2...3...4...5...6...7...8...9... (time:      1s, #: 524288)
Writing maps/./africa/af_drop_firebird.bsp
    2 seconds elapsed
----- Lighting ----
Assertion failed: (node < curTile->numnodes + 6), function TR_BuildTracingNode_r, file src/common/tracing.c, line 139.
make: *** [base/maps/./africa/af_drop_firebird.bsp] Abort trap
make: *** Deleting file `base/maps/./africa/af_drop_firebird.bsp'
Kleiman-ibook:trunk michael$

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Problem with build 23726
« Reply #4 on: March 27, 2009, 11:06:40 pm »
that smells like another endian issue.... can you provide some gdb info pleasE?

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with build 23726
« Reply #5 on: March 27, 2009, 11:39:53 pm »
Now that I know what to look for, yes

62         assert(curTile->numtheads < LEVEL_MAX);
63         TR_BuildTracingNode_r(curTile->models.headnode, i);
64      }
65   }
66   
67   /**
(gdb) p i
$9 = 255
(gdb) p curTile->models
$10 = {
  mins = {0, 0, 0},
  maxs = {0, 0, 0},
  origin = {0, 0, 0},
  headnode = 1761607680,
  firstface = 0,
  numfaces = 134217728
}
(gdb) # There you go.
(gdb)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with build 23726
« Reply #6 on: March 28, 2009, 12:24:20 am »
Still looking ...
Code: [Select]
(gdb) break DoRouting
Breakpoint 4 at 0x1deb4: file src/tools/ufo2map/routing.c, line 155.
(gdb) c
Continuing.
     LEVEL: 0...1...2...3...4...5...6...7...8...9... (time:      0s, #: 258)

Breakpoint 4, DoRouting () at src/tools/ufo2map/routing.c:155
155 if (config.generateDebugTrace)
(gdb) p curTile->models[255]
$6 = {
  mins = {0, 0, 0},
  maxs = {0, 0, 0},
  origin = {0, 0, 0},
  headnode = 14,
  firstface = 0,
  numfaces = 14
}
(gdb)
Not broken yet

Found it!
When the maps are written out, then it gets byteswapped.

Code: [Select]
(gdb) n
219 data = curTile->routedata;
(gdb) n
220 for (i = 0; i < 3; i++)
(gdb) n
221 wpMins[i] = LittleLong(wpMins[i]);
(gdb) # Ohh ...
(gdb) list
216 }
217
218 /* store the data */
219 data = curTile->routedata;
220 for (i = 0; i < 3; i++)
221 wpMins[i] = LittleLong(wpMins[i]);
222 data = CompressRouting((byte*)wpMins, data, sizeof(wpMins));
223 for (i = 0; i < 3; i++)
224 wpMaxs[i] = LittleLong(wpMaxs[i]);
225 data = CompressRouting((byte*)wpMaxs, data, sizeof(wpMaxs));
(gdb)
226 data = CompressRouting((byte*)Nmap, data, sizeof(Nmap));
227
228 curTile->routedatasize = data - curTile->routedata;
229
230 /* Ensure that we did not exceed our allotment of memory for this data. */
231 assert(curTile->routedatasize <= MAX_MAP_ROUTING);
232
233 /* Remove the CLIPS fom the tracing structure by resetting it. */
234 PopInfo();
235 }
(gdb) break 232
Breakpoint 6 at 0x1e758: file src/tools/ufo2map/routing.c, line 232.
(gdb) c
Continuing.

Breakpoint 6, DoRouting () at src/tools/ufo2map/routing.c:234
234 PopInfo();
(gdb) p curTile->models[255]
$15 = {
  mins = {0, 0, 0},
  maxs = {0, 0, 0},
  origin = {0, 0, 0},
  headnode = 14,
  firstface = 0,
  numfaces = 14
}
(gdb) # Huh ...
(gdb) n
235 }
(gdb) n
ProcessWorldModel () at src/tools/ufo2map/bsp.c:50
50 }
(gdb) n
ProcessModels (filename=0xbffff6a8 "maps/africa/af_drop_herakles.bsp") at src/tools/ufo2map/bsp.c:116
116 if (!config.verboseentities)
(gdb) p curTile->models[255]
$16 = {
  mins = {0, 0, 0},
  maxs = {0, 0, 0},
  origin = {0, 0, 0},
  headnode = 14,
  firstface = 0,
  numfaces = 14
}
(gdb) n
117 config.verbose = qfalse; /* don't bother printing submodels */
(gdb) n
105 for (entity_num = 0; entity_num < num_entities; entity_num++) {
(gdb) p num_entities
$17 = 2
(gdb) p entity_num
$18 = 0
(gdb) n
106 if (!entities[entity_num].numbrushes)
(gdb) p entity_num
$19 = 1
(gdb) list
101 void ProcessModels (const char *filename)
102 {
103 BeginBSPFile();
104
105 for (entity_num = 0; entity_num < num_entities; entity_num++) {
106 if (!entities[entity_num].numbrushes)
107 continue;
108
109 Verb_Printf(VERB_EXTRA, "############### model %i ###############\n", curTile->nummodels);
110
(gdb) n
105 for (entity_num = 0; entity_num < num_entities; entity_num++) {
(gdb) n
120 EndBSPFile(filename);
(gdb) n
Writing maps/africa/af_drop_herakles.bsp
121 }
(gdb) p curTile->models[255]
$20 = {
  mins = {0, 0, 0},
  maxs = {0, 0, 0},
  origin = {0, 0, 0},
  headnode = 234881024,
  firstface = 0,
  numfaces = 234881024
}
(gdb) # Ahh
(gdb)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with build 23726
« Reply #7 on: March 28, 2009, 02:11:58 am »
Aha!

Code: [Select]
295 /**
296 * @brief Swaps the bsp file in place, so it should not be referenced again
297 * @sa LoadBSPFile
298 */
299 long WriteBSPFile (const char *filename)
300 {

This is the routine that does the byteswapping, and the data  is being referenced again afterwards.

Should a second swap be made after writing, so that the data is valid again?

A better question: What runs AFTER this that assumes that the data is swapped?

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with build 23726
« Reply #8 on: March 28, 2009, 05:10:36 am »
With a second byteswap, the code seems to compile maps.

I'm wondering if this will make the polygon faces look good.

Code: [Select]
Kleiman-ibook:trunk michael$ svn diff
Index: src/tools/ufo2map/common/bspfile.c
===================================================================
--- src/tools/ufo2map/common/bspfile.c (revision 23734)
+++ src/tools/ufo2map/common/bspfile.c (working copy)
@@ -294,6 +294,7 @@
 
 /**
  * @brief Swaps the bsp file in place, so it should not be referenced again
+ * @brief Changed -- Now ubswaps afterwards.
  * @sa LoadBSPFile
  */
 long WriteBSPFile (const char *filename)
@@ -337,6 +338,9 @@
  fseek(bspfile.f, 0L, SEEK_SET);
  FS_Write(&outheader, sizeof(outheader), &bspfile);
  FS_CloseFile(&bspfile);
+
+ SwapBSPFile();
+
  return size;
 }
 


Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Problem with build 23726
« Reply #9 on: March 28, 2009, 11:50:37 am »
readded the second byteswap to trunk (it was removed a few days ago with my first swap "fix") - thanks

please let us know whether it works. and please also have a look at the bug items you reported on the tracker. i've left some questions for you.

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with build 23726
« Reply #10 on: March 28, 2009, 07:33:55 pm »
Will do. Maps are still compiling (currently on shelter_room_e_b)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Problem with build 23726
« Reply #11 on: March 28, 2009, 08:05:47 pm »
you can also compile only one and test it ;)

./ufo2map -quant 6 maps/farm
is the fastest way - then you can start the farm map via the skirmish menu (not +farm, but farm)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with build 23768
« Reply #12 on: March 29, 2009, 05:49:33 pm »
readded the second byteswap to trunk (it was removed a few days ago with my first swap "fix") - thanks

please let us know whether it works. and please also have a look at the bug items you reported on the tracker. i've left some questions for you.

Went by today, and it was closed.

I'm running windowed, not full screen.

New: Using build 23768, I got this in the console.log:

Mar 29 08:08:00 Kleiman-ibook kernel[0]: ATIRadeon9700::wait_for_rb_space: Overflowed block waiting for FIFO space.   Have 2, need 8. RBBM_STATUS 0x84116100

Now, my hardware is ATIRadeon mobility 9550.

This happened before I could even choose single player or multiplayer.

Oh yea -- Locked the system up, sound went into a loop, mouse did not respond.

Trying again to see if it repeats (and hitting "post" first ...)

[attachment deleted by admin]
« Last Edit: March 29, 2009, 05:53:06 pm by keybounce »

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: Problem with build 23768 (03/29/09)
« Reply #13 on: March 29, 2009, 06:28:58 pm »
I could not get it to repeat.

However, I did get this gem:

Grid_MoveMark: (117 119 0) s:1 to (117 118 0)
Grid_MoveMark: Not stepping up into higher cell.
Grid_MoveMark: This move is not optimum. 15 16
Grid_MoveMark: (117 119 0) s:1 dir:4 c:1 ol:13
Grid_MoveMark: (117 119 0) s:1 to (118 120 0)
Grid_MoveMark: Not stepping up into higher cell.
Grid_MoveMark: This move is not optimum. 12 17
Grid_MoveMark: (117 119 0) s:1 dir:5 c:1 ol:13
Grid_MoveMark: (117 1
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x68657220
[Switching to process 290 thread 0x9f03]
0x70010a68 in AUGenericOutputEntry ()
(gdb) bt
#0  0x70010a68 in AUGenericOutputEntry ()
#1  0x70010c34 in AUGenericOutputEntry ()
#2  0x9453a600 in HP_IOProc::Call ()
#3  0x9453a28c in IOA_Device::CallIOProcs ()
#4  0x9453a140 in HP_IOThread::PerformIO ()
#5  0x94538b10 in HP_IOThread::WorkLoop ()
#6  0x945387d0 in HP_IOThread::ThreadEntry ()
#7  0x94526dc4 in CAPThread::Entry ()
#8  0x92ef6028 in _pthread_start ()
(gdb)

Somewhere, an invalid pointer hit something for ... the HP printer driver??? What?