HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Bounty: Reproduce the "gamecache bugs"

07-24-2006, 08:52 PM#1
Vexorian
All right I am extending a +50 rep bounty for any person that can reproduce the gamecache bug (as some people claim it exist) It is important to get sure if it is really true that gamecache is unreliable.

The reports I have is that when there are many gamecache based spells going on gamecache stops storing balues correctly. I am currently trying to stress gamecache a lot using timers. But still I can't find the bug itself. I also have very little information of it.

If the bug exists it should be possible to reproduce it. If it was found on an spell then make a single player map with a lot of guys that have that spell . Set the spell's cooldown and mana cost to 0 and make triggers that order these guys to cast the spell periodically.
07-24-2006, 09:00 PM#2
Vexorian
This is what I did:
Collapse JASS:
function hhhK takes nothing returns nothing
 local string k=I2S(GetRandomInt(0,10000))
 local integer n=GetRandomInt(1,1000)

    call StoreInteger(udg_gamacache,k,"a",n)
    call StoreInteger(udg_gamacache,k,"ab",n-1)

    if((GetStoredInteger(udg_gamacache,k,"a")!=n)or (GetStoredInteger(udg_gamacache,k,"ab")!=n-1) ) then
        if( gg_unit_hpea_0001!=null) then
            call KillUnit(gg_unit_hpea_0001)
            set gg_unit_hpea_0001=null
            call BJDebugMsg("|cffff3333Ouch!|cffffff00 Holy cow gamecache bug

wanted : "+I2S(n)+" , "+I2S(n-1)+"
got    : "+I2S(GetStoredInteger(udg_gamacache,k,"a"))+" , "+I2S(GetStoredInteger(udg_gamacache,k,"ab")))
        endif
        call DestroyTimer(GetExpiredTimer())
    else
        call SetWidgetLife(gg_unit_hpea_0001,n)
    endif
endfunction

//===========================================================================

function Abadu takes nothing returns nothing
 local integer stress=125
    loop
        exitwhen stress==0
        call TimerStart(CreateTimer(),GetRandomReal(1.,2.),true,function hhhK)
        set stress=stress-1
    endloop


endfunction

function StartATimer takes nothing returns nothing
    call TimerStart(CreateTimer(),GetRandomReal(1.,2.),true,function hhhK)
endfunction

function InitTrig_Melee_Initialization takes nothing returns nothing
 local integer stress=125
    set gg_trg_Melee_Initialization = CreateTrigger(  )
    set udg_gamacache=InitGameCache("anakonda.w3g")
    set udg_bovar[0]=true
    loop
        exitwhen stress==0
call ExecuteFunc("Abadu")
set stress=stress-1
    endloop
        call TimerStart(CreateTimer(),GetRandomReal(1.,2.),true,function StartATimer)
endfunction


It is incredibly intensive and currently it seems easier to cause wc3 a heart attack than to have this bug
07-24-2006, 09:53 PM#3
iNfraNe
I found the same results, I've been unable to make gamecache bug, nomatter how intensive it was used.
07-24-2006, 10:24 PM#4
Freakazoid
So you want me to bug wc3 with game caches?
07-24-2006, 10:27 PM#5
Taur
Quote:
Originally Posted by Freakazoid
So you want me to bug wc3 with game caches?
No he wants you to prove that gamecache can sometimes be 'overloaded' and cause bugs where data will not be written properly.
07-24-2006, 11:23 PM#6
Freakazoid
Quote:
Originally Posted by Taur
No he wants you to prove that gamecache can sometimes be 'overloaded' and cause bugs where data will not be written properly.

It's simple, but this can happen if you are really stupid triggerer.

Ok, imaging we hace a "Dummy Caster", now we also have some Dummy Abilities, now every time we cast the Dummy Abilities, the dummy caster is created and stored as,... let's say, Caster[CasterI] = Caster(casterI + 1) (where the casterI is an integer), now we cast the abilities lots of times. So in the point where the casterI becomes 256+, it will stop storing, so we can't restore them. Uhm, this is a very stupid way to explain it, i'll try better tommorow.
07-24-2006, 11:29 PM#7
emjlr3
is there a reason you only test integers Vex?

maybe it doesnt have to do with the storing and getting of them, but possibly other variable types

just a thought
07-24-2006, 11:30 PM#8
Rising_Dusk
*Sigh*

I've tried my hardest, but my testmap could not break the game cache.
I don't know what causes the bugs in my map now, I've had everyone I know go over the code dozens of times, and nothing is wrong with it.

I just don't know anymore.
It APPEARS the game cache works...
But then I test my map and I cast 4 different spells simultaneously and it bugs out SOMETHING in the map that's utilizes handles every so often.
Just five minutes ago, it screwed up my hero revive system, something that's been working for months, just because it used handles and a timer.
I swear...

If anyone wants to see my testmap that failed to reproduce the cache error, it's attached.
I stored groups, units, integers, reals, all on timers.
For whatever it's worth..
Attached Files
File type: w3xHandleStressTest.w3x (21.1 KB)
07-25-2006, 03:20 AM#9
karukef
Understanding and fixing bugs is one of the most abstract skills programmers attain.

Having programmed in several languages for ten years, I can at least make one statement that most veteran programmers will agree to: 99% of the time when you are staring at the screen thinking "I am doing everything right!! This can't be a bug!", you are in fact not doing everything right and there is a bug. Programmers learn to deal with this over time, because the only way to fix the bugs is to face the fact that you made the bugs yourself. That is why some of the most experienced people here at wc3c are very sceptical to just accepting that "gamecache doesn't work".

The basic methods for resolving a bug goes like this: First you use tracing or debug messages to find out WHERE the bug happens. What is the earliest spot you can find where something isn't right? Then you look very closely at the code in that spot until you know 100% sure that it does what you expect it to do. Then, if you still have a bug, you MUST be able to reproduce that bug in isolation. For example, if someone decides that "Function X does not work because in line 3 the gamecache returns crap instead of a timer", then the conclusion is one out of 2: A) The gamecache had crap stored in it, or B) The function that reads a timer out of the gamecache is bugged. If you really think B is the case, then it shouldn't be impossible to reproduce this, right?

In War3, we may have an attitude problem. Because the engine does have quirks and bugs, it becomes very easy to just blame problems on War3 bugs. Of course, sometimes that is the case, but that shouldn't make us give up and find a workaround everytime something doesn't work.

Now, consider the GameCache. It consists of a few functions to store and read integers, strings, reals and so on. Has anyone been able to ever store a variable into it and then not read it out correctly? Unless someone can correct me here, I think we can all agree on at least one thing: The gamecache functions works.

What we need may be a collective effort in documenting what we have tested to work and what we have tested and found to NOT work. This could be accompanied by a list of things people 'claim' to not work, so that we can test those claims thoroughly and hopefully falsify them or at least discovering what exactly the bug does.

How about anyone makes a structured thread like this where we can gather our results into something managable?
07-25-2006, 08:41 AM#10
Captain Griffen
Anyone ever had problems OFFLINE? Because game cache is designed primarily for offline usage, so it is possible that Blizzard cut corners with it that left it slightly unsafe for online usages.
07-25-2006, 09:18 AM#11
The)TideHunter(
I had my problem offline, i'v never tested a map online, its just a F9 (testmap) with me always.
Im still trying to find the code i had that bugged, i have the updated version that works, if you want that?
07-25-2006, 09:54 AM#12
DioD
Collapse JASS:
set udg_data[Modulo(h2i(t),8192)]=h2i(GetDyingUnit())

Setting like this causing this bug, when data set ID bacame same for multiple data types this data cannot be gained from cache and any attemp will return null.
07-25-2006, 12:38 PM#13
Vexorian
but that's an array isn't it?

Quote:
Unless someone can correct me here, I think we can all agree on at least one thing: The gamecache functions works.
That's the issue here, at least 3 guys were saying that gamecache can fail in tough situations.
07-25-2006, 01:07 PM#14
BertTheJasser
I think DioD wanted to show us how the bug could be reproduced/explained, .. but I must say I do not understand.

EDIT: I came to the conclusion that my roblem was not GC, it is a still existing bug in my Projectile Sys. So Sorry for red allert.
07-25-2006, 01:11 PM#15
Vexorian
Quote:
But then I test my map and I cast 4 different spells simultaneously and it bugs out SOMETHING in the map that's utilizes handles every so often.
Just five minutes ago, it screwed up my hero revive system, something that's been working for months, just because it used handles and a timer.
I swear...
- I am not a bad person, I am not interested in stealing your map. Could you please please send the map to [email protected] (noticed that it publically appears in so much places that there is no point in hiding it)