Blue screen of death? what the? [solved]

Recommended Posts

Yikes! I'm working on a bit of code, and when running my code with certain values (number of quads to draw) at some value, I get a blue screen of death (windows "stop"). It starts dumping my memory and tells me to reboot. Heres the code:
bool cTerrain::Mark(int x, int y, int size)
{
TerrainVertex *Vertices;
Vertices = new TerrainVertex[6 * size * size];
TerrainVertex *TmpBuffer = Vertices;
for (short i = 0; i < size; i++)
for (short j = 0; j < size; j++)
{
TmpBuffer[0] = m_TData.CreateQuad(x + i, y + j, 0, 0);
TmpBuffer[1] = m_TData.CreateQuad(x + i, y + j, 0, 1);
TmpBuffer[2] = m_TData.CreateQuad(x + i, y + j, 1, 0);
TmpBuffer[3] = m_TData.CreateQuad(x + i, y + j, 0, 1);
TmpBuffer[4] = m_TData.CreateQuad(x + i, y + j, 1, 1);
TmpBuffer[5] = m_TData.CreateQuad(x + i, y + j, 1, 0);
TmpBuffer += 6;
};
m_Device->SetTexture(0, 0);
m_Device->SetRenderState(D3DRS_ZFUNC, D3DCMP_GREATEREQUAL);
float bias = 0.6f;
//m_Device->SetRenderState(D3DRS_DEPTHBIAS, *(DWORD*)&bias);
m_Device->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, *(DWORD*)&bias);
m_Device->DrawPrimitiveUP(D3DPT_TRIANGLELIST, size * size * 2, Vertices, sizeof(TerrainVertex));
bias = 0.0f;
//m_Device->SetRenderState(D3DRS_DEPTHBIAS, *(DWORD*)&bias);
m_Device->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, *(DWORD*)&bias);
m_Device->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESS);
return false;
}


What I'm doing is just basic decalling, nothing special. As long as size is 1 or 2, nothing bad happens and everything is nice and dandy. I wanted to see how a 16x16 decal would look, so I pushed size up to 16, and got the screen of death. I thought it might have something to do with using too much memory (I had heroes 4 open), so after rebooting, I recompiled and tried again - same thing happened. I've turned it back down to 2, and all is well, but I don't even know where to start with this. What could even be causing this? I thought I might try increasing the size until I hit where it fails, but I don't see how that would do any good. Any ideas? btw, Windows XP, though I doubt it matters :). [Edited by - sirob on October 22, 2005 1:30:34 PM]

Share on other sites
What was the death message? The stop number and message?

Share on other sites
Thank god for the event viewer, wouldn't want to do that again :).

The stop was 0x0000008E.

Heres some info I found on the web:
Quote:
 0x0000008E: KERNEL_MODE_EXCEPTION_NOT_HANDLED(Click to consult the online MSDN article.)A kernel mode program generated an exception which the error handler didn’t catch. These are nearly always hardware compatibility issues (which sometimes means a driver issue or a need for a BIOS upgrade). “STOP 0x0000008e” Error Message During Windows XP Setup {KB 315335} Win XP Games: “Stop” Error Message That References Nv4_disp.dll {KB 325730} Flight Simulator, other games (wth Nvidia-based video adapter) Your Computer Stops Responding When You Use the Highlighter Feature & the Font Color Feature {KB 829578} Win XP

I'm reading the thing about Nv4_disp.dll, as I have an NVidia card.
 *sigh* That article isn't there anymore. I'm looking for cached versions of it :(. Also, thanks for your help :).

Share on other sites
Quote:
 Blue Screen Error "STOP: 0x0000008E"Page 1 of 1 (solution id: 1662) The key in finding the failure behind this problem depends on what other information Windows gives you. Here are some related search results on the Microsoft support site for this error.Typically this seems to be one of two problems. The first is a memory issue, and Microsoft says it can be fixed by making sure you have the latest updates.It also references NVidia drivers being corrupted. If you have an Nvidia card, it's possible that this error is caused by bad drivers. Make sure you completely unisntall the old drivers and reinstall the new drivers (simply reinstalling might not fix the problem).If you have problems still, you'll need to contact either Nvidia or Microsoft for further assistance.

Blizzard.com - World of Warcraft

Share on other sites
Here's a little more in-depth data, compliments of WinDbg:

Quote:

Share on other sites
I'll update my drivers, and write back my results.

Thanks for the help :).

Share on other sites
Well, I'm back with no good news.

After installing new drivers (*begin rant* and removing my motherboard drivers in the proccess - which include my network adapter drivers - forcing me to move them from a different machine on a USB drive 'cause the CD drive just had to jam up now *end rant*).

Those were 60 minutes I won't be getting back :).

Anyhow, I tried it again with the new drivers, but no potato.

I did however manage to get rid of the blue screen simply by deleteing the memory I was allocating (simple, eh? :)).

I'm still getting wild colors if the size is over 4, but now at least I can debug without rebooting every single time.

Anyhow, thanks for the help, everyone!

Share on other sites
Yay!

Thanks to everyone for helping out!

Turns out DrawPrimitiveUP was causing some problems. I'm not sure why, but once I switched to using a VB everything worked out just right. Weird, but it works :).

Share on other sites
If it's a kernel mode thing it can only be your drivers being dumb (i.e. it's not your fault).

Share on other sites
Quote:
 Original post by furby100If it's a kernel mode thing it can only be your drivers being dumb (i.e. it's not your fault).

I don't think so. Provide a gfx driver with invalid data (e.g. a bad pointer or invalid data) and it might choke on it. Kernel mode errors are most likely to be caused by damaged hardware, but that doesn't rule out (user mode-) software errors completely.

Share on other sites
I've never had a windows stop running any commercial or indie game yet. Also, fixing a memory leak solved the stop, so I'm guessing it is my fault.

I'm still unsure why DPUP fails with more than 50 primitives, though I've had problems with it before. I really don't like it that much.

Anyhow, I'm happy with it as it is. :)

Share on other sites
have you tried running with the d3d debug runtime, and "break on error"?
it usually catches problems before they cause a bsod.

(it's _almost_ always a misuse of the api)

edit: actually, looking at your code i can see one problem: you're never freeing the memory you're allocating.

Share on other sites
It's one of two things:

1) there's a bug in one of the drivers for your system, most likely graphics or AGP drivers (or, possibly but not likely, a low-level DirectX runtime bug)

2) you have marginal hardware, where your RAM is going old, or your bus is noisy, or something like that.

Running a RAM and bus tester like SiSoftware's Sandra ought to show you if it's #2. If that runs fine, then it's likely #1 (although Sandra can't find things like marginal AGP bus signal quality)

Share on other sites
Quote:
 Original post by reptedit: actually, looking at your code i can see one problem: you're never freeing the memory you're allocating.

Sorry to be rude, but been there, done that:
Quote:
 Also, fixing a memory leak solved the stop, so I'm guessing it is my fault.

Quote:
 Original post by hplus0603It's one of two things:1) there's a bug in one of the drivers for your system, most likely graphics or AGP drivers (or, possibly but not likely, a low-level DirectX runtime bug)2) you have marginal hardware, where your RAM is going old, or your bus is noisy, or something like that.Running a RAM and bus tester like SiSoftware's Sandra ought to show you if it's #2. If that runs fine, then it's likely #1 (although Sandra can't find things like marginal AGP bus signal quality)

Yah, like I said, since it was a memory leak that caused the stop directly (more or less), I don't see it being a problem. If I encounter something like this again, I'll look into the stuff you suggest.

Thanks all, but as far as I'm concerned, this issue is done, isn't it? (I'm adding solved to the title, maybe that'll finally kill it!).

Create an account

Register a new account

• Forum Statistics

• Total Topics
628375
• Total Posts
2982310

• 10
• 9
• 14
• 24
• 11