project-navigation
Personal tools

Author Topic: byteswap in 24147?  (Read 5855 times)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
byteswap in 24147?
« on: April 24, 2009, 03:30:50 am »
Here's the end of the console output:

CL_LanguageTryToSet: en_ZW.UTF-8 (en)
...could not set to language: en_ZW.UTF-8
...could not set to system language
CL_LanguageTryToSet: en_ZA.UTF-8 (en)
...could not set to language: en_ZA.UTF-8
...could not set to system language
CL_LanguageTryToSet: en_US.UTF-8 (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
Wrote keys.cfg
Error: Unknown condition for if statement: 1969827693
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: 24147
Node Kind: directory
Schedule: normal
Last Changed Author: tlh2000
Last Changed Rev: 24147
Last Changed Date: 2009-04-22 13:23:43 -0700 (Wed, 22 Apr 2009)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: byteswap in 24147?
« Reply #1 on: April 24, 2009, 05:27:58 pm »
i don't think this is a byteswap issue - maybe uninitialized memory usage...?

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: byteswap in 24147?
« Reply #2 on: April 25, 2009, 04:15:34 am »
Any ideas/thoughts on where to start looking / debugging?

I'm clueless as to where to begin, and it didn't force a dump when it detected the problem.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: byteswap in 24147?
« Reply #3 on: April 25, 2009, 09:03:57 am »
when exactly does this happen? right after the start? are you able to use some of the menus?

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: byteswap in 24147?
« Reply #4 on: April 25, 2009, 06:10:03 pm »
I never get to the menus.

This dies before any user input/mouse clicks.

It is either near the end of the loading bar, or just after the loading bar goes away. I'm not sure which. Let me try starting it again...

Right at the end of the loading bar, before the next screen loads.

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: byteswap in 24147?
« Reply #5 on: April 25, 2009, 10:17:08 pm »
Hello. I fix something near condition slots, but i dont think it fix your problem.

The first condition check is into base/ufos/ui/main.ufo
Code: [Select]
if "*cvar:cl_showTipOfTheDay == 1" {
then, you can add a break point in MN_CheckConditionand you should have:

condition->type == {IF_EQ, IF_VALUE_CVARNAME, IF_VALUE_FLOAT}
condition->leftValue == "cl_showTipOfTheDay"
*(float*) condition->rightValue == 1.0f


you also can test the condition adress. If you delete all files base/ufos/ui/*.ufo else base/ufos/ui/main.ufo

condition == &mn.menuConditions[0]


any info can be very helpful.

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: byteswap in 24147?
« Reply #6 on: April 26, 2009, 11:48:27 pm »
Alright, I have some information.

The triggering call is:

144   qboolean MN_CheckVisibility (menuNode_t *node)
145   {
146      if (!node->visibilityCondition)
147         return qtrue;
148      return MN_CheckCondition(node, node->visibilityCondition);
149   }

node->visibiloityCondition seems to be all wrong:

(gdb) p condition
$3 = (menuCondition_t *) 0x1605d603
(gdb) p *$
$4 = {
  type = {
    opCode = 1969827693,
    left = 1634299487,
    right = 1650917418
  },
  leftValue = 0x63766172 <Address 0x63766172 out of bounds>,
  rightValue = 0x20766572 ""
}
(gdb) #!Woot!

The full backtrace, and the full node dump:


Breakpoint 1, Sys_Error (error=0x1c3ba0 "Unknown condition for if statement: %i") at src/ports/unix/unix_main.c:85
85      fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) & ~FNDELAY);
(gdb) bt
#0  Sys_Error (error=0x1c3ba0 "Unknown condition for if statement: %i") at src/ports/unix/unix_main.c:85
#1  0x000d8d70 in MN_CheckCondition (source=0x2c7a17c, condition=0x1605d603) at src/client/menu/m_condition.c:165
#2  0x000e07d4 in MN_CheckVisibility (node=0x2c7a17c) at src/client/menu/m_nodes.c:148
#3  0x000e0f70 in MN_GetNodeInTreeAtPosition (node=0x2c7a17c, rx=8, ry=130) at src/client/menu/m_nodes.c:322
#4  0x000e10e4 in MN_GetNodeInTreeAtPosition (node=0x2c79fdc, rx=8, ry=130) at src/client/menu/m_nodes.c:337
#5  0x000e13b8 in MN_GetNodeAtPosition (x=8, y=130) at src/client/menu/m_nodes.c:376
#6  0x000dd144 in MN_MouseMove (x=8, y=130) at src/client/menu/m_input.c:349
#7  0x000dd068 in MN_CheckMouseMove () at src/client/menu/m_input.c:327
#8  0x000db830 in MN_Draw () at src/client/menu/m_draw.c:278
#9  0x00043e60 in SCR_UpdateScreen () at src/client/cl_screen.c:495
#10 0x00037f38 in CL_Frame (now=68383, data=0x0) at src/client/cl_main.c:1065
#11 0x00125cb8 in tick_timer (now=68383, data=0x181065ac) at src/common/common.c:1039
#12 0x001260dc in Qcommon_Frame () at src/common/common.c:1120
#13 0x00199650 in main (argc=4, argv=0xbffff880) at src/ports/macosx/osx_main.m:142
Current language:  auto; currently c
(gdb) up
#1  0x000d8d70 in MN_CheckCondition (source=0x2c7a17c, condition=0x1605d603) at src/client/menu/m_condition.c:165
165      Sys_Error("Unknown condition for if statement: %i", condition->type.opCode);
(gdb) p source
$1 = (const menuNode_t *) 0x2c7a17c
(gdb) p *$
$2 = {
  name = "background", '\0' <repeats 53 times>,
  behaviour = 0x130abac,
  super = 0x0,
  firstChild = 0x0,
  lastChild = 0x0,
  next = 0x2c7a31c,
  parent = 0x2c79fdc,
  root = 0x2c79fdc,
  pos = {0, 0},
  size = {1024, 768},
  padding = 0,
  num = 0,
  textalign = 0 '\0',
  invis = qfalse,
  blend = qfalse,
  disabled = qfalse,
  invalidated = qfalse,
  ghost = qfalse,
  text = 0x0,
  font = 0x0,
  tooltip = 0x0,
  key = 0x0,
  icon = 0x0,
  excludeRect = 0x0,
  excludeRectNum = 0,
  visibilityCondition = 0x1605d603,
  image = 0x0,
  cvar = 0x0,
  state = qfalse,
  mousefx = 0,
  border = 0,
  bgcolor = {0, 0, 0, 0},
  bordercolor = {0, 0, 0, 0},
  timeOut = 0,
  timePushed = 0,
  color = {0, 0, 0, 0},
  selectedColor = {0, 0, 0, 0},
  onClick = 0x0,
  onRightClick = 0x0,
  onMiddleClick = 0x0,
  onWheel = 0x0,
  onMouseIn = 0x0,
  onMouseOut = 0x0,
  onWheelUp = 0x0,
  onWheelDown = 0x0,
  onChange = 0x0,
  extraData1 = 0,
  texh = {0, 0},
  texl = {0, 0},
  preventRatio = qfalse,
  longlines = 0 '\0',
  repeat = qfalse,
  clickDelay = 0,
  u = {
    abstractvalue = {
      min = 0x0,
      max = 0x0,
      value = 0x0,
      delta = 0x0,
      lastdiff = 0
    },
    abstractscrollbar = {
      pos = 0,
      viewsize = 0,
      fullsize = 0,
      lastdiff = 0,
      hideWhenUnused = qfalse
    },
    base = {
      baseid = 0
    },
    container = {
      container = 0x0,
      lastSelectedId = 0,
      onSelect = 0x0,
      filterEquipType = 0,
      columns = 0,
      displayWeapon = qfalse,
      displayAmmo = qfalse,
      displayUnavailableItem = qfalse,
      displayAmmoOfWeapon = qfalse,
      displayUnavailableAmmoOfWeapon = qfalse,
      displayAvailableOnTop = qfalse,
      scrollCur = 0,
      scrollNum = 0,
      scrollTotalNum = 0,
      onViewChange = 0x0
    },
    linechart = {
      dataId = 0,
      displayAxes = qfalse,
      axesColor = {0, 0, 0, 0}
    },
    model = {
      oldRefValue = 0x0,
      angles = {0, 0, 0},
      origin = {0, 0, 0},
      scale = {0, 0, 0},
      skin = 0x0,
      model = 0x0,
      tag = 0x0,
      animationState = 0x0,
      animation = 0x0,
      viewName = 0x0,
      next = 0x0,
      autoscale = qfalse,
      rotateWithMouse = qfalse,
      clipOverflow = qfalse
    },
    option = {
      dataId = 0,
      versionId = 0,
      first = 0x0,
      selected = 0x0,
      hovered = 0x0,
      count = 0,
      pos = 0,
      onViewChange = 0x0
    },
    textentry = {
      isPassword = qfalse,
      clickOutAbort = qfalse,
      onAbort = 0x0
    },
    text = {
      scrollbar = qfalse,
      textScroll = 0,
      textLines = 0,
      textLineSelected = 0,
      lineUnderMouse = 0,
      num = 0,
      rows = 0,
      onLinesChange = 0x0,
      lineHeight = 0,
      tabWidth = 0
    },
    window = {
      eventTime = 0,
      noticePos = {0, 0},
      dragButton = qfalse,
      closeButton = qfalse,
      preventTypingEscape = qfalse,
      modal = qfalse,
      dropdown = qfalse,
      isFullScreen = qfalse,
      fill = qfalse,
      starLayout = qfalse,
      parent = 0x0,
      renderNode = 0x0,
      eventNode = 0x0,
      onInit = 0x0,
      onClose = 0x0,
      onTimeOut = 0x0,
      onLeave = 0x0
    }
  }
}

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: byteswap in 24147?
« Reply #7 on: April 27, 2009, 12:40:37 am »
Thats strange
Code: [Select]
visibilityCondition = 0x1605d603,
  image = 0x0,

Maybe its a pic node, it should have an image, but not a visibility condition. Then maybe the setter dont aim very well and this condition is a char*, can you check the content of (char*)node->visibilityCondition ?

Can you add a break point into MN_RegisterAbstractNode and check the "properties" structure.

Then can you check offsets from a node (you can add a break point into MN_CheckVisibility), anddisplay adress of &node, &node->image, &node->visibiloityCondition.

Then if every thing is ok here, i need you again to check the parser.
« Last Edit: April 27, 2009, 01:00:36 am by bayo »

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: byteswap in 24147?
« Reply #8 on: April 30, 2009, 08:35:56 am »
The good news: Switching back by
svn up -r 24147

resulted in a compile that gave me a completely different failure -- the same failure that I was seeing on the latest build version.

Next is a make clean, and rebuild. I'm trying to figure out what it takes to make this "work" the way it did, and then maybe I'll know why the latest is having such horrible failure for me (won't even initialize), but seems to be working for others.

I'd hate to think that 2.2.1 will be the last PPC version of the game...

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: byteswap in 24147?
« Reply #9 on: April 30, 2009, 12:23:33 pm »
If every time you compile a new version the bug is not the same, it can be a stack problem. It not mean diff with new revision can show you the bug.
This kind or problem is very hard to find.

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
Re: byteswap in 24147?
« Reply #10 on: April 30, 2009, 07:55:38 pm »
A make clean, and a fresh make, with this revision results in this issue disappearing.

I will do make cleans from now on before trying to report issues.