UFO: Alien Invasion Issue Tracker
UFO: Alien Invasion
Go to the previous open issue
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
icon_project.png UFO: Alien Invasion / Closed Bug report #3398 Cbuf_AddText overflow (endless loop?)
Go to the next issue (open or closed)
Go to the next open issue
This issue has been closed with status "Closed" and resolution "Not determined".
Issue basics
  • Type of issue
    Bug report
  • Category
    Battlescape
  • Targetted for
    Not determined
  • Status
    Closed
  • Priority
    1. Very low
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
  • Estimated time
    Not estimated
Issue details
  • Resolution
    Not determined
  • Reproducability
    Not determined
  • Severity
    Not determined
  • Complexity
    Not determined
  • Platform
    Not determined
  • Architecture
    Not determined
Attachments (0)
There is nothing attached to this issue
Duplicate issues (0)
This issue does not have any duplicates
Description
[http://sourceforge.net/p/ufoai/bugs/3398 Item 3398] imported from sourceforge.net tracker on 2013-01-28 20:08:16

torso wounds during the battlescape cause the hud_updateactorwounds to be called over and over(about 20000 times) when you rmb click on the soldiers name, using minimal hud.
bt as follows:

===== Comments Ported from Sourceforge =====

====== freakyd (2012-10-16 17:42:54.617000) ======

There's more crazyness inside the paperdoll when you are just bringing up the inventory. It seems like some extended gameplay will do it to you. It's not something specific with the wounds or inventory to trigger it, just keep playing battlescapes and it'll happen. Once it starts happening, you notice it takes a while for the paperdoll to pop up. Check out my ufoconsole.log, it's got data out the yin-yang.
====== aduke1 (2012-10-28 23:51:00.557000) ======

- **assigned_to**: NateWr

====== natewr (2012-11-04 20:50:48.860000) ======

- **assigned_to**: NateWr --> DarkRain

====== darkrainx (2012-11-08 18:55:15.312000) ======

- **summary**: torso wounds --> Cbuf_AddText overflow (endless loop?)
- Description has changed:

Diff:

~~~~

--- old
+++ new
@@ -1,47 +1,2 @@
torso wounds during the battlescape cause the hud_updateactorwounds to be called over and over(about 20000 times) when you rmb click on the soldiers name, using minimal hud.
bt as follows:
-#0 0x00000000004a3174 in _Mem_AllocatedInPool (pool=0x238bec8,
- pointer=0x7fffc9d61800) at src/common/mem.cpp:523
-#1 0x000000000044dc13 in UI_FreeStringProperty (pointer=0x7fffc9d61800)
- at src/client/ui/ui_actions.cpp:717
-#2 0x0000000000457709 in UI_NodeSetProperty (node=0x7fffc9cf4070,
- property=0x3fb5730,
- value=0x29f2680 "Wounded Torso (bleeding: 0)\n- Reduced reaction speed\n")
- at src/client/ui/ui_node.cpp:776
-#3 0x000000000044cfb9 in UI_NodeSetPropertyFromActionValue (
- node=0x7fffc9cf4070, property=0x3fb5730, context=0x7fffffffd410,
- value=0x1020dd8) at src/client/ui/ui_actions.cpp:364
-#4 0x000000000044d1bb in UI_ExecuteSetAction (action=0x1020d98,
- context=0x7fffffffd410) at src/client/ui/ui_actions.cpp:424
-#5 0x000000000044d7b0 in UI_ExecuteAction (action=0x1020d98,
- context=0x7fffffffd410) at src/client/ui/ui_actions.cpp:577
-#6 0x000000000044d995 in UI_ExecuteActions (firstAction=0x1020bb8,
- context=0x7fffffffd410) at src/client/ui/ui_actions.cpp:641
-#7 0x000000000044d486 in UI_ExecuteCallAction (action=0x7fffe59b4e70,
- context=0x7fffffffd520) at src/client/ui/ui_actions.cpp:485
-#8 0x000000000044d6c8 in UI_ExecuteAction (action=0x7fffe59b4e70,
- context=0x7fffffffd520) at src/client/ui/ui_actions.cpp:550
-#9 0x000000000044d995 in UI_ExecuteActions (firstAction=0x128a5fc0,
- context=0x7fffffffd520) at src/client/ui/ui_actions.cpp:641
----Type <return> to continue, or q <return> to quit---
-#10 0x000000000044da18 in UI_ExecuteConFuncActions (source=0x41554e8,
- firstAction=0x128a5fc0) at src/client/ui/ui_actions.cpp:655
-#11 0x000000000047e355 in UI_ConfuncCommand_f ()
- at src/client/ui/node/ui_node_special.cpp:73
-#12 0x00000000004898d5 in Cmd_ExecuteString (
- text=0x7fffffffd5d0 "actor_wounds humanoid_torso 0 \"Wounded Torso (bleeding: 0)\n- Reduced reaction speed\n\"") at src/common/cmd.cpp:951
-#13 0x0000000000454eba in UI_ExecuteConfunc (
- fmt=0x630161 "actor_wounds %s %i \"%s\"") at src/client/ui/ui_main.cpp:112
-#14 0x000000000043101b in HUD_ActorWoundData_f ()
- at src/client/battlescape/cl_hud.cpp:1327
-#15 0x00000000004898d5 in Cmd_ExecuteString (
- text=0x7fffffffda50 "hud_updateactorwounds") at src/common/cmd.cpp:951
-#16 0x0000000000488442 in Cbuf_Execute () at src/common/cmd.cpp:248
-#17 0x000000000041685e in CL_SendCommand () at src/client/cl_main.cpp:988
-#18 0x0000000000416b95 in CL_Frame (now=7765778, data=0x0)
- at src/client/cl_main.cpp:1125
-#19 0x0000000000498520 in tick_timer (now=7765778, data=0xfbddd90)
- at src/common/common.cpp:1285
-#20 0x0000000000498b26 in Qcommon_Frame () at src/common/common.cpp:1406
-#21 0x00000000005165c6 in main (argc=1, argv=0x7fffffffe0c8)
- at src/ports/linux/linux_main.cpp:55

~~~~


====== darkrainx (2012-11-08 20:38:37.179000) ======

Another log attached [here](http://ufoai.org/forum/index.php/topic,7075.0.html)
====== natewr (2012-11-09 00:00:43.618000) ======

A couple thoughts from my time working with the UI. I remember there were several aspects of the UI that were triggered constantly. One in particular I remember confused me forever was the reaction fire toggle. Rather than triggering it once when the button is clicked, the backend system was running the confunc on a nearly constant loop. I thought it was a problem with my UI but learned in the end that that was how the UI handled this thing. It didn&#039;t call the change when it was updated, but just sent a message to the front-end UI on every loop: ON ON ON ON ON ON ON ON ON ON ON ON ON. If you switched it off it would say OFF OFF OFF OFF OFF OFF OFF OFF OFF. And so on. Bayo may have fixed this. I don&#039;t remember.

I am wondering if maybe the same thing is happening in this case. Maybe the game is pinging that cvar (cl_selected) on loop, and that&#039;s what&#039;s causing this. Try removing this line in physdat.ufo::onWindowOpened():

cmd "ui_addcvarlistener cl_selected updateactorwounds;"

Try putting the updateactorwounds command into the button which opens physdat. If it doesn&#039;t print the text forever, then at least you&#039;ll know why it&#039;s looping. (Obviously, there are other ways to open the physdat window so this won&#039;t be a solution.)

Sorry I can&#039;t try it myself now. I haven&#039;t had much time lately.
====== darkrainx (2012-11-09 04:41:19.913000) ======

Well, if this is getting called constantly that would be a bug, (listener should only be called on change) but maybe not the one that&#039;s causing the command buffer to overflow:
a) Freakyd&#039;s log above shows it also happens with &#039;updateactorvalues&#039; which is indeed called constantly for every soldier (CL_SlowFrame -> HUD_Update -> HUD_UpdateAllActors) and as far as I can tell its been that way since the dawn of time, we would have seen something before if this was only because of repeated calls.
b) I&#039;ve never seen this myself, seems to happen only after long play sessions (and I usually don&#039;t have the time), maybe the command buffer isn&#039;t properly cleaned

So, I think I can avoid using cvar listeners for this, but unless said listeners are borking the command buffer somehow, we might yet see the problem with &#039;updateactorvalues&#039; again -- and if its indeed the listeners that are broken they should be fixed.
====== darkrainx (2012-11-09 21:24:18.980000) ======

Ok, I know why I wasn&#039;t able to reproduce it: it only happens in the campaign, so I will blame the incomplete cgame implementation for the time being, I removed the cvarlisteners that should stop the overflow for now.
====== darkrainx (2012-11-11 22:17:00.298000) ======

So, ui_removecvarlistener was buggy and wouldn&#039;t remove the listener when the window closed, and then ui_addcvarlistener would add a duplicate listener each time the window was opened, resulting in dozens of duplicate listeners that were called each time a new soldier was selected, bot issues should be fixed now.
====== darkrainx (2012-11-11 22:17:52.134000) ======

- **status**: open --> pending

====== darkrainx (2012-11-15 04:17:27.402000) ======

- **status**: pending --> closed
Steps to reproduce this issue
Nothing entered.
Todos (0 / 0)
Issue created
footer_logo.png The Bug Genie 4.3.1 | Support | Feedback spinning_16.gif