project-navigation
Personal tools

Author Topic: Re: campaign game fails to start in 24881 ** FOUND **  (Read 8358 times)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: campaign game fails to start in 24881 ** FOUND **
« on: June 15, 2009, 04:21:05 am »
The campaign game crashes.

Attempting to run the game normally gives a lockup -- apprently, too much output to Terminal.
Kleiman-ibook:trunk michael$ nice -n +20 ./ufo +set developer 1 > output.txt
0   ufo                                 0x0019f578 Sys_Backtrace + 36
1   ufo                                 0x00129050 Com_Error + 376
2   ufo                                 0x00062194 B_ParseBuildings + 1384
3   ufo                                 0x0007569c CL_GetComponentsByItem + 1136
4   ufo                                 0x00075a68 CL_ReadSinglePlayerData + 212
5   ufo                                 0x0001627c GAME_CP_InitStartup + 444
6   ufo                                 0x00013798 GAME_SetMode + 344
7   ufo                                 0x00013da8 GAME_SetMode + 1896
8   ufo                                 0x0011974c Cmd_ExecuteString + 268
9   ufo                                 0x00117c40 Cbuf_Execute + 452
10  ufo                                 0x00037ea4 CL_OnBattlescape + 160
11  ufo                                 0x000386d4 CL_Frame + 432
12  ufo                                 0x0012b224 Qcommon_Init + 2564
13  ufo                                 0x0012b648 Qcommon_Frame + 232
14  ufo                                 0x0019fa28 main + 356
15  ufo                                 0x000023f4 start + 68
16  ???                                 0x00000004 0x0 + 4
Kleiman-ibook:trunk michael$

Main menu opens, I select single player, I select campaign, there's a pause, and then the dump occurs. I'm then looking at a blank screen (the client), and nothing seems to work except exit.

G4.


[attachment deleted by admin]
« Last Edit: June 27, 2009, 05:25:18 am by keybounce »

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: campaign game fails to start in 24721
« Reply #1 on: June 15, 2009, 07:19:42 am »
the error is: ERROR: B_ParseBuildings: Could not find tech that provides building_aliencontainment2

are you sure that you have the latest trunk data, too?

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: campaign game fails to start in 24721
« Reply #2 on: June 16, 2009, 02:39:00 am »
I did a make clean and svn up before compiling.

If there's something that svn doesn't fetch by default, I don't know of it.

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
Re: campaign game fails to start in 24721
« Reply #3 on: June 16, 2009, 11:23:55 am »
don't you have old pk3 packages around?

-geever

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: campaign game fails to start in 24721
« Reply #4 on: June 16, 2009, 05:35:53 pm »
No old pk3's.

Still happening in 24731.

Time to blow away and fetch again, just in case ...

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: campaign game fails to start in 24721
« Reply #5 on: June 16, 2009, 10:01:14 pm »
Still happens in 24732, with a fresh download, and rerun of configure.

Is this mac specific, or does it need to be moved to 2.3-dev?

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: campaign game fails to start in 24761
« Reply #6 on: June 19, 2009, 03:43:33 am »
Still there in 24761.

Which file is supposed to be defining these buildings?

====== UFO Initialized ======

Switch grab input off
Change gametype to 'Campaign mode'

--- save subsystem initialization --
added base subsystem
added campaign subsystem
added hospital subsystem
added market subsystem
added research subsystem
added employee subsystem
added aliencont subsystem
added production subsystem
added aircraft subsystem
added messagesystem subsystem
added stats subsystem
added nations subsystem
added transfer subsystem
added alien base subsystem
added xvirate subsystem
added installation subsystem
added messageoptions subsystem
********************
ERROR: B_ParseBuildings: Could not find tech that provides building_aliencontainment2

********************
0   ufo                                 0x001a02ec Sys_Backtrace + 36
1   ufo                                 0x00129b00 Com_Error + 376
2   ufo                                 0x00062444 B_ParseBuildings + 1384
3   ufo                                 0x0007594c CL_GetComponentsByItem + 1136
4   ufo                                 0x00075d18 CL_ReadSinglePlayerData + 212
5   ufo                                 0x000165f8 GAME_CP_InitStartup + 444
6   ufo                                 0x00013b14 GAME_SetMode + 344
7   ufo                                 0x00014124 GAME_SetMode + 1896
8   ufo                                 0x0011a1fc Cmd_ExecuteString + 268
9   ufo                                 0x001186f0 Cbuf_Execute + 452
10  ufo                                 0x00038190 CL_OnBattlescape + 160
11  ufo                                 0x000389c0 CL_Frame + 432
12  ufo                                 0x0012bcd4 Qcommon_Init + 2564
13  ufo                                 0x0012c0f8 Qcommon_Frame + 232
14  ufo                                 0x001a079c main + 356
15  ufo                                 0x00002764 start + 68

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: campaign game fails to start in 24721
« Reply #7 on: June 21, 2009, 02:29:13 am »
Alright, let see what happens when I backtrack to an earlier version, to find out where this first appears.

Going back to 24430, which I uploaded a universal binary of.

The output is:
----------- parse scripts ----------
Shared Client/Server Info loaded
...112 items parsed
... 32 damage types parsed
... 68 map definitions parsed
... 29 equipment definitions parsed
... 10 inventory definitions parsed
... 22 team definitions parsed
music change to van_theme (from PsymongN3)
executing autoexec.cfg
"version" is "UFO: Alien Invasion 2.3-dev Unknown Jun 19 2009 MacOSX DEBUG"
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
127 static models loaded
====== UFO Initialized ======

Switch grab input off
Change gametype to 'Campaign mode'

--- save subsystem initialization --
added base subsystem
added campaign subsystem
added hospital subsystem
added market subsystem
added research subsystem
added employee subsystem
added aliencont subsystem
added production subsystem
added aircraft subsystem
added messagesystem subsystem
added stats subsystem
added nations subsystem
added transfer subsystem
added alien base subsystem
added xvirate subsystem
added installation subsystem
added messageoptions subsystem
********************
ERROR: B_ParseBuildings: Could not find tech that provides building_aliencontainment2

********************
Sanity check for script data
...... no mappart for building 'building_aliencontainment2' given
...... no mappart for building 'building_hangar2' given
...... no mappart for building 'building_large_ufo_hangar2' given
...... no mappart for building 'building_workshop2' given
...buildings failed
...tech ok
...aircraft ok
...items ok
...items ok
...nations ok
music change to karlmacklin_geoscape (from van_theme)
music change to karlmacklin_geoscape (from karlmacklin_geoscape)
Unknown command "mn_textupdated" - wasn't sent to server
music change to karlmacklin_geoscape (from karlmacklin_geoscape)
Base Template balanced not found
Shutdown gametype 'Campaign mode'
music change to van_theme (from karlmacklin_geoscape)
Wrote config.cfg.
Wrote keys.cfg
recursive shutdown
Kleiman-ibook:trunk michael$ svn info
Path: .
URL: https://ufoai.svn.sourceforge.net/svnroot/ufoai/ufoai/trunk
Repository Root: https://ufoai.svn.sourceforge.net/svnroot/ufoai
Repository UUID: 39b98707-f80d-0410-bc7e-c6b02f5409da
Revision: 24430
Node Kind: directory
Schedule: normal
Last Changed Author: tlh2000
Last Changed Rev: 24430
Last Changed Date: 2009-05-16 08:57:32 -0700 (Sat, 16 May 2009)

Kleiman-ibook:trunk michael$

The effect of running is:
1. The campaign game starts. The world map is messed up badly. I'm seeing things that look like something, but have no correlation with real world geography.
2. Creating a base creates just an entrance, nothing else. Even with the "create buildings" not changed (I believe it's checked.)
3. Attempting to add buildings results in only one possible building to add: the alien containment unit.

Going to the version that was uploaded:

Alright, the version that I uploaded shows the exact same issues and behaviors.
This is on a G4; apparently someone else was able to run it on an x86 mac.
See http://ufoai.ninex.info/forum/index.php?topic=3587.0

Will try an earlier version tomorrow.

Offline geever

  • Project Coder
  • PHALANX Commander
  • ***
  • Posts: 2561
    • View Profile
Re: campaign game fails to start in 24721
« Reply #8 on: June 21, 2009, 11:09:55 am »
2. Creating a base creates just an entrance, nothing else. Even with the "create buildings" not changed (I believe it's checked.)
3. Attempting to add buildings results in only one possible building to add: the alien containment unit.

2:
Code: [Select]
Base Template balanced not found

3: Must be due to that big error message upwards.

In fact there is no tech providing building_aliencontainment2, but it shouldn't be checked.
please put a breakpoint to cp_base.c:1669 (latest version), when it stops (campaign start) ask the values:
Code: [Select]
(gdb) p building->id
$1 = 0x18e61044 "building_aliencontainment2"
(gdb) p building->visible
$2 = qfalse

visible value for building_aliencontainment2 should be qfalse (0). Maybe an endian bug here?!

-geever

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: campaign game fails to start in 24721
« Reply #9 on: June 26, 2009, 08:11:05 pm »
Sorry, I just found this reply. Will get to this test this weekend, probably sunday.

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: campaign game fails to start in 24721
« Reply #10 on: June 27, 2009, 04:30:56 am »
I'm seeing qtrue, not qfalse.

Code: [Select]
R_LoadProgram: 'world' loaded.
R_LoadProgram: 'mesh' loaded.
R_LoadProgram: 'warp' loaded.
R_LoadProgram: 'world' loaded.
R_LoadProgram: 'mesh' loaded.
R_LoadProgram: 'warp' loaded.

------- input initialization -------
Reading symbols for shared libraries . done
0 possible joysticks
no joystick found.

----------- parse scripts ----------
Shared Client/Server Info loaded
...112 items parsed
... 32 damage types parsed
... 69 map definitions parsed
... 29 equipment definitions parsed
... 10 inventory definitions parsed
... 22 team definitions parsed
music change to van_theme (from PsymongN3)
executing autoexec.cfg
"version" is "UFO: Alien Invasion 2.3-dev Unknown Jun 26 2009 MacOSX DEBUG"
Reading symbols for shared libraries warning: Could not find object file "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_libvorbis/work/libvorbis-1.2.0/lib/.libs/vorbisfile.o" - no debug information available for "vorbisfile.c".

. done
R_RegisterModelShort: Could not find: 'weapons/autocannon/autocannon'
CL_LanguageInit: language settings are stored in configuration: none
...using language: C
SDL_ttf version 2.0.9 - we need at least 2.0.7
...registering 10 fonts
127 static models loaded
====== UFO Initialized ======

Switch grab input off
Reading symbols for shared libraries .. done
Reading symbols for shared libraries . done
Change gametype to 'Campaign mode'

--- save subsystem initialization --
added base subsystem
added campaign subsystem
added hospital subsystem
added market subsystem
added research subsystem
added employee subsystem
added aliencont subsystem
added production subsystem
added aircraft subsystem
added messagesystem subsystem
added stats subsystem
added nations subsystem
added transfer subsystem
added alien base subsystem
added xvirate subsystem
added installation subsystem
added messageoptions subsystem
********************
ERROR: B_ParseBuildings: Could not find tech that provides building_aliencontainment2

********************

Breakpoint 1, debug () at src/common/common.c:213
213 }
(gdb) bt
#0  debug () at src/common/common.c:213
#1  0x001299b0 in Com_Error (code=1, fmt=0x2157c0 "B_ParseBuildings: Could not find tech that provides %s\n") at src/common/common.c:242
#2  0x00061fb4 in B_ParseBuildings (name=0x25f2f70 "building_aliencontainment2", text=0xbffff060, link=qtrue) at src/client/campaign/cp_base.c:1670
#3  0x000754cc in CL_ParseScriptSecond (type=0x25f2fb0 "building", name=0x25f2f70 "building_aliencontainment2", text=0xbffff060) at src/client/campaign/cp_parse.c:671
#4  0x00075898 in CL_ReadSinglePlayerData () at src/client/campaign/cp_parse.c:779
#5  0x00015ecc in GAME_CP_InitStartup () at src/client/cl_game_campaign.c:426
#6  0x000133e8 in GAME_SetMode (gametype=5) at src/client/cl_game.c:118
#7  0x000139f8 in GAME_SetMode_f () at src/client/cl_game.c:245
#8  0x0011a0b4 in Cmd_ExecuteString (text=0xbffff234 "game_setmode") at src/common/cmd.c:912
#9  0x001185a8 in Cbuf_Execute () at src/common/cmd.c:229
#10 0x00037ab8 in CL_SendCommand () at src/client/cl_main.c:892
#11 0x000382e8 in CL_Frame (now=156429, data=0x0) at src/client/cl_main.c:1066
#12 0x0012bbac in tick_timer (now=156429, data=0x18505a6c) at src/common/common.c:1049
#13 0x0012bfd0 in Qcommon_Frame () at src/common/common.c:1130
#14 0x001a0660 in main (argc=1, argv=0xbffff8a4) at src/ports/macosx/osx_main.m:142
Current language:  auto; currently c
(gdb) up
#1  0x001299b0 in Com_Error (code=1, fmt=0x2157c0 "B_ParseBuildings: Could not find tech that provides %s\n") at src/common/common.c:242
242 debug();
(gdb) up
#2  0x00061fb4 in B_ParseBuildings (name=0x25f2f70 "building_aliencontainment2", text=0xbffff060, link=qtrue) at src/client/campaign/cp_base.c:1670
1670 Com_Error(ERR_DROP, "B_ParseBuildings: Could not find tech that provides %s\n", name);
(gdb) list
1665
1666 tech_link = RS_GetTechByProvided(name);
1667 if (tech_link)
1668 building->tech = tech_link;
1669 else if (building->visible)
1670 Com_Error(ERR_DROP, "B_ParseBuildings: Could not find tech that provides %s\n", name);
1671
1672 do {
1673 /* get the name type */
1674 token = Com_EParse(text, errhead, name);
(gdb) p building
$1 = (building_t *) 0x2c351f0
(gdb) p *building
$2 = {
  idx = -1,
  tpl = 0x2c351f0,
  base = 0x0,
  id = 0x1614f4cc "building_aliencontainment2",
  name = 0x1614f52c "Alien Containment Facility",
  image = 0x1614f58c "base/aliencont1",
  mapPart = 0x0,
  pedia = 0x1614f5cc "rs_building_aliencontainment",
  needs = 0x0,
  fixCosts = 0,
  varCosts = 0,
  level = 0,
  timeStart = 0,
  buildTime = 0,
  buildingStatus = B_STATUS_NOT_SET,
  visible = qtrue,
  used = 0,
  onConstruct = '\0' <repeats 63 times>,
  onAttack = '\0' <repeats 63 times>,
  onDestroy = '\0' <repeats 63 times>,
  maxCount = -1,
  pos = {0, 0},
  mandatory = qfalse,
  maxEmployees = 0,
  buildingType = MAX_BUILDING_TYPE,
  tech = 0x0,
  dependsBuilding = 0x0,
  capacity = 0
}
(gdb)

What else should I look for ?

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: campaign game fails to start in 24881 ** FOUND **
« Reply #11 on: June 27, 2009, 05:22:35 am »
Found it.

You are writing an int value to a byte pointer.
It doesn't work right.

Code: [Select]
(gdb) s
Com_EParseValueDebug (base=0x2c351f0, token=0x2746198 "false", type=V_BOOL, ofs=60, size=4, file=0x214608 "src/client/campaign/cp_base.c", line=1651) at src/common/scripts.c:539
539 const resultStatus_t result = Com_ParseValue(base, token, type, ofs, size, &writtenBytes);
(gdb) s
Com_ParseValue (base=0x2c351f0, token=0x2746198 "false", type=V_BOOL, ofs=60, size=4, writtenBytes=0xbfffef3c) at src/common/scripts.c:221
221 resultStatus_t status = RESULT_OK;
(gdb) # offset 60 ...
(gdb) n
222 b = (byte *) base + ofs;
(gdb)
223 *writtenBytes = 0;
(gdb) p *b
$46 = 0 '\0'
(gdb) p base
$47 = (void *) 0x2c351f0
(gdb) p building
No symbol "building" in current context.
(gdb) p (building_t *)base
$48 = (building_t *) 0x2c351f0
(gdb) p *$
$49 = {
  idx = -1,
  tpl = 0x2c351f0,
  base = 0x0,
  id = 0x18551f5c "building_aliencontainment2",
  name = 0x18551fbc "Alien Containment Facility",
  image = 0x1855214c "base/aliencont1",
  mapPart = 0x0,
  pedia = 0x1855201c "rs_building_aliencontainment",
  needs = 0x0,
  fixCosts = 0,
  varCosts = 0,
  level = 0,
  timeStart = 0,
  buildTime = 0,
  buildingStatus = B_STATUS_NOT_SET,
  visible = qtrue,
  used = 0,
  onConstruct = '\0' <repeats 63 times>,
  onAttack = '\0' <repeats 63 times>,
  onDestroy = '\0' <repeats 63 times>,
  maxCount = -1,
  pos = {0, 0},
  mandatory = qfalse,
  maxEmployees = 0,
  buildingType = MAX_BUILDING_TYPE,
  tech = 0x0,
  dependsBuilding = 0x0,
  capacity = 0
}
(gdb) p $->visible
$50 = qtrue
(gdb) p &$
$51 = (qboolean *) 0x2c3522c
(gdb) p b
$52 = (byte *) 0x2c3522c ""
(gdb) # correct location
(gdb) n
225 if (size) {
(gdb) p size
$53 = 4
(gdb) n
227 if (size > vt_sizes[type]) {
(gdb) p vt_sizes[type]
$54 = 4
(gdb) n
232 if (size < vt_sizes[type]) {
(gdb) n
238 switch (type) {
(gdb) p type
$55 = V_BOOL
(gdb) n
249 if (!strcmp(token, "true") || *token == '1')
(gdb) p token
$56 = 0x2746198 "false"
(gdb) n
251 else if (!strcmp(token, "false") || *token == '0')
(gdb) p b
$57 = (byte *) 0x2c3522c ""
(gdb) p *b
$58 = 0 '\0'
(gdb) p qtrue
$59 = qtrue
(gdb) p (int) qtrue
$60 = 1
(gdb) # wait ...
(gdb) p (building_t *)base
$61 = (building_t *) 0x2c351f0
(gdb) p $->visible
$62 = qtrue
(gdb) p (int) $->visible
Attempt to extract a component of a value that is not a structure pointer.
(gdb) p (int) $61->visible
$63 = 1
(gdb) p *b
$64 = 0 '\0'
(gdb) p $61->visible
$65 = qtrue
(gdb) p &$
$66 = (qboolean *) 0x2c3522c
(gdb) p b
$67 = (byte *) 0x2c3522c ""
(gdb) p *b
$68 = 0 '\0'
(gdb) p *(int *)b
$69 = 1
(gdb) n 
252 *b = qfalse;
(gdb) p *(int *)b
$70 = 1
(gdb) n
251 else if (!strcmp(token, "false") || *token == '0')
(gdb) p *(int *)b
$71 = 1
(gdb) # bingo.
(gdb)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: campaign game fails to start in 24881 ** FOUND **
« Reply #12 on: June 27, 2009, 05:27:31 am »
Interestingly, everything else in that section has (int *) on the writes. Only bools don't.

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: campaign game fails to start in 24881 ** FOUND **
« Reply #13 on: June 27, 2009, 06:26:50 am »
and changing that to use (int *)'s makes the campaign game start. Yeah.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: campaign game fails to start in 24881 ** FOUND **
« Reply #14 on: June 27, 2009, 08:12:41 am »
please submit a patch for this.