• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Crash - can the error message help?

Status
Not open for further replies.
Level 14
Joined
Aug 30, 2004
Messages
909
I was literally doing one least play test through the four game modes of my game, and on the fourth mode it crashed.

I got an error that locked up my whole computer and said something about:

File CDataAllocator.cpp
Line: 152

I couldn't find any more information, and I'm not sure what this means.

All I can think of that cause these types of crashes are things like timers triggering an infinite loop, dividing by 0, or creating -1 units. My map is massive now, and it hasn't had crashes like this... ever. I haven't added very much new to the map at all, except this time I was playing with several people. One might have been afk and disconnected. I've added some "GetLocalPlayer" custom scripts to help with multiboards. Could that cause problems if a player disconnects? I should say we didn't see any lag or anything, and I don't think it's leaking for that reason.

I had a similar bug earlier when I had a repeat trigger going very very fast (possibly every 0.0 seconds). But this is a sudden and hard crash.

I don't imagine anyone can help with this, but it's rather soul crushing so I figured I'd try.
 
Level 14
Joined
Aug 30, 2004
Messages
909
So far I've managed to recreate the bug once by doing everything we did in the map and then having a player leave the game (by hard closing WC3 in the Task Manager). About a minute or two later it crashed.

I'm not sure if him leaving makes a difference at all, but I've heard other people say their map crashes when people leave. Is there some code that is associated with these crashes?


I'll try to use that Unreal Jass Spy if I can isolate the crash. I tried it again doing roughly the same things in my map but the crash didn't happen. I've removed some code with timers that I'm worried are involved, so maybe I've solved it. I'll keep trying.
 
Level 14
Joined
Aug 30, 2004
Messages
909
I'm still looking for a bug that seems to crash my map after about 20-25 minutes of play. The error message was given above, and it looked like my CPU performance spiked on my Task Manager when I clicked out, but I"m not sure how that works frankly so I wouldn't make much of it.

Here are some oddities:
- the music was still playing just fine even after the crash
- I could see the last screen of the game. Nothing looked wrong really.
- it was a multi-player game and we both crashed at the same time
- There was nothing going on in the game that hadn't been going on for 12 or more minutes, e.g. no new triggers should have been firing.

I considered that a unit might have been moved off the screen, which I know causes crashes. But the edges of my map have kill regions in them.

I'll take a look to be sure I never divide by zero, but does anyone else have any thoughts on what would crash a game like this?

My plan is to print an updater on my screen during playtests so I'll see what's happening when it crashes, but most of my triggers fire every .03 seconds... so it won't be easy to know.
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
division by zero shouldn't crash wc3, it's way too obvious error. infinite loops crashes it silently or with default fatal error message. your case belong to inner wc3 fault. It can be anything, including proper morph-based ability, which stops working randomly for no reason (I had that bug once and never again, it proved to be related with morph, which worked 200 times right before fatal)
 
Level 14
Joined
Aug 30, 2004
Messages
909
division by zero shouldn't crash wc3, it's way too obvious error. infinite loops crashes it silently or with default fatal error message. your case belong to inner wc3 fault. It can be anything, including proper morph-based ability, which stops working randomly for no reason (I had that bug once and never again, it proved to be related with morph, which worked 200 times right before fatal)

Draco, you're starting to scare me. I don't use the morph abilities (except adding and removing stone form ability so I can set unit height on ground units). How do I fix a bug if it's internal to WC3?

I was skeptical of your point about dividing by zero, but I made a test map and attempted to display 1/0...you were right, it just skipped that line and kept playing.
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
you can only change your approach but not fix the bug itself. but unless it's easily reproducable, you won't get the idea why and how it happens though, therefore - no chances. yes, its like doom. I had to roll back onto prev version once (backing ~300 changes) because of it
 
Level 14
Joined
Aug 30, 2004
Messages
909
I discovered that I can reliably get the bug if I start the game and just sit in my base and wait. Using a timer to tell how long it takes, I discovered the following times:

Trial 1: After 28.5 minutes the game crashed.
Trial 2: After 57.4 minutes the game crashed.
Trial 3 (on older version): After 32.88 minutes it crashes
Trial 4 (on even older version): After 51 minutes it crashes.

What's weird is that nothing new should be happening in the game after 12 minutes in. At twelve minutes I release some new kinds of ships...but they work more or less like all the others. There are literally no triggers firing at minute 28 that aren't firing at minute 12. No units that spawn at 57 minutes don't spawn at 12. And so on.

So it must be a very rare combination of events that are required. The gap in crash time seems to demonstrate that it's not a slow build up of errors either.

I'm going to try Trial 5 now, but this map is 2 weeks old (and I've been doing a lot of work). If this fails as well I think I might try putting text at the start of every trigger so I can isolate the last trigger to fire before it detonates. I'm not sure that will work though.

Thanks for commenting so far. It feels good not to be alone in these harrowing times!
 
Level 19
Joined
Dec 12, 2010
Messages
2,069
jass running in virtual machine. if it fails, you see Fatal errors regarding writing/reading incorrect memory. Meanwhile .cpp errors related directly to the game engine. Your code is fine. Something inside default things - abilities, units, whatever, - is wrong.
 
Level 14
Joined
Aug 30, 2004
Messages
909
Some Updates:

1. I noticed that some versions of the map would crash either when I attempted to save the game, or when I would load the game.

2. The versions that crash also appear to lag a bit when I end the game (before the crash). For example, if I let the game run for 20 minutes and it hasn't crashed, if I exit the game I get about a 2-4 second pause on a black screen before seeing the opening menu of WC3.

Finally, I discovered that my 2 week old backup does not crash! So I have an older version I know is fine. I then copied all my new triggers into this old map, and sure enough it crashed again. So I know that the triggers are somehow causing this crash.

I then went through my backups trying to isolate when the crashing bug first occurred. Sadly, it started right after the 2 week old version. So I know there was something that I did (or some internal error) that occurred between those versions that is interacting with my code and crashing the game.

I looked at the triggers and found several differences. One stuck out though: I inserted an action that ordered all computer controlled flying units to "stop." It fires every .03 seconds. I inserted this line because I use my own flight triggers, and the stupid computer kept trying to move the units which messed with their positioning.

When I deleted this action from the trigger in my newest version of the map (the one that crashed all the time), it stopped crashing! I let the game run for almost 3 hours with no crash. I saved it, and loaded it, and it didn't crash then either. It did however still pause on that black screen at the end of the game. There was no internal lag or change to the frames per second though, so I don't think it's a conventional leak.

Anyway, I have no idea why ordering units to stop a million times would cause the game to crash (maybe because they're paused units?) or even if that would happen on every map or just my own. Regardless, I think it's playable. I have it running at home now to see if it can survive a 7 hour test. If it can, I'll run another couple of playtests with friends and it should be ready for release!

Thanks everyone for your encouragement and help. + rep all around.

p.s. Draco, your program looks amazing but I'm afraid it's a bit beyond my abilities. I'm a bit of a noob with computers.

Meatmuffin, thanks as well. I considered a few variables that might be sky-rocketing but when I put them in to continuously print out they were fine.
 
Status
Not open for further replies.
Top