| 06-11-2006, 12:19 AM | #1 |
Anyone remembers the misterious crash in vxha? I was bored to death today so I chose to look for the reason of the crash for the nth time. After 5 hours I actually decided to check the dmp files created by wc3 when it crashes, yep the memory dumps. When reading it , soemthing made me suspect that the function Contest_Call was guilty (something about the dmp file seemed to point out that) I looked at that function and this was there: JASS:function Contest_Call takes nothing returns nothing call TimerStart(CreateTimer(),GetRandomReal(0,60),false, function Contest_Start) if (GetExpiredTimer()!=null) then call TimerStart(GetExpiredTimer(),GetRandomReal(450,750),false,function Contest_Call) endif endfunction //=========================================================================== function InitTrig_ContestCentral takes nothing returns nothing call SetTableInt("[contests]","pool",CreatePool()) call SetTableInt("[contests]","last",0) // call AttachInt(null,"CONTEST_POOL",CreatePool()) // call AttachInt(null,"CONTEST_LAST",0) call TimerStart(CreateTimer(),GetRandomReal(450,750),false,function Contest_Call) endfunction It is what causes the contests to happen, you might notice the weird if statement. contest do happen without crashing so I thought it might be because the if statement, I made it because the function could be called by timer or by ExecuteFunc, but if called by ExecuteFunc it shouldn't restart the timer that should be null. Then in the dead trigger I found: JASS:
set udg_deads=udg_deads+1
if (ModuloInteger(udg_deads,(udg_NumPlayers*3))==0) then
call ExecuteFunc("Contest_Call")
endif
I confirmed that when the condition was true it crashed, any ideas why should this crash? |
| 06-11-2006, 09:32 AM | #2 |
Why was this thread closed? Have you tried debug messages? Perhaps GetExpiredTimer() simply doesn't return null, but an invalid handle, thus passign the if check, but failing on timer start. Perhaps you could make a different condition to confirm if there's an expiring timer, I was thinking about timer time remaining but since it's an expired timer, this would return 0 in any case. Alternatively, you could set a global boolean prior to executing the function, and check that instead of making a GetExpiredTimer comparison. |
| 06-11-2006, 12:52 PM | #3 |
Nope it is just the call to that function what causes the problem, and it only happens when a computer unit dies, I closed this thread because I had a more accurate analisys in the other thread |
