**REPORTED** The autocreate option in serverconfig.txt isn't read correctly when '2' is specified (medium world)

dekuashe

Terrarian
Steam or GOG
Steam
Single Player/Multiplayer
Multi
Operating System
Linux Other
Terraria Version
1.4.0.4
Controls Used
Keyboard/Mouse
My primary use is a multiplayer server in Linux (tested on 64-bit Ubuntu 16.04.6 LTS running on an i5-2500K w/16gb RAM and a 18.04.4 LTS VM running on that Ubuntu 16 host configured with 2 CPUs and 8GB RAM), while the actual game client I use runs on my desktop (Linux Mint 19.3 Cinnamon edition, i7-6700 w/32gb RAM and a GTX 970). My initial testing was with the Ubuntu 18 VM with 4GB RAM, but when I ran into issues with 1.4.0.1, I first tried bumping that VM up to 8GB and then finally just moved everything over to the host for more power, so most of my testing has been on the Ubuntu 16 host (after moving the VM back down to 4gb to free up host memory).

Version 1.4.0.4, but this wasn't read correctly in 1.4.0.1 either.

I launch the game with: /<mypath>/TerrariaServer -config /<mypath>/serverconfig.txt

Tested with these options:
autocreate=2
seed=1793070349
difficulty=0
secure=1
language=en-US
upnp=0
priority=1

And just for reference, options like worldname, password, motd, world, etc all seem to work OK. Except for autocreate. I’ve also tried creating other medium worlds (random seed), and they all end up with the same issues.

There's actually a few issues stemming from this, so I'll go through them one by one starting from the core issue. I’ve labeled attached screenshots appropriately.

A. It isn't actually creating the world that is specified. The serverconfig.txt comment is the following:
#Creates a new world if none is found. World size is specified by: 1(small), 2(medium), and 3(large).

So my world should be a medium world. It felt like a medium world as it felt about the right size, but it's not. It is marked "unknown" if I move it to my single player folder, it is slightly smaller than a medium world generated with the same seed, and the world generated isn't seeded the same way, so it isn't just some kind of weirdly cut off medium world, it's a truly differently sized world? with a different gen. When I look at the FULL world seed, that first digit indicates a setting of "0", so it seems like something isn't being parsed correctly for that setting, resulting in some kind of default of "0" instead of the "2" I specified. So in my case, the full world seed was: 0.1.1.1793070349 vs the expected: 2.1.1.1793070349. However, setting it to “1” works correctly (single player mode tells me it’s a small world) and “3” also works correctly. Creating a new multiplayer world, even with the same seed, works just fine from within the game client itself. It’s only when I’m doing this with a headless server using the autocreate option. I have not tested this on Windows.

The world itself plays just fine, however, outside having a built-in hellevator. I had some segfaults and a corrupted world in 1.4.0.1/1.4.0.2 but I haven’t really had that since, but I don’t know if it’s related to me moving the server from the VM to the host though.

B. The 0(unknown) world generated from the Linux server has a portion of the map on the far right that is missing blocks/everything from top to bottom. I'd say it's roughly half the width of the ocean on that side. However, you can still interact with this area (build a bridge over it, jump straight down to the bottom, sometimes jellyfish get confused and actually swim through the air where the water is supposed to be). I've generated 2 different worlds on the server now using autocreate and the result is the same. Windows clients connecting to my server see this same thing.

C. If I generate that world on the server, and then immediately copy it over to my single player Worlds folder without playing it on the server first, and then play it locally as a single player world, there is no missing chunk on the right side of the map.

D. When I played that world on the server to explore the missing chunk on the right, I built a quick dirt bridge all the way across the missing chunk. I saved it and copied it over to my single player Worlds folder, and when I play it in single player mode, my bridge is still there along with the missing chunk.

E. HOWEVER if I enter that world in single player mode and immediately exit (I did a “dirty exit” by just closing the game window, but it’s happened when doing a normal exit too), then restart the game and go back in, not only does the missing chunk FILL IN, but my dirt bridge gets all messed up too, as the dirt blocks have vertical open faces (like it's attached to something top and bottom) instead of facing to their horizontally adjacent blocks like they’re supposed to.

F. Trying to replicate this strategy when it's running on the server (only quick Xing out of the game client on my desktop, NOT the server) resulted in a segfault when I tried to exit the server (typing "exit" in the console) after the client disconnected ("line 42: 13689 Segmentation fault (core dumped) ./${BASENAME}.bin.${ext} $@"). However, when I started the server again, the world loaded fine, but that entire chunk was missing off my map completely as if I never explored it, and my dirt bridge was cut off too, like it re-deleted that chunk off the right again or something. But if you look at the screenshots, you can see that it still thought I explored the last column of blocks when I jumped all the way down as they’re still lit up on the map without the empty chunk right next to it being marked as explored. This doesn’t happen if I haven’t jumped down yet, as you can see in earlier screenshots.

- Might be related, but I hit a different segfault when saving, then exiting a large world too (“line 42: 24333 Segmentation fault (core dumped) ./${BASENAME}.bin.${ext} $@”. Maybe a memory thing when the world is larger than medium (a TRUE medium)?

- I’ve also hit this error when exiting my 0(unknown) world:
_wapi_handle_unref_full: Attempting to unref unused handle 0x7
Exception inside UnhandledException handler: Stream does not support writing

But this last error has happened only once when doing some additional testing while writing this up.
 

Attachments

  • A1.png
    A1.png
    44.3 KB · Views: 73
  • B1.png
    B1.png
    441.4 KB · Views: 85
  • B2.png
    B2.png
    11.2 KB · Views: 76
  • B3.png
    B3.png
    821.4 KB · Views: 106
  • C1.png
    C1.png
    13.3 KB · Views: 78
  • D1.png
    D1.png
    466.1 KB · Views: 82
  • D2.png
    D2.png
    9.9 KB · Views: 63
  • E1.png
    E1.png
    395.8 KB · Views: 79
  • E2.png
    E2.png
    9 KB · Views: 66
  • F1.png
    F1.png
    119.3 KB · Views: 72
  • F2.png
    F2.png
    181.5 KB · Views: 65
  • F3.png
    F3.png
    9.5 KB · Views: 68
There is . . . a LOT going on here in this report.

To start with, it would help a lot if the world file in question were uploaded so we could take a look :)


A. It isn't actually creating the world that is specified. The serverconfig.txt comment is the following:
#Creates a new world if none is found. World size is specified by: 1(small), 2(medium), and 3(large).

So my world should be a medium world. It felt like a medium world as it felt about the right size, but it's not. It is marked "unknown" if I move it to my single player folder, it is slightly smaller than a medium world generated with the same seed, and the world generated isn't seeded the same way, so it isn't just some kind of weirdly cut off medium world, it's a truly differently sized world?

This indicates that the world that you ended up creating was corrupted during the initial save process.


D. When I played that world on the server to explore the missing chunk on the right, I built a quick dirt bridge all the way across the missing chunk. I saved it and copied it over to my single player Worlds folder, and when I play it in single player mode, my bridge is still there along with the missing chunk.

E. HOWEVER if I enter that world in single player mode and immediately exit (I did a “dirty exit” by just closing the game window, but it’s happened when doing a normal exit too), then restart the game and go back in, not only does the missing chunk FILL IN, but my dirt bridge gets all messed up too, as the dirt blocks have vertical open faces (like it's attached to something top and bottom) instead of facing to their horizontally adjacent blocks like they’re supposed to.

F. Trying to replicate this strategy when it's running on the server (only quick Xing out of the game client on my desktop, NOT the server) resulted in a segfault when I tried to exit the server (typing "exit" in the console) after the client disconnected ("line 42: 13689 Segmentation fault (core dumped) ./${BASENAME}.bin.${ext} $@"). However, when I started the server again, the world loaded fine, but that entire chunk was missing off my map completely as if I never explored it, and my dirt bridge was cut off too, like it re-deleted that chunk off the right again or something. But if you look at the screenshots, you can see that it still thought I explored the last column of blocks when I jumped all the way down as they’re still lit up on the map without the empty chunk right next to it being marked as explored. This doesn’t happen if I haven’t jumped down yet, as you can see in earlier screenshots.

This sounds to me as if the world is loading a backup, or an uncorrupted file in scenario D, one that still has all of the world data.

And generally speaking, it reads to me as if everything happening here is all stemming from one general root cause, namely, a faulty world file.

The only thing that stands out to me as particularly concerning is that you indicate that every Medium sized world you make in this way is faulty, so I guess that needs to be logged.
 
Last edited:
There is . . . a LOT going on here in this report.

To start with, it would help a lot if the world file in question were uploaded so we could take a look :)




This indicates that the world that you ended up creating was corrupted during the initial save process.




This sounds to me as if the world is loading a backup, or an uncorrupted file in scenario D, one that still has all of the world data.

And generally speaking, it reads to me as if everything happening here is all stemming from one general root cause, namely, a faulty world file.

The only thing that stands out to me as particularly concerning is that you indicate that every Medium sized world you make in this way is faulty, so I guess that needs to be logged.


Thanks for taking a look. I know it was a lot, but I wanted to be as thorough as I could be. You are correct that it seems to be happening for every single Medium world I create. Not large or small, just medium for whatever reason. That seed I provided results in the exact same kind of world every single time I try generating a new world file with it, and I've generated it maybe a dozen times just in attempt to try different things. I absolutely make sure I've destroyed any traces of old world files before I try generating a new one, and I've been naming them differently anyways, so if it's an issue with corrupt world files, that means my server would be generating them like that every time. It happens when the seed is completely randomized too. Also, I play 2 separate medium worlds on the server - one with the seed I'm giving you here that was initially generated in 1.4.0.1 with corruption (the seed was random at the time of creation), and the other is a random world created in 1.4.0.3 with crimson. There's a couple things I've thought of that I haven't tried yet, such as doing everything via commandline instead of the config file, or trying to generate it in server mode on a completely different machine all together (with no VMs), but otherwise it's being incredibly consistent for me. I'll be doing some more testing with different configurations and will let you know if anything made a difference.
 
Sorry, I forgot to attach a world file. Just for reference, I JUST generated this new file using the same configuration. The only thing I've done in this world is traveled all the way left and right to make sure it was still the same. It was still the same.

Edit: I didn't see any errors during the generation or during exit either. This is all I saw on the server when I started and then exited it for the very first time (post generation):

: Server started
<my ip> is connecting...
Brick has joined.
Brick has left.
exit
Saving world data: 2%
Saving world data: 7%
Saving world data: 12%
Saving world data: 17%
Saving world data: 22%
Saving world data: 28%
Saving world data: 33%
Saving world data: 40%
Saving world data: 45%
Saving world data: 53%
Saving world data: 61%
Saving world data: 70%
Saving world data: 78%
Saving world data: 85%
Saving world data: 93%
Saving world data: 100%
Validating world save: 4%
Validating world save: 21%
Validating world save: 35%
Validating world save: 52%
Validating world save: 71%
Validating world save: 96%
 

Attachments

  • Test.wld
    6.3 MB · Views: 65
I tried the same options via commandline on the same machine, same world generated with the same issue. But, I had 3 different results when I exited the server. First result:

/<mypath>/TerrariaServer: line 42: 18436 Segmentation fault (core dumped) ./${BASENAME}.bin.${ext} $@

I've seen some segfaults before when exiting, but couldn't find anything consistent and it was so rare that I couldn't figure out how to replicate it. The 2nd result looked perfectly normal. But for the third result...

it *seems* like it might be happening when a player exits while in that area of the world in the missing chunk. Could be 100% coincidental. When I tried to experiment with those conditions again, I hit a brand new error on exit:

* Assertion at ../../mono/utils/mono-os-mutex.h:73, condition `res != EINVAL' not met
/<mypath>/TerrariaServer: line 42: 19070 Aborted (core dumped) ./${BASENAME}.bin.${ext} $@

Issue with Mono?
 
I tried running the server directly on my desktop via command line options only (specs noted in the main post), generated with a new random seed, and I had the exact same issue with both the missing chunk on the right and it being labeled "unknown" in single player mode. I've attached this world file in this comment. The only thing I noticed this time is the "-world" option didn't seem to matter. It generated the file based on the -worldname option in the default location.

This is how I launched/generated the world (inside <terraria_path>/1404/Linux):
./TerrariaServer -port 7500 -maxplayers 4 -password <mypassword> -world <home>/.local/share/Terraria/Worlds/LocalTest.wld -autocreate 2 -worldname Test -secure 1 -noupnp 1 -difficulty 0
 

Attachments

  • Test.wld
    6.2 MB · Views: 71
Back
Top Bottom