Author Topic: Unhandled errors  (Read 1996 times)

Offline Sulue

  • Newbie
  • *
  • Posts: 3
Unhandled errors
« on: April 05, 2010, 09:33:01 pm »
 
I've ran out of idea. Any help would be appreciated, thanks


4/3/2010 8:23:46 PM (3.0.8.8)
-----------------------------------Application_ThreadException-----------------------------------System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at SlimDX.Direct3D9.Font.DrawString(Sprite sprite, String text, Rectangle rectangle, DrawTextFormat format, Int32 color)
   at AIWar.Direct3DRenderer.DrawText(String Text, Int32 X, Int32 Y, Int32 Width, Int32 Height, Int32 C, FontType Type, Boolean UseViewportOffset) in C:\vcprojs\AIWar\Framework\Direct3DRenderer.cs:line 467
   at AIWar.Direct3DRenderer.DrawTextBordered(String Text, Int32 X, Int32 Y, Int32 Width, Int32 Height, Int32 C, Int32 BorderColor, FontType Type, Boolean UseViewportOffset) in C:\vcprojs\AIWar\Framework\Direct3DRenderer.cs:line 423
   at AIWar.ForegroundObject.RenderHealth(Direct3DRenderer R, Boolean IsForHealthBarsOnly) in C:\vcprojs\AIWar\Framework\ForegroundObject.cs:line 14144
   at AIWar.GameForm.DrawDirect3D() in C:\vcprojs\AIWar\GameFormParts\GamePanel.cs:line 1341
   at AIWar.GameForm.RunNextCycle(Boolean DoRendering, Boolean DoScrollingAndInput) in C:\vcprojs\AIWar\GameFormParts\GameLoop.cs:line 1855
   at AIWar.GameForm.gameLoop() in C:\vcprojs\AIWar\GameFormParts\GameLoop.cs:line 294
   at AIWar.GameForm.GameForm_Load(Object sender, EventArgs e) in C:\vcprojs\AIWar\GameFormParts\Startup.cs:line 276
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
4/5/2010 7:52:08 PM (3.0.8.8)
-----------------------------------CurrentDomain_UnhandledException-----------------------------------System.OverflowException: Arithmetic operation resulted in an overflow.
   at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow)
   at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
   at System.Windows.Forms.Control.set_Visible(Boolean value)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at AIWar.Program.Main() in C:\vcprojs\AIWar\Program.cs:line 20
4/5/2010 7:58:32 PM (3.0.8.8)
-----------------------------------Application_ThreadException-----------------------------------System.OverflowException: Arithmetic operation resulted in an overflow.
   at SlimDX.Direct3D9.Font.DrawString(Sprite sprite, String text, Rectangle rectangle, DrawTextFormat format, Int32 color)
   at AIWar.Direct3DRenderer.DrawText(String Text, Int32 X, Int32 Y, Int32 Width, Int32 Height, Int32 C, FontType Type, Boolean UseViewportOffset) in C:\vcprojs\AIWar\Framework\Direct3DRenderer.cs:line 467
   at AIWar.Direct3DRenderer.DrawTextBordered(String Text, Int32 X, Int32 Y, Int32 Width, Int32 Height, Int32 C, Int32 BorderColor, FontType Type, Boolean UseViewportOffset) in C:\vcprojs\AIWar\Framework\Direct3DRenderer.cs:line 421
   at AIWar.ResourceDisplay.Render(Direct3DRenderer R) in C:\vcprojs\AIWar\Framework\ResourceDisplay.cs:line 349
   at AIWar.GameForm.DrawDirect3D() in C:\vcprojs\AIWar\GameFormParts\GamePanel.cs:line 2193
   at AIWar.GameForm.RunNextCycle(Boolean DoRendering, Boolean DoScrollingAndInput) in C:\vcprojs\AIWar\GameFormParts\GameLoop.cs:line 1855
   at AIWar.GameForm.gameLoop() in C:\vcprojs\AIWar\GameFormParts\GameLoop.cs:line 294
   at AIWar.GameForm.GameForm_Load(Object sender, EventArgs e) in C:\vcprojs\AIWar\GameFormParts\Startup.cs:line 276
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Unhandled errors
« Reply #1 on: April 05, 2010, 09:37:18 pm »
Can you post the savegame that is happening with?  Not sure if this is a bug, or some sort of strange issue on your graphics driver or something, based on that first error.  The second two look like a bug, but the first looks more like your graphics driver is out of date.  With a savegame that is triggering this for you, we can test for a bug, but in the meantime I'd make sure that your drivers are up to date as well.

Sorry for the trouble you're having there!
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Sulue

  • Newbie
  • *
  • Posts: 3
Re: Unhandled errors
« Reply #2 on: April 05, 2010, 09:51:03 pm »
Thanks for the fast reply, hope this helps.

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Unhandled errors
« Reply #3 on: April 05, 2010, 10:33:38 pm »
No problem on the fast reply.  I should have asked, though -- are there any particular steps to reproduce with that save?  I load it up and let it run, and it did just fine (I am running 3.090, though, so maybe your bug was already amongst the fixes in those last two releases since yours there).  Given that that last one is based on the resource bar at the top of the screen, I kind of figured it would error out immediately if it was going to.

I have looked through the code more at the line numbers it is specifying, and it looks very unlikely that this is some sort of general purpose bug.  The line on which it is throwing that error is just nonsensical, in that it would have to be some sort of exception from inside SlimDX or DirectX itself given that there is no actual math being done on the line where it has an arithmetic exception.

That doesn't mean you haven't discovered something incredibly obscure (lucky you), but it does mean I'll need a bit more info about anything unusual you might be doing there -- really huge screen resolution, for instance, or running this in some VM, or something else.  At any rate, at this point it is looking increasingly likely that this might be a graphics card driver issue; are you up to date on those?

The first error in the list most looks like a graphics card fault, but from my looking more at this, the third also really seems more that direction, too.  But then the second one there is just really nonsensical, that is an error in windows itself being unable to make a window visible.  That makes me wonder if you were running super low on RAM, or had a ton of other stuff open, or what have you.  I tend to run with about 3 GB of other programs running while I play AI War, and have never had a problem on XP or Win7 related to that, but it depends on the specific situation, I guess.

Anyway, I wish I could give a more definitive answer, but hopefully it will just turn out to be a graphics card driver thing, and that will be the end of it.  Otherwise, hopefully any further information you can provide can help to shed some light on what exactly is going on here, as it isn't as simple as just an in-game bug.  It's something lower, at the OS, DirectX, graphics driver, or SlimDX level that is causing a problem for you on your machine where others have no problem -- so that's what we have to figure out, is what is different, and then what to do about that.  It could even be that something is messed up with .NET itself on your machine, but that is much less likely than the graphics card driver.

Just to warn you, I'm heading out for the night at the moment, but I'll be around again in the morning, etc.  Good luck with it!  I'll keep my fingers crossed that the graphics driver will be the simple fix.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Sulue

  • Newbie
  • *
  • Posts: 3
Re: Unhandled errors
« Reply #4 on: April 06, 2010, 11:24:57 am »
I did not suspect the video driver because i had recently updated it. After further review i noticed i had installed the latest driver but not the correct one for my OS which is Xp service pack 3  /facepalm. After rebooting last night i started playing and thought that might have taken care of the issue. About an hour into the game it crashed to the desktop with a MS error prompt. Didn't generate an Unhandled error file which isn't uncommon. every other crash might generate one. Sometimes it crashes and reboots, and once or twice it has frozen causing me to Alt control delete to get control.

 I run and older system and the basic specs are as follows:
 MB Asus P5ad2 Deluxe
 Geforce 8600 GTS 256 1280x1024 max res which i run the game with the same res.
 1g ram
 couple of seagate 120g sata drives
 
 Tried to paste the Dxdiag text but it stated to many characters for the post, if you need that info as well i can uplaod you a pdf of it or maybe i'm doing something wrong , thanks
« Last Edit: April 06, 2010, 11:28:50 am by Sulue »

Offline x4000

  • Chris McElligott Park, Arcen Founder and Lead Dev
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 31,651
Re: Unhandled errors
« Reply #5 on: April 06, 2010, 12:01:00 pm »
Okay -- there is definitely something much more wrong there, in that case.  AI War should never be able to cause a crash that would reboot your machine unless something is really wrong at a lower level.  Your specs of your machine should be fine, though you didn't mention CPU speed (not that that could cause crashes, anyway).

If you want to upload your dxdiag, you can attach it to the post as a text file, I believe.  But honestly that has almost never provided much useful information with situations like this, because it's usually that something is corrupt, rather than that something is missing, and that tends not to show up on dxdiag.

Questions and thoughts:

1. Do you play many other games that would be using DirectX?  Have you done so since updating to the latest version of the graphics card driver?  If the issue is with the graphics card driver (to the point where it is completely locking a game or causing a reboot), I'd expect to see that on more than just AI War.  In other words, that would point away from the graphics driver.  But one of the easiest things to test is a new graphics card driver compared to the other components that might be at fault here, so simply reverting to an older driver version (something in the 180s of the NVidia line might be best, as there were some problems in the 190s for some people on a variety of games -- to the point of causing hardware damage in some graphics-heavy games due to overheating, I'd heard).

2. Have you run something like memtest86?  It is possible that AI War is uncovering some faulty RAM for you; it may be using more memory than some other games or applications you have played.  And given the one access violation based on some memory being corrupt, I was interpreting that as a GPU thing, but it actually could be a general ram thing.  Or something in the OS or .NET itself.  But if you want to verify that your actual physical RAM is fine, something like memtest86 would be a way to do it.

3. You may want to check if you're running out of RAM and flipping over into swap space on the physical disk.  That in itself should not cause any crashes or anything, but if there are bad sectors under your swap file, that could be leading to a "corrupt memory" report even when it's not actual RAM that is at fault.

4. Last main thing would be if this is some sort of software bug, aside from the graphics driver.  At this stage I am pretty certain that the error is below AI War itself, and most likely well below the SlimDX level as well (that's just a .NET wrapper around DirectX).  So at this stage, software-wise, the three potential culprits would be: the .NET framework, DirectX 9.0c, or windows itself (malware of various sorts can screw things up as it tries to mess with the memory of other running processes).  AI War is very unusual as far as most games go in that it runs on the .NET framework, so that could easily lead to a case where AI War crashes/freezes where other games do not if .NET itself is messed up.  If the problem was with DirectX, again I'd expect for other DirectX 9 games to have the same problem as AI War.  So if you're playing other games without incident, most likely this is a problem with .NET or malware, not with DirectX 9.  I'd suggest running something like Spybot Search and Destroy, or Ad Aware, or your favorite other malware scanner to be sure you're not infected with anything. 

Then, if all else fails, I'd suggest trying to uninstall and reinstall the .NET framework.  Be warned, though, that if that is messed up enough, it won't uninstall correctly and then won't be able to reinstall itself either.  That's usually a good indicator that your current install of windows itself is hosed to the point that you really should do a fresh install of it.  I always hate giving that sort of bad news to folks, but assuming that your hardware itself is running properly (a CPU that has overheated in the past, and was damaged, can sometimes introduce strange errors into various programs, but the sort of errors that were logged do not seem likely to me), then it's down to one of those software components.

Before you go off on a huge quest into your OS and related things, if you want to assure yourself that it's not AI War itself, you can always run the 3.060 version, which is the most widely used stable version, and has no issues of this sort.  But, given the few dozen others running 3.088 and posting without any incident of this sort, and the likely dozens of people silently using it and not writing in about anything of this sort, paired with the nature of the error itself, I'm quite comfortable saying this isn't AI War or SlimDX; neither of those should be able to reboot your machine, unless something is wrong on hardware or in the .NET runtime itself (that's one of the great things about the .NET runtime, actually).

Anyway, wish I had better news, but that's basically the situation as I see it at the moment.  Hope that helps!  And, hopefully it will be something relatively easy, like simply a bad stick of RAM, or a bug in the latest graphics driver, or something like that.
Have ideas or bug reports for one of our games?  Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

 

SMF spam blocked by CleanTalk