project-navigation
Personal tools

Author Topic: r24294 does not initialize properly  (Read 3303 times)

Offline keybounce

  • Sergeant
  • *****
  • Posts: 330
    • View Profile
r24294 does not initialize properly
« on: April 30, 2009, 08:17:18 am »
I'm getting a error in Q_strncpyz about a NULL dest.

Hardware: iBook G4. Mac 10.5.6

Code: [Select]
...found item: 'armour_light_alien' (24)
...found item: 'armour_medium_alien' (25)
...found font f_verysmall_bold (0)
...found font f_verysmall (1)
...found font f_small_bold (2)
...found font f_small (3)
...found font f_normal_bold (4)
...found font f_normal (5)
...found font f_big (6)
...found font f_menu (7)
...found font f_menubig (8)
...found font f_menusmall (9)

Breakpoint 5, Sys_Error (error=0x1db210 "Q_strncpyz: NULL dest (%s, %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=0x1db210 "Q_strncpyz: NULL dest (%s, %i)") at src/ports/unix/unix_main.c:85
#1  0x00198d7c in Q_strncpyzDebug (dest=0x0, src=0x2675258 "ui/icon_pack1", destsize=64, file=0x1d0760 "src/common/scripts.c", line=357) at src/shared/shared.c:242
#2  0x0013d650 in Com_ParseValue (base=0x0, token=0x2675258 "ui/icon_pack1", type=V_STRING, ofs=0, size=0, writtenBytes=0xbffff61c) at src/common/scripts.c:357
#3  0x000e3c30 in MN_ParseProperty (object=0x2f3a044, property=0x1df670, objectName=0x2f3a044 "geoscape", text=0xbffff740, token=0xbffff694) at src/client/menu/m_parse.c:693
#4  0x000e5864 in MN_ParseIcon (name=0x2579018 "geoscape", text=0xbffff740) at src/client/menu/m_parse.c:1256
#5  0x000366b4 in CL_ParseClientData (type=0x2579058 "icon", name=0x2579018 "geoscape", text=0xbffff740) at src/client/cl_main.c:658
#6  0x001444d0 in Com_ParseScripts () at src/common/scripts.c:2582
#7  0x00126de0 in Qcommon_Init (argc=4, argv=0xbffff880) at src/common/common.c:942
#8  0x0019b340 in main (argc=4, argv=0xbffff880) at src/ports/macosx/osx_main.m:138
(gdb) up
#1  0x00198d7c in Q_strncpyzDebug (dest=0x0, src=0x2675258 "ui/icon_pack1", destsize=64, file=0x1d0760 "src/common/scripts.c", line=357) at src/shared/shared.c:242
242 Sys_Error("Q_strncpyz: NULL dest (%s, %i)", file, line);
(gdb) up
#2  0x0013d650 in Com_ParseValue (base=0x0, token=0x2675258 "ui/icon_pack1", type=V_STRING, ofs=0, size=0, writtenBytes=0xbffff61c) at src/common/scripts.c:357
357 Q_strncpyz((char *) b, token, MAX_VAR);
(gdb) up
#3  0x000e3c30 in MN_ParseProperty (object=0x2f3a044, property=0x1df670, objectName=0x2f3a044 "geoscape", text=0xbffff740, token=0xbffff694) at src/client/menu/m_parse.c:693
693 result = Com_ParseValue(mn.curadata, *token, property->type & V_BASETYPEMASK, 0, property->size, &bytes);
(gdb) p mn.curadata
$1 = (byte *) 0x0
(gdb) p mn
$2 = {
  sharedData = {{
      type = MN_SHARED_NONE,
      data = {
        text = 0x0,
        linkedListText = 0x0,
        option = 0x0,
        lineStrip = 0x0
      },
      versionId = 0
    } <repeats 58 times>},
  menuOptions = {{
      id = '\0' <repeats 63 times>,
      label = '\0' <repeats 31 times>,
      action = '\0' <repeats 63 times>,
      value = '\0' <repeats 63 times>,
      icon = 0x0,
      disabled = qfalse,
      hovered = qfalse,
      next = 0x0
    } <repeats 256 times>},
  numOptions = 0,
  menuNodes = {{
      name = '\0' <repeats 63 times>,
      behaviour = 0x0,
      super = 0x0,
      firstChild = 0x0,
      lastChild = 0x0,
      next = 0x0,
      parent = 0x0,
      root = 0x0,
      pos = {0, 0},
      size = {0, 0},
      padding = 0,
      num = 0,
      textalign = 0 '\0',
      invis = qfalse,
      disabled = qfalse,
      invalidated = qfalse,
      ghost = qfalse,
      text = 0x0,
      font = 0x0,
      tooltip = 0x0,
      key = 0x0,
      icon = 0x0,
      excludeRect = 0x0,
      excludeRectNum = 0,
      visibilityCondition = 0x0,
      image = 0x0,
      cvar = 0x0,
      state = qfalse,
      mousefx = 0,
      border = 0,
      bgcolor = {0, 0, 0, 0},
      bordercolor = {0, 0, 0, 0},
      timeOut = 0,
      lastTime = 0,
      color = {0, 0, 0, 0},
      selectedColor = {0, 0, 0, 0},
      onClick = 0x0,
      onRightClick = 0x0,
      onMiddleClick = 0x0,
      onWheel = 0x0,
      onMouseEnter = 0x0,
      onMouseLeave = 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
        },
        abstractscrollable = {
          cacheSize = {0, 0},
          viewPosX = 0,
          viewSizeX = 0,
          fullSizeX = 0,
          viewPosY = 0,
          viewSizeY = 0,
          fullSizeY = 0,
          onViewChange = 0x0
        },
        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
        },
        ekg = {
          scrollSpeed = 0,
          scaleCvarValue = 0
        },
        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,
          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,
          onInit = 0x0,
          onClose = 0x0,
          onTimeOut = 0x0,
          onLeave = 0x0
        }
      }
    } <repeats 8192 times>},
  numNodes = 0,
  menus = {0x0 <repeats 128 times>},
  numMenus = 0,
  adata = 0x0,
  curadata = 0x0,
  adataize = 0,
  menuStack = {0x0 <repeats 32 times>},
  menuStackPos = 0,
  menuActions = {{
      type = {
        op = 0 '\0',
        param1 = 0 '\0',
        param2 = 0 '\0'
      },
      data = 0x0,
      data2 = 0x0,
      next = 0x0,
      scriptValues = 0x0
    } <repeats 3269 times>, {
      type = {
        op = 22 '\026',
        param1 = 6 '\006',
        param2 = 144 '?'
      },
      data = 0x1606902c,
      data2 = 0x40000,
      next = 0x0,
      scriptValues = 0x0
    }, {
      type = {
        op = 0 '\0',
        param1 = 0 '\0',
        param2 = 0 '\0'
      },
      data = 0x0,
      data2 = 0x0,
      next = 0x0,
      scriptValues = 0x0
    } <repeats 4922 times>},
  numActions = 0,
  menuModels = {{
      id = 0x0,
      need = 0x0,
      anim = 0x0,
      parent = 0x0,
      tag = 0x0,
      skin = 0,
      model = 0x0,
      menuTransform = {{
          menuID = 0x0,
          menuPtr = 0x0,
          useScale = qfalse,
          useAngles = qfalse,
          useOrigin = qfalse,
          scale = {0, 0, 0},
          angles = {0, 0, 0},
          origin = {0, 0, 0}
        }, {
          menuID = 0x0,
          menuPtr = 0x0,
          useScale = qfalse,
          useAngles = qfalse,
          useOrigin = qfalse,
          scale = {0, 0, 0},
          angles = {0, 0, 0},
          origin = {0, 0, 0}
        }, {
          menuID = 0x0,
          menuPtr = 0x0,
          useScale = qfalse,
          useAngles = qfalse,
          useOrigin = qfalse,
          scale = {0, 0, 0},
          angles = {0, 0, 0},
          origin = {0, 0, 0}
        }, {
          menuID = 0x0,
          menuPtr = 0x0,
          useScale = qfalse,
          useAngles = qfalse,
          useOrigin = qfalse,
          scale = {0, 0, 0},
          angles = {0, 0, 0},
          origin = {0, 0, 0}
        }, {
          menuID = 0x0,
          menuPtr = 0x0,
          useScale = qfalse,
          useAngles = qfalse,
          useOrigin = qfalse,
          scale = {0, 0, 0},
          angles = {0, 0, 0},
          origin = {0, 0, 0}
        }, {
          menuID = 0x0,
          menuPtr = 0x0,
          useScale = qfalse,
          useAngles = qfalse,
          useOrigin = qfalse,
          scale = {0, 0, 0},
          angles = {0, 0, 0},
          origin = {0, 0, 0}
        }, {
          menuID = 0x0,
          menuPtr = 0x0,
          useScale = qfalse,
          useAngles = qfalse,
          useOrigin = qfalse,
          scale = {0, 0, 0},
          angles = {0, 0, 0},
          origin = {0, 0, 0}
        }, {
          menuID = 0x0,
          menuPtr = 0x0,
          useScale = qfalse,
          useAngles = qfalse,
          useOrigin = qfalse,
          scale = {0, 0, 0},
          angles = {0, 0, 0},
          origin = {0, 0, 0}
        }},
      menuTransformCnt = 0,
      animState = {
        frame = 0,
        oldframe = 0,
        backlerp = 0,
        time = 0,
        dt = 0,
        mesh = 0,
        list = "\000\000\000\000\000\000\000",
        lcur = 0 '\0',
        ladd = 0 '\0',
        change = 0 '\0'
      },
      origin = {0, 0, 0},
      scale = {0, 0, 0},
      angles = {0, 0, 0},
      center = {0, 0, 0},
      color = {0, 0, 0, 0},
      next = 0x0
    } <repeats 128 times>},
  numMenuModels = 0,
  excludeRect = {{
      pos = {0, 0},
      size = {0, 0}
    } <repeats 64 times>},
  numExcludeRect = 0,
  menuConditions = {{
      type = {
        opCode = IF_EQ,
        left = IF_VALUE_STRING,
        right = IF_VALUE_STRING
      },
      leftValue = 0x0,
      rightValue = 0x0
    } <repeats 512 times>},
  numConditions = 0,
  menuIcons = {{
      name = '\0' <repeats 63 times>,
      image = 0x0,
      pos = {0, 0},
      size = {0, 0},
      single = qfalse
    } <repeats 64 times>},
  numIcons = 0
}
(gdb) list
688 if ((property->type & V_BASETYPEMASK) == V_STRING && strlen(*token) > MAX_VAR - 1) {
689 Com_Printf("MN_ParseProperty: Value '%s' is too long (key %s)\n", *token, property->string);
690 return qfalse;
691 }
692
693 result = Com_ParseValue(mn.curadata, *token, property->type & V_BASETYPEMASK, 0, property->size, &bytes);
694 if (result != RESULT_OK) {
695 Com_Printf("MN_ParseProperty: Invalid value for property '%s': %s\n", property->string, Com_GetLastParseError());
696 return qfalse;
697 }
(gdb) p property
$3 = (const value_t *) 0x1df670
(gdb) p *property
$4 = {
  string = 0x1a839c "image",
  type = 33290,
  ofs = 64,
  size = 0
}
(gdb) p object
$5 = (void *) 0x2f3a044
(gdb)

[attachment deleted by admin]

Offline bayo

  • Professional loser
  • Project Coder
  • Captain
  • ***
  • Posts: 733
    • View Profile
Re: r24294 does not initialize properly
« Reply #1 on: April 30, 2009, 12:39:05 pm »
Is MN_Init is called?

THats funny, we see again:
Code: [Select]
type = {
        op = 22 '\026',
        param1 = 6 '\006',
        param2 = 144 '?'
      },
      data = 0x1606902c,
      data2 = 0x40000,
But mn is clearly not initialized.
« Last Edit: April 30, 2009, 01:42:57 pm by bayo »