Terraria Randomly Crashes While i am Playing/When i Try To Save and Exit The World

Element-118

Terrarian
I got no clue why is this happening I recently Bought the game And i was having fun Till Recently Game started acting Weird And Crashing on Its Own, Everything would just freeze i could not even move my cursor and i would be forced to press the power Button on my PC in order For all Programs To shut down and to unfreeze My PC. Please Does anybody Know a solution to this problem, I checked my game Crash logs inside of the Terraria Folder And i only found these 2 That are from 7th and 9th may.Also When game Does Crash/When i restart My PC and Run the Terraria again,When i open the world That i crashed in Data Gets reverted to an older Save File Which is Extremly annoying, It happend To me that i was building massive structures and lost All the work and time i spent on it, Also Map is same As before But when i go to site where Buildings or some Blocks were at It just updates To what it was Before i was even building.

This is All i Could Find in My Crash Log inside of the terraria Folder (You can see Dates, There are none from now recently/Yesterday And Today/ When it got Way Worse And Common to the point Where its not worth playing The game Anymore:

07-May-18 23:11:08
System.InvalidOperationException: A previous Draw call threw an unhandled exception. See InnerException for details. ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'Texture2D'.
at Microsoft.Xna.Framework.Helpers.CheckDisposed(Object obj, IntPtr pComPtr)
at Microsoft.Xna.Framework.Graphics.TextureCollection.set_Item(Int32 index, Texture value)
at Microsoft.Xna.Framework.Graphics.SpriteBatch.RenderBatch(Texture2D texture, SpriteInfo[] sprites, Int32 offset, Int32 count)
at Microsoft.Xna.Framework.Graphics.SpriteBatch.Flush()
at Microsoft.Xna.Framework.Graphics.SpriteBatch.End()
at Terraria.Main.DoDraw(GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Paint(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameWindow.OnPaint()
at Microsoft.Xna.Framework.WindowsGameWindow.mainForm_Paint(Object sender, PaintEventArgs e)
--- End of inner exception stack trace ---
at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
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 Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs)

09-May-18 12:27:49
System.InvalidOperationException: A previous Draw call threw an unhandled exception. See InnerException for details. ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'RenderTarget2D'.
at Microsoft.Xna.Framework.Helpers.CheckDisposed(Object obj, IntPtr pComPtr)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.SetRenderTargets(RenderTargetBinding* pBindings, Int32 renderTargetCount)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.SetRenderTarget(RenderTarget2D renderTarget)
at Terraria.Main.tileColorCheck(Int32 t, Int32 c)
at Terraria.Main.lookForColorTiles()
at Terraria.Main.DoDraw(GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Paint(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameWindow.OnPaint()
at Microsoft.Xna.Framework.WindowsGameWindow.mainForm_Paint(Object sender, PaintEventArgs e)
--- End of inner exception stack trace ---
at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
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 Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs)

09-May-18 15:10:35
System.InvalidOperationException: A previous Draw call threw an unhandled exception. See InnerException for details. ---> System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'RenderTarget2D'.
at Microsoft.Xna.Framework.Helpers.CheckDisposed(Object obj, IntPtr pComPtr)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.SetRenderTargets(RenderTargetBinding* pBindings, Int32 renderTargetCount)
at Microsoft.Xna.Framework.Graphics.GraphicsDevice.SetRenderTarget(RenderTarget2D renderTarget)
at Terraria.Main.tileColorCheck(Int32 t, Int32 c)
at Terraria.Main.lookForColorTiles()
at Terraria.Main.DoDraw(GameTime gameTime)
at Terraria.Main.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Paint(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameWindow.OnPaint()
at Microsoft.Xna.Framework.WindowsGameWindow.mainForm_Paint(Object sender, PaintEventArgs e)
--- End of inner exception stack trace ---
at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
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 Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Terraria.Program.LaunchGame(String[] args, Boolean monoArgs)
 
Okay let's try a few things. If you have questions on how to do any of the steps listed below let me know.

1) Verify the integrity of the game cache through steam. If that doesn't work move to step 2.

2) Run the game with administrator privileges. If that doesn't work move to step 3.

3) Uninstall XNA and then install XNA 4.0

If none of those work come back and let me know. Also let me know if specific actions you take in game can reproduce the crash.

-- Sent from mobile
 
Okay let's try a few things. If you have questions on how to do any of the steps listed below let me know.

1) Verify the integrity of the game cache through steam. If that doesn't work move to step 2.

2) Run the game with administrator privileges. If that doesn't work move to step 3.

3) Uninstall XNA and then install XNA 4.0

If none of those work come back and let me know. Also let me know if specific actions you take in game can reproduce the crash.

-- Sent from mobile
How to Verify the integrity of the game cache? Could you explain me
 
How to Verify the integrity of the game cache? Could you explain me

In your steam library right click Terraria and select properties. A new window will appear, at the top are a bunch of tabs click on the local files tab. You should now see a button that says "Verify integrity of game cache" click that then wait for it to finish. Below is an example taken from steams KB.

verifygcf2.gif


Let me know if you have any other questions on any of the other steps.
 
2af9042a0f5558351d604a60c713c514
In your steam library right click Terraria and select properties. A new window will appear, at the top are a bunch of tabs click on the local files tab. You should now see a button that says "Verify integrity of game cache" click that then wait for it to finish. Below is an example taken from steams KB.

verifygcf2.gif


Let me know if you have any other questions on any of the other steps.

I did 1 and 3 , Did not work here i managed to get a screenshot of message that says that terraria stopped working and that happends every time (aka crash) So i dont think 2 would work either Do you know anything else?
 
I still would like you to try number 2, a couple of users I found through googling with a similar problem got theirs to work by running it as an administrator. To do this find your install of Terraria, the default install is: C:\Program Files (x86)\Steam\steamapps\common\Terraria. Find the application right click it and select "Run as an Administrator".

If that doesn't work we can try deleting the config.json to see if that provides a solution. Navigate to Documents\My Games\Terraria, you should see a file called config.json delete this and re-launch Terraria. Terraria should create a new fresh one and it might fix your issue, I'll check on a few other things that we can try in the mean time.

Sorry you're having trouble by the way =( hopefully we can get this all figured out for you.
 
2af9042a0f5558351d604a60c713c514


I did 1 and 3 , Did not work here i managed to get a screenshot of message that says that terraria stopped working and that happends every time (aka crash) So i dont think 2 would work either Do you know anything else?
I will try running the terraria as an administrator but i wanted to just mention that i could Run Terraria Before perfectly Fine, without Any crashes , And that was while i was playing cracked version of 1.3 terraria , Even before that i played cracked 1,2 . I enjoyed so much that i decided to buy the game for real and i did , and now when i bought the game it crashes like its a complete nosense

2af9042a0f5558351d604a60c713c514


I did 1 and 3 , Did not work here i managed to get a screenshot of message that says that terraria stopped working and that happends every time (aka crash) So i dont think 2 would work either Do you know anything else?
Just tried Running The game as administrator And it does not work , I am not sure if its always like this but it seems That Game starts lagging when i destroy loads of cowwebs or sometimes destroy a boss or a tree

I still would like you to try number 2, a couple of users I found through googling with a similar problem got theirs to work by running it as an administrator. To do this find your install of Terraria, the default install is: C:\Program Files (x86)\Steam\steamapps\common\Terraria. Find the application right click it and select "Run as an Administrator".

If that doesn't work we can try deleting the config.json to see if that provides a solution. Navigate to Documents\My Games\Terraria, you should see a file called config.json delete this and re-launch Terraria. Terraria should create a new fresh one and it might fix your issue, I'll check on a few other things that we can try in the mean time.

Sorry you're having trouble by the way =( hopefully we can get this all figured out for you.

I will try running the terraria as an administrator but i wanted to just mention that i could Run Terraria Before perfectly Fine, without Any crashes , And that was while i was playing cracked version of 1.3 terraria , Even before that i played cracked 1,2 . I enjoyed so much that i decided to buy the game for real and i did , and now when i bought the game it crashes like its a complete nosense
Edit:Just tried Running The game as administrator And it does not work , I am not sure if its always like this but it seems That Game starts lagging when i destroy loads of cowwebs or sometimes destroy a boss or a tree

Edit2:Tried Running Game on lower settings (medium) Still crash This time it just randomly Exited The game There was not any lag too it said that terraria stopped working
Also Before i had a different Graphics card so i wonder if it might have to do something with it, Before i used an older one it died out so i got myself a GTX710.

<Triple Post Merged by a Moderator>
 
Last edited by a moderator:
To verify, did you delete the config.json in Documents\My Games\Terraria? That's another thing I wanted you to try.

Also, are you saying that the cracked version works for you, but the steam version does not? Have you tried the cracked version recently and confirmed that it won't crash? If so, what version is that copy running on?

You may also want to try reinstalling your graphics drivers in the event something botched them. If you need instructions on how to do this let me know.

I assume I'm still allowed to help you because you also have a paid version so hopefully we aren't breaking any rules here.
 
To verify, did you delete the config.json in Documents\My Games\Terraria? That's another thing I wanted you to try.

Also, are you saying that the cracked version works for you, but the steam version does not? Have you tried the cracked version recently and confirmed that it won't crash? If so, what version is that copy running on?

You may also want to try reinstalling your graphics drivers in the event something botched them. If you need instructions on how to do this let me know.

I assume I'm still allowed to help you because you also have a paid version so hopefully we aren't breaking any rules here.
I deleted The Config.json And Reinstalled the drivers and it still crashes Do you have anything else for me to try?
 
That's bizarre, all the other people with the error you have were able to fix it by deleting config.json or reinstalling XNA... Let's try to gather some more information at this point:

What's the resolution of your monitor?

What resolution is Terraria running at?

Are you in windowed or full screen? (make sure the crash happens in both windowed and full screen)

Have you tried using GeForce Experience to "optimize" Terraria settings? (If not try that, it's a free utility from Nvidia that can match the settings to your hardware to increase preformance)

Are you using multiple monitors or just one?

What steps are you taking to reproduce the crash? AKA what are you doing when it crashes?
 
That's bizarre, all the other people with the error you have were able to fix it by deleting config.json or reinstalling XNA... Let's try to gather some more information at this point:

What's the resolution of your monitor?

What resolution is Terraria running at?

Are you in windowed or full screen? (make sure the crash happens in both windowed and full screen)

Have you tried using GeForce Experience to "optimize" Terraria settings? (If not try that, it's a free utility from Nvidia that can match the settings to your hardware to increase preformance)

Are you using multiple monitors or just one?

What steps are you taking to reproduce the crash? AKA what are you doing when it crashes?
My Resolution is 1920x1080 and i am running terraria at that same resolution , i play in full screen and i have a single monitor, just tried optimize option and no crash so far, i would need to play bit longer in order to be sure that this is it but it might be. Edit: When Crash happends i do Shift ALt plus Del to get to windows menu screen then i go back to the desktop and IT says that terraria stopped working.

Edit2 Optimizing The game does not work too, my god what is going on

Tried playing windowed and still crash
 
Last edited:
So is the error the same, if you go to your crash logs or Windows Event Viewer what do they say? To find this:

1) Click Start and search "Event Viewer" it should be the first one that pops up under programs.

2) On the left hand side click the arrow next to "Windows Logs"

3) Double Click "Application" under Windows Logs"

4) Look for crashes or errors with Terraria as the source. Include any and all information the Event viewer has to offer about the crashes.

AXiv8Rw.png
 
So is the error the same, if you go to your crash logs or Windows Event Viewer what do they say? To find this:

1) Click Start and search "Event Viewer" it should be the first one that pops up under programs.

2) On the left hand side click the arrow next to "Windows Logs"

3) Double Click "Application" under Windows Logs"

4) Look for crashes or errors with Terraria as the source. Include any and all information the Event viewer has to offer about the crashes.

AXiv8Rw.png
awrfPNG.PNG
This is What shows up there are no other Windows , What happend?
 
Hmmm... These two problems could be related to a .Net issue. Lets do this:

1. Uninstall .Net Framework
2. Download and Install .Net Framework 4.7
3. Uninstall XNA Redist
4. Download and Install XNA Redist 4.0

After that, do you still get the error in Terraria, if so, do you get the same issue in Event Viewer where the snap in could not be created?

Thank you for your patience while we get this resolved by the way, I know first hand how frustrating these issues can be.
 
Hmmm... These two problems could be related to a .Net issue. Lets do this:

1. Uninstall .Net Framework
2. Download and Install .Net Framework 4.7
3. Uninstall XNA Redist
4. Download and Install XNA Redist 4.0

After that, do you still get the error in Terraria, if so, do you get the same issue in Event Viewer where the snap in could not be created?

Thank you for your patience while we get this resolved by the way, I know first hand how frustrating these issues can be.
Can i safely Uninstall Net Framework it says that it may cease some funcitons? ( i already have network 4.7)
 
Yeah that's fine we're going to reinstall it anyways, in case of corruption. It's perfectly safe.
I am still getting crashes and last time i crashed it was while i was doing the Solar Eclipse ( killing loads of enemies) so it might have to do something with it by the way i still can not see the logs
 
Unfortunately the only way for us to know for certain why it is crashing is some sort of crash log so the event viewer is going to be an important aspect of this situation. How did you get the first error reports from your original post? Is it now crashing without any error?

We need to see if we can get the event viewer functioning again, this will be complicated, I'm going to see if I can automate any of it so you don't have to. For now I have one question: Do you have multiple versions of .net installed for some reason? You can check this by going to control panel > programs and features > uninstall a program and search for .Net it should list all the versions you have installed, could you give me a list of what versions you have installed?

In the meanwhile I'll see if I can automate a registry fix for you.

Edit: @Element-118 there's some more information I need for the registry fix, in you screenshot the full error code gets cut off. You should be able to move the bars so you can expand the middle section. You might also just be able to maximize the window. Get me a screenshot of the full code if you can.
 
Last edited:
ErrorLog1.PNG
Unfortunately the only way for us to know for certain why it is crashing is some sort of crash log so the event viewer is going to be an important aspect of this situation. How did you get the first error reports from your original post? Is it now crashing without any error?

We need to see if we can get the event viewer functioning again, this will be complicated, I'm going to see if I can automate any of it so you don't have to. For now I have one question: Do you have multiple versions of .net installed for some reason? You can check this by going to control panel > programs and features > uninstall a program and search for .Net it should list all the versions you have installed, could you give me a list of what versions you have installed?

In the meanwhile I'll see if I can automate a registry fix for you.

Edit: @Element-118 there's some more information I need for the registry fix, in you screenshot the full error code gets cut off. You should be able to move the bars so you can expand the middle section. You might also just be able to maximize the window. Get me a screenshot of the full code if you can.
I have only one version of new framework installed and its 4.7.2 ,
Here is full Screenshot that you requested For Fix I think This was the code you were talking about
index.php

Also I got the first Crash Log From The Terraria Crash log Text Which is located inside of the terraria Folder , But again it was missing information, There were no newer Logs Which is weird. Currently When it Crashes Screen freezes , i would Crtl Alt + Delete Which Would bring Me to Windows Menu Screen, From there i would just exit The screen and i could see the small windows window saying that Terraria Stopped Working, Once i confirm it it just Closes itself And terraria icon In Icon Bar Bellow.
[doublepost=1526329713,1526329488][/doublepost]
Error Log2.PNG
 
Back
Top Bottom