World Generator Crashes

hachi

Terrarian
I get frequent crashes running the following batch:
Code:
for /L %a in (1,1,n) do echo exit-nosave| TerrariaServer -autocreate 1 -worldname batch%a -world batch%a.wld

n being stable to upwards of hundreds before 1.3x, now terrariaserver hangs mid write or just crashes after some iterations, no pattern afaik. probably not a common use case but it could mean bigger problems for single generation, this used to be rock solid in hand picking worlds for server setups.
 
I get frequent crashes running the following batch:
Code:
for /L %a in (1,1,n) do echo exit-nosave| TerrariaServer -autocreate 1 -worldname batch%a -world batch%a.wld

n being stable to upwards of hundreds before 1.3x, now terrariaserver hangs mid write or just crashes after some iterations, no pattern afaik. probably not a common use case but it could mean bigger problems for single generation, this used to be rock solid in hand picking worlds for server setups.

This looks a bit familiar. I've used this construct a few times since 1.3 came out to generate some test worlds, ran into a crash maybe once or twice but never really considered it much and worked around it. How many iterations are you doing, and does it seem less frequent if you do smaller batches? For example, you could do "for /L %a in (1,1,10) ...", "for /L %a in (11,1,20) ...", "for /L %a in (21,1,30) ...", and so forth. There's probably not much useful information if it goes out gathering wool, but do you have the exception dump it creates when it crashes? It might give some hints on what's going wrong.

My first thought is it might have something to do with the server port not being closed fast enough (far more likely to happen generating small worlds), but I'd need more information. If that's the case, there might be a way to work around that.
 
seems to happen only in batches of >10. I have tried 20, 50, 100 and got hangs anywhere in between, and sometimes it completes the entire run without a hitch. majority of the time when it does though it stops during creation of some object like a biome or structure. I will try to get a dump next time
 
here is an exception from the shell:

Code:
86.0% - Making cave walls - 99.2%
86.0% - Making cave walls - 99.6%
99.1% - Making cave walls - 99.6%
86.1% - Making cave walls - 0.0%

Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
  at Terraria.NetMessage.SendData(Int32 msgType, Int32 remoteClient, Int32 ignoreClient, String text, Int32 number, Single number2, Single number3, Single number4, Int32 number5, Int32 number6, Int32 number7)
  at Terraria.NetMessage.SendTileSquare(Int32 whoAmi, Int32 tileX, Int32 tileY, Int32 size)
  at Terraria.WorldGen.GrowUndergroundTree(Int32 i, Int32 y)
  at Terraria.WorldGen.<generateWorld>b__40(GenerationProgress progress)
  at Terraria.GameContent.Generation.PassLegacy.Apply(GenerationProgress progress)
  at Terraria.World.Generation.WorldGenerator.GenerateWorld(GenerationProgress progress)
  at Terraria.WorldGen.generateWorld(Int32 seed, GenerationProgress customProgressObject)
  at Terraria.IO.WorldFile.loadWorld(Boolean loadFromCloud)
  at Terraria.WorldGen.serverLoadWorldCallBack(Object threadContext)
  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
  at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
  at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
  at System.Threading.ThreadPoolWorkQueue.Dispatch()
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

@ pass #31, seems common for this to fail at about 20-40 worlds
 
Terraria.NetMessage.SendData() is the function that constructs messages to be sent to clients, but possibly shouldn't apply while the world is being generated and there aren't any clients to talk to. In this case, it looks like the message request is originating from Terraria.WorldGen.GrowUndergroundTree(). This probably doesn't have anything to do with the number of iterations, just an intermittent issue with the internal network state. It's possible there's a bug at work here, but it's not currently clear to me where or why.
 
em Terraria.WorldGen.<>c.<generateWorld>b__259_84(GenerationProgress progress)
em Terraria.GameContent.Generation.PassLegacy.Apply(GenerationProgress progress)
em Terraria.World.Generation.WorldGenerator.GenerateWorld(GenerationProgress progress)
em Terraria.WorldGen.generateWorld(Int32 seed, GenerationProgress customProgressObject)
em Terraria.WorldGen.do_worldGenCallBack(Object threadContext)
em Terraria.WorldGen.worldGenCallBack(Object threadContext)
 
em Terraria.WorldGen.<>c.<generateWorld>b__259_84(GenerationProgress progress)
em Terraria.GameContent.Generation.PassLegacy.Apply(GenerationProgress progress)
em Terraria.World.Generation.WorldGenerator.GenerateWorld(GenerationProgress progress)
em Terraria.WorldGen.generateWorld(Int32 seed, GenerationProgress customProgressObject)
em Terraria.WorldGen.do_worldGenCallBack(Object threadContext)
em Terraria.WorldGen.worldGenCallBack(Object threadContext)

Can you generate a new world using the client and then load it with the server?
 
I'm getting this
 

Attachments

  • received_1956631117950525.jpeg
    received_1956631117950525.jpeg
    118.6 KB · Views: 239
  • received_1956631117950525.jpeg
    received_1956631117950525.jpeg
    118.6 KB · Views: 172
Back
Top Bottom