Author Topic: Buffer Overrun?  (Read 1630 times)

What's a buffer overrun? I keep getting an error, "Buffer overrun detected!", then the game closes. This only happens when I attempt to dump a scriptObject I'd made. Anybody know why this happens?

console just before crash:
Quote
==>exec("base/slayer/modules/map cycle.cs");
Executing base/Slayer/Modules/Map Cycle.cs.
==>Slayer.mapCycle.generateMissi onData();
==>Slayer.mapCycle.dump();
Member Fields:
  class = "MapCycleSO"
Tagged Fields:
  Enable = "1"
  missionData0 = "wakeisland\tWake Island\tWake Island"
  missionData1 = "Valhalla_Winter_Edition\tBoom\tValhalla Winter"
  missionData10 = "Spring_Canyon_Dark\tSpring Canyon Dark\tDogFight Canyon"
  missionData11 = "Spring_Canyon\tSpring_Canyon\tDogFight Canyon"
  missionData12 = "slopes\tThe Slopes\tSlopes"
  missionData13 = "slateSeaRevised\tSlate Sea Revised\tSlate"
  missionData14 = "Slate_Ocean\tSlate Ocean(For Strato\'s Boats)\tSlate"
  missionData15 = "slateDesert\tSlate Desert\tSlate"
  missionData16 = "Slate_Blue_Sea\tSlate Blue Sea\tSlate"
  missionData17 = "slate\tSlate\tSlate\t[ZAPT] Umm\t[ZAPT] Train Depot\t[ZAPT] Survival 1\t[ZAPT] Mountains\t[ZAPT] Dam\t[TW2] Trench Wars 4.1\t[TW2] Trench Wars 4.0\t[TW1] Trench Wars 3.1\t[TW1] Trench Wars 3.0\t[TW1] Trench Wars 2\t[TW1] Trench Wars 2.1\t[TDM] Warehouse\t[TDM] Lava Pit\t[TDM] Halo Sidewinder\t[TDM] Halo Icefields\t[TDM] Deadzone\t[TDM] Deadzone 4\t[TDM] Deadzone 4.1\t[TDM] Deadzone 3\t[TDM] Deadzone 2\t[TDM] Deadzone 1\t[TDM] Afghanistan DM- Dedicated TDM\t[Other] Themed Building Server\t[Other] The Bedroom\t[Other] TDM SPAWNS\t[Other] Badspot\'s Treasure Hunt\t[Other] Airport\t[L4B] Zombie Assault v2.0\t[L4B] Zombie Assault v2.0 (TEST)\t[L4B] Zombie Assault v1.0\t[L4B] No Mercy Subway v1.3\t[L4B] No Mercy Subway v1.2\t[L4B] No Mercy Subway v1.1\t[L4B] No Mercy Subway v1.0\t[L4B] L4D2 The Streets\t[L4B] L4D2 The Hotel\t[L4B] L4D2 The Hotel and Streets\t[L4B] L4D2 The Concert\t[DM] Deathmatch Dark\t[DM] Checkers DM\t[DM] Checkers DM v2.0\t[DM] Checkers DM - Dark Ambient\t[DM] Checkers DM - Dark Ambient v3\t[DM] Checkers DM - Dark Ambient v2\t[CTF] Capture the Flag Water\t[CTF] C.T.F. Battle Grounds\t[C\'er] Afganistan Creeper Arena\t[Box] Creeper, Checker DM\t[BoW] Cbrown towns\tTwo Ships\tSirrus Military Compound\tPyramid\tPYRAMID CREEPER\tMr.Block\'s Slides\tMaze\tIce Palace\tGolden Gate Bridge\tGazebo Garden\tFestung der Schwarzung\terhroiguhrieughlerg\tDemo Blockland Sign\tCrysta Castle\tC.T.F. Battle Grounds\tBuilding 6\tApartment\tAfghanistan DM 2\tAfghanistan DM"
  missionData18 = "Sage_Valley\tSage Valley\tSage Valley"
  missionData19 = "Roco_Island_Modified\tRoco Island - Modified\tRoco Island - Modified"
  missionData2 = "Valhalla_Night\tBoom\tValhalla"
  missionData20 = "Mountains of Excalibur\tMountains of Excalibur\tMountains of Excalibur"
  missionData21 = "valley\tLost Valley\tValley"
  missionData22 = "kitchenDark\tKitchen - Dark\tKitchen"
  missionData23 = "kitchen\tKitchen\tKitchen\t[Other] Castle\t[Other] Bunker\t[Other] Anthony\'s Airfield\tTown\tPirate World\tHorse Race\tHaunted House\tDemo Fort"
  missionData24 = "Island_Winter\tBoom\tIsland"
  missionData25 = "Island\tBoom\tIsland"
  missionData26 = "flatlands\tFlatlands\tFlatlands"
  missionData27 = "destruct\tDestruct\tSlate"
  missionData28 = "creek\tCreek\tCreek"
  missionData29 = "construct\tConstruct\tSlate"
  missionData3 = "Valhalla_dogfight_edition\tBoom\tValhalla DFE"
  missionData30 = "bedroomDark\tBedroom - Dark\tBedroom"
  missionData31 = "bedroom\tBedroom\tBedroom\t[Other] Extension Testing\t[L4B] Beta City 16 Commando Assault\t[L4B] ACM City Zombies [D]\tMansion\tKaje\'s Castle\tJetpuff\'s Towers\tFort Papa\tFacechild\'s House\tDM church\tDemo Pong\tDemo Midi Sequencer\tDemo House\tCottage\tBLOKO Blupo\tBeta City 16\tArch of Constantine\tACM City\tA.T.C. Fort"
  missionData32 = "Above\tAbove\tAbove\t[DM] Checkers v2.0"
  missionData4 = "Valhalla_Canvas\tValhalla Canvas\tValhalla Canvas"
  missionData5 = "Valhalla\tBoom\tValhalla"
  missionData6 = "tutorial\tTutorial\tTutorial"
  missionData7 = "tutorial\tTutorial\tTutorial"
  missionData8 = "spyglassfinal\tSpyglass\tSpyGlass\t[TDM] Giants"
  missionData9 = "SpringCanyonDark\tSpring Canyon Dark\tDogFight Canyon"
  notification = "The server is changing to a new map. The game will resume after the map is changed. Please wait..."
  numMaps = "0"
  numMissions = "33"

There is nothing after this, the console ends.

My guess is that it's because the bolded variable (missionData17) is EXTREMELY long. Is there a sort of limit on variable length?


So missionData17 is simply too large of a variable?

So missionData17 is simply too large of a variable?
No, that's not it, I can do echo(Slayer.mapCycle.missionData17); just fine, I only get problems when I dump Slayer.mapCycle.


Then again, I removed the missionData17 variable and everything worked fine.
« Last Edit: April 28, 2011, 07:35:23 PM by Greek2me »

I think torque has a character limit of something like 1024 for strings.
EDIT: nope
It could be on object fields though.
« Last Edit: April 28, 2011, 08:45:11 PM by Destiny/Zack0Wack0 »

A buffer overrun (and crash) happens when one of your echo'd lines is more than 4096 characters.
if you want to see the data, you will need to echo it to a file.

Make Slayer.mapCycle a ScriptObject.
Make every Slayer.mapCycle.missionData its own ScriptObject.
Make each field an element on an individual missionData.

Problem Sovled.

A buffer overrun (and crash) happens when one of your echo'd lines is more than 4096 characters.
if you want to see the data, you will need to echo it to a file.
Yep, 4096 is the character count of what it echoed before it crashed. Thanks, that explains a lot.


Warning - while you were typing...

Make Slayer.mapCycle a ScriptObject.
It already is a scriptObject, did you read anything?
Make every Slayer.mapCycle.missionData its own ScriptObject.
Make each field an element on an individual missionData.
Yep, that's what I ended up doing earlier.

Wow, thank you for nitpicking my post to try and insult me and end up using my idea anyways, you jerk.

Wow, thank you for nitpicking my post to try and insult me and end up using my idea anyways, you jerk.
What?

I asked if you'd read the OP, because I'd already stated that it was a SO there. Then I agreed that was a good way to do it and had done it that way.

Really, no offense intended in there, sorry if it came off that way.