bugs

Forum > Bugs > uhm ... 16m energy?
Reply To Thread (login)
Mithrandon [63]
2011-07-05 07:30:12
[13 years, 174 days ago]

i think there's a bug around the energy ... don't know how that happened .. seriusly


 
Hobo [67]
2011-07-05 07:31:46
[13 years, 174 days ago]

you lucky fuck =) this happened during beta also. wish it happened to me


 
Mithrandon [63]
2011-07-05 07:34:54
[13 years, 174 days ago]

its not a good thing ... this could lead to a rollback


 
Number Two [59]
2011-07-05 07:37:01
[13 years, 174 days ago]

maybe it would be best to make your bot unattackable (if you can do that in bots 4) so that no one takes energy? I admit i tried but failed at it, strong bot :P


 
ThisIsSparta [31]
2011-07-05 07:39:35
[13 years, 174 days ago]

Nah in beta ender just editted it off iirc


 
Spawn [45]
2011-07-05 08:44:24
[13 years, 174 days ago]

Ender?


 
Ender [1]
Administrator
2011-07-05 10:49:03
[13 years, 174 days ago]

Whoops, an old bug that I forgot to fix:

http://bots4.net/forum/3/828

It happens when two different bots attack another bot with under 20 or so energy at the exact same moment. If the code gets interleaved in a certain way, the parts that check if the target bot has energy to take and the code that actually takes the energy get overlapped in both executions. When both executions then try to take the energy by decrementing an unsigned integer field, it causes an integer underflow and wraps the value around to the upper end, 2^24 ~ 16m in this case.

I'll fix it this time. :p


 
Mithrandon [64]
2011-07-05 11:17:50
[13 years, 174 days ago]

those methods handling the "who attacked who" should be serialized (in java term) then stuff like that wouldn't happen


 
Ender [1]
Administrator
2011-07-05 11:22:56
[13 years, 174 days ago]

This is fixed now.


 
Hobo [68]
2011-07-05 20:08:10
[13 years, 174 days ago]

so i cant attack my bot with two random ones at the exact same time to flip it out and give me 16 mill energy?


 
Ender [1]
Administrator
2011-07-05 20:08:31
[13 years, 174 days ago]

Not anymore.


 
Hobo [68]
2011-07-05 20:10:07
[13 years, 174 days ago]

aw man! you teach me a cool trick and then stop it from working ;p


 
exhale [57]
2011-07-05 21:13:03
[13 years, 174 days ago]

:P lol


 
SushiKing [52]
2011-07-05 21:20:47
[13 years, 174 days ago]

hahah hobo XP


 
Forum > Bugs > uhm ... 16m energy?
Reply To Thread (login)