Adam Hines

A game I have been developing works perfectly fine on windows, however, causes my xbox to hard freeze (all controls stop responding and the device can only be shut off from the power button on the xbox itself), which in turn detaches the debugger. This seems to happen after an arbitrary amount of time, and thus leads me to perhaps memory issues. I haven't been able to find anyone else with a similar problem, but if anyone has experienced similar problems, I'd be interested in knowing how you went about debugging and or solving this issue because I'm having lots of difficulty isolating the problem to any one block of code.

At any rate, it seems odd that my managed code (no shaders either) would cause the entire xbox to freeze considering its running in a sandbox.

Any thoughts

Adam



Re: XNA Framework XNA project hard freezes XBOX360

waruwaru

The freezing may be because you are stuck in an infinite loop.  When it freezes, try toggling break points in your code inside where you think it's freezing.  If it's stuck in a loop, you should be able to make your xbox hit a break point, and figure out what the problem is.

Another way to debug it...  Sprinkle lots of Debug.WriteLine()/trace to keep track of where you are :)

I see in the other thread, you are using #ifdefs to generate platform independent codes.  If that is the case, the "working on Windows" statement means a little less.  But it does sound more like you are hittin some kind of limit.






Re: XNA Framework XNA project hard freezes XBOX360

Peter D.

This is odd as you should still be able to hit the XBox button in the center of the controller to regain control and cause the machine to go back to dashboard.

Does this happen in any of your retail games





Re: XNA Framework XNA project hard freezes XBOX360

Adam Hines

No, I have had no crashing or overheating issues outside of XNA. Additionally, the audio thread continues to execute, ie. if i am playing music through the dashboard it will continue to play even though the rest of the system fails to respond.

In response to the first comment, there are no #ifdefs in this project, its a straight recompile.

I've downloaded a number of other 3rd party projects and have not experienced this issue with any of them. I have developed a generic menu GraphicalGameComponent to use as the main menu. This blocks execution of the main game loop, and thus leads me to believe the problem is either in the Update function of the menu (which does nothing particularly scary) or in the Draw functions of either the main game screen or the menu. I am using the XNAExtras BitmapFont class that someone integrated into the ContentPipeline (sorry, i forget the user who posted it). A part of me thinks that might be related as the rest of the code is fairly benign. Just uses sprite batch to draw a transparent rounded rectangle and BitmapFont to draw a List<MenuItem>.

In regards to setting breakpoints, it happens mostly in release mode, and specifically if the debugger is not attached. If i run the game from the XNA launcher it will freeze within a second if i don't exit the menu (the only part using bitmap font)

Hopefully that will provide some more insight into the problem, does anyone at MS know if there are any plans for an XNA update anytime soon





Re: XNA Framework XNA project hard freezes XBOX360

waruwaru

Adam Hines wrote:
In regards to setting breakpoints, it happens mostly in release mode, and specifically if the debugger is not attached. If i run the game from the XNA launcher it will freeze within a second if i don't exit the menu (the only part using bitmap font)

Hopefully that will provide some more insight into the problem, does anyone at MS know if there are any plans for an XNA update anytime soon

Sounds like a timing issue like some sort of race condition. Are you (or the 3rd party components) using multiple threads Maybe multiple threads trying to access the graphics routines at the same time I would strip out components 1 by 1 until I can narrow down the problem.






Re: XNA Framework XNA project hard freezes XBOX360

Adam Hines

Entirely single threaded, and not doing anything more complicated than drawing sprites (not many, certainly less than 100).




Re: XNA Framework XNA project hard freezes XBOX360

Peter D.

We are going to need some code




Re: XNA Framework XNA project hard freezes XBOX360

X-Tatic

Does Break All not do anything from Visual Studio




Re: XNA Framework XNA project hard freezes XBOX360

Adam Hines

Break all works fine providing the program hasn't frozen. At the instant the system hangs the debugger gets detached... i'm not at my xbox now but i believe the error is something about not being able to reach the xbox.

My inclination is that this isn't a communication error as it happens when launching from the xna launcher without my development machine being involved at all.

I'll package together the project and post it somewhere to download, however, it is using some graphics which i don't own, so i am hesitant to post the content. I can, however, post the code my XNAMenu dll project. I'm at work now, so i won't likely be able to get this up until later tonight.

Adam




Re: XNA Framework XNA project hard freezes XBOX360

Stephen Styrchak - MSFT

Aggressive memory use in managed code can cause failures in the XNA Launcher, because ultimately both the native and managed code have to fit entirely in 512 MB of physical memory. If you allocate too much in managed code, then you may cause the native code to fail an allocation. Depending on where it failed, it may cause a hang or reboot.

Shaders also can crash/hang your box. Are you using any custom shaders

In terms of the Guide button not working, that can happen when your application is no longer calling Draw (or Present I forget which). If you're not updating the screen, the guide cannot be rendered, either.

It is odd that you have this problem more often when running from the browser and not when debugging. However, if the problem occurs more frequently with no debugger attached, you should try launching from the XNA Framework Remote Performance Monitor for Xbox 360 (aka RPM). Read more about it here.

This tool will give you information about memory use. It also launches games in non-debug mode, so it is more like launching from the game browser. If your game crashes right away, this tool might be able to tell you if it's because your game allocated a giant amount of memory right at the beginning.

It's no silver bullet, but it might help.

--Stephen