Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PPC64 server seems to be unable to handle player XYZ? #5538

Open
CursedSilicon opened this issue Dec 13, 2023 · 2 comments · May be fixed by #5543
Open

PPC64 server seems to be unable to handle player XYZ? #5538

CursedSilicon opened this issue Dec 13, 2023 · 2 comments · May be fixed by #5543

Comments

@CursedSilicon
Copy link

Client version: 1.8.9 (also tested 1.12, 1.9 and others)
Server OS: Gentoo Linux PPC64
Cuberite Commit id: 20d5cf0

Expected behavior

Player will be able to move

Actual behavior

Player appears to spawn underneath the world map (see attached video at end of comment) and is unable to move in any way. Server console seems to show wildly inaccurate location data(?)

Steps to reproduce the behavior

Build Cuberite for PowerPC 64-bit (Big Endian) platform and attempt to connect

Server log

[5cfe43c011634bfb|22:29:01] --- Started Log ---
[5cfe43c011634bfb|22:29:01] Cuberite local build (id: Unknown)
[5cfe43c011634bfb|22:29:01] from commit approx: 20d5cf0 built at: approx: 2023-11-20 18:12:52 +0800
[5cfe43c011634bfb|22:29:01] Creating new server instance...
[5cfe43c011634bfb|22:29:01] Reading server config...
[5cfe43c011634bfb|22:29:01] Starting server...
[5cfe43c011634bfb|22:29:01] Compatible clients: 1.8.x-1.14.4
[5cfe43c011634bfb|22:29:01] Compatible protocol versions 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340, 393, 401, 477, 480, 485, 490, 498
[5cfe43c011634bfb|22:29:01] Generating protocol encryption keypair...
[5cfe43c011634bfb|22:29:02] Initialising WebAdmin...
[5cfe43c011634bfb|22:29:02] The webadmin is enabled but has no users configured. To add new users, edit webadmin.ini
[5cfe43c011634bfb|22:29:02] WebServer: The server will run in unsecured HTTP mode.
[5cfe43c011634bfb|22:29:02] Put a valid HTTPS certificate in file 'webadmin/httpscert.crt' and its corresponding private key to 'webadmin/httpskey.pem' (without any password) to enable HTTPS support
[5cfe43c011634bfb|22:29:02] Loading settings...
[5cfe43c011634bfb|22:29:02] Loading crafting recipes from crafting.txt...
[5cfe43c011634bfb|22:29:02] Loaded 789 crafting recipes
[5cfe43c011634bfb|22:29:02] Cannot open file "Protocol/1.13/base.recipes.txt", no recipe book recipes will be available!
[5cfe43c011634bfb|22:29:02] Loaded 1.12.2 380 recipe book
[5cfe43c011634bfb|22:29:02] Cannot open file "Protocol/1.14.4/base.recipes.txt", no recipe book recipes will be available!
[5cfe43c011634bfb|22:29:02] Loading furnace recipes...
[5cfe43c011634bfb|22:29:02] Loaded 67 furnace recipes and 66 fuels
[5cfe43c011634bfb|22:29:02] Loading brewing recipes...
[5cfe43c011634bfb|22:29:02] Loaded 49 brewing recipes
[5cfe43c011634bfb|22:29:02] Loading worlds...
[5cfe43c011634bfb|22:29:02] cWorld::cWorld("world")
[5cfe43c011634bfb|22:29:02] Spawnpoint explicitly set!
[5cfe43c011634bfb|22:29:02] Allowed mob: bat
[5cfe43c011634bfb|22:29:02] Allowed mob: cavespider
[5cfe43c011634bfb|22:29:02] Allowed mob: chicken
[5cfe43c011634bfb|22:29:02] Allowed mob: cow
[5cfe43c011634bfb|22:29:02] Allowed mob: creeper
[5cfe43c011634bfb|22:29:02] Allowed mob: guardian
[5cfe43c011634bfb|22:29:02] Allowed mob: horse
[5cfe43c011634bfb|22:29:02] Allowed mob: mooshroom
[5cfe43c011634bfb|22:29:02] Allowed mob: ocelot
[5cfe43c011634bfb|22:29:02] Allowed mob: pig
[5cfe43c011634bfb|22:29:02] Allowed mob: rabbit
[5cfe43c011634bfb|22:29:02] Allowed mob: sheep
[5cfe43c011634bfb|22:29:02] Allowed mob: silverfish
[5cfe43c011634bfb|22:29:02] Allowed mob: skeleton
[5cfe43c011634bfb|22:29:02] Allowed mob: slime
[5cfe43c011634bfb|22:29:02] Allowed mob: spider
[5cfe43c011634bfb|22:29:02] Allowed mob: squid
[5cfe43c011634bfb|22:29:02] Allowed mob: wolf
[5cfe43c011634bfb|22:29:02] Allowed mob: zombie
[5cfe43c011634bfb|22:29:02] Using a cache for biomegen of size 16.
[5cfe43c011634bfb|22:29:02] Enabling multicache for biomegen of length 128.
[5cfe43c011634bfb|22:29:02] Invalid biome ("BambooJungle") specified in AllowedBiomes in cubeset file Prefabs/SinglePieceStructures/JungleTemple.cubeset. Skipping the biome.
[5cfe43c011634bfb|22:29:02] Invalid biome ("BambooJungleHills") specified in AllowedBiomes in cubeset file Prefabs/SinglePieceStructures/JungleTemple.cubeset. Skipping the biome.
[5cfe43c011634bfb|22:29:02] cWorld::cWorld("world_nether")
[5cfe43c011634bfb|22:29:02] Spawnpoint explicitly set!
[5cfe43c011634bfb|22:29:02] Allowed mob: blaze
[5cfe43c011634bfb|22:29:02] Allowed mob: ghast
[5cfe43c011634bfb|22:29:02] Allowed mob: magmacube
[5cfe43c011634bfb|22:29:02] Allowed mob: witherskeleton
[5cfe43c011634bfb|22:29:02] Allowed mob: zombiepigman
[5cfe43c011634bfb|22:29:02] cWorld::cWorld("world_the_end")
[5cfe43c011634bfb|22:29:02] Loading plugin manager...
[5cfe43c011634bfb|22:29:02] -- Loading Plugins --
[5cfe43c011634bfb|22:29:02] [Core] Initialised!
[5cfe43c011634bfb|22:29:02] [ChatLog] Initialized ChatLog v.3
[5cfe43c011634bfb|22:29:02] -- Loaded 2 Plugins --
[5cfe43c011634bfb|22:29:02] Loading MonsterConfig...
[5cfe43c011634bfb|22:29:02] Starting Authenticator...
[5cfe43c011634bfb|22:29:02] Starting worlds...
[243121b17a533b18|22:29:04] Preparing spawn (world): 77.78% (63/81; 43.06 chunks / sec)
[1696b70552c8af1e|22:29:06] Preparing spawn (world_nether): 1.23% (1/81; 0.73 chunks / sec)
[1696b70552c8af1e|22:29:07] Preparing spawn (world_nether): 12.35% (10/81; 7.78 chunks / sec)
[1696b70552c8af1e|22:29:08] Preparing spawn (world_nether): 18.52% (15/81; 4.13 chunks / sec)
[1696b70552c8af1e|22:29:09] Preparing spawn (world_nether): 34.57% (28/81; 10.33 chunks / sec)
[1696b70552c8af1e|22:29:12] Preparing spawn (world_nether): 45.68% (37/81; 3.40 chunks / sec)
[1696b70552c8af1e|22:29:13] Preparing spawn (world_nether): 48.15% (39/81; 1.87 chunks / sec)
[1696b70552c8af1e|22:29:14] Preparing spawn (world_nether): 69.14% (56/81; 15.32 chunks / sec)
[1696b70552c8af1e|22:29:16] Preparing spawn (world_nether): 77.78% (63/81; 5.01 chunks / sec)
[1696b70552c8af1e|22:29:17] Preparing spawn (world_nether): 85.19% (69/81; 5.90 chunks / sec)
[5cfe43c011634bfb|22:29:17] Generating random spawnpoint...
[5cfe43c011634bfb|22:29:18] World "world_the_end": Did not find an acceptable spawnpoint. Generated a random spawnpoint position at {0, 66, 0}
[5cfe43c011634bfb|22:29:18] Starting deadlock detector...
[5cfe43c011634bfb|22:29:18] Finalising startup...
[5cfe43c011634bfb|22:29:18] Starting WebAdmin...
[5cfe43c011634bfb|22:29:18] WebAdmin is running on port(s) 8080
[5cfe43c011634bfb|22:29:18] Startup complete, took 16468ms!

Relevant part of server log

[ef53c2cd64c4623e|22:29:46] Client "::ffff:192.168.1.148" connected!
[ef53c2cd64c4623e|22:29:46] New ClientHandle created at 0x3fffa4000c80
[1aa9a09fcedb2973|22:29:46] Trying to authenticate user CursedSilicon
[1aa9a09fcedb2973|22:29:46] User CursedSilicon authenticated with UUID 85fd0c3c22ce472bb739cc5469983627
[1aa9a09fcedb2973|22:29:46] Player "CursedSilicon" with save file "players/85/fd0c3c-22ce-472b-b739-cc5469983627.json" is spawning at {0.00, -0.00, 0.00} in world "world"
[1aa9a09fcedb2973|22:29:46] Player CursedSilicon has joined the game
[16b4fca2c5399e64|22:29:46] Adding player CursedSilicon to world "world".
[16b4fca2c5399e64|22:29:46] AddEntity: Entity at 0x3fff640051a0 (cPlayer, ID 46) spawning in a non-existent chunk.
[16b4fca2c5399e64|22:29:46] CursedSilicon is requesting ViewDistance of 10!
[16b4fca2c5399e64|22:29:47] CursedSilicon is requesting ViewDistance of 32!
[16b4fca2c5399e64|22:29:47] Too far away (4310087235265.25), "repairing" the client
[16b4fca2c5399e64|22:29:47] Too far away (239662203081927299575247653032559481070701430494196897086371676383848951139270656.00), "repairing" the client
[16b4fca2c5399e64|22:29:47] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:47] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:47] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:47] Too far away (31083534111890907998354842488216944694525952.00), "repairing" the client
[16b4fca2c5399e64|22:29:47] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:47] Too far away (36929684071012737024.00), "repairing" the client
[16b4fca2c5399e64|22:29:47] Too far away (36929684071012737024.00), "repairing" the client
[16b4fca2c5399e64|22:29:47] Too far away (36929684071012737024.00), "repairing" the client
[16b4fca2c5399e64|22:29:47] Too far away (243989122745579418035359309627392.00), "repairing" the client
[16b4fca2c5399e64|22:29:48] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:48] Too far away (30645093057508118665810685457430456213492032412210901228282748387699736734334976.00), "repairing" the client
[16b4fca2c5399e64|22:29:48] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:48] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:48] Too far away (33454132227726538828201214152289871423139050025848800280576.00), "repairing" the client
[16b4fca2c5399e64|22:29:48] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:49] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:49] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:49] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:49] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:49] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:49] Too far away (1932054092265447489536.00), "repairing" the client
[16b4fca2c5399e64|22:29:49] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:49] Too far away (4674145809519996549919145984.00), "repairing" the client
[16b4fca2c5399e64|22:29:49] Too far away (350031657143277568.00), "repairing" the client
[16b4fca2c5399e64|22:29:49] Too far away (833097417512626315924293888874566220637288746370563333684076291616045498519179419276076871763899384332288.00), "repairing" the client
[16b4fca2c5399e64|22:29:49] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:50] Too far away (179095790737741644980528298085600030970491520046543343877459260124653869777244736205048906987729183465422124399953283383296.00), "repairing" the client
[16b4fca2c5399e64|22:29:50] Too far away (512408358970245120.00), "repairing" the client
[16b4fca2c5399e64|22:29:50] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:50] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:50] Too far away (925965235654777671638762902730314946020371302569314274884041500231727766679796120387846144.00), "repairing" the client
[16b4fca2c5399e64|22:29:50] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:50] Too far away (29161779009555652228612279562751544831691756470464275207198772416158479413149696.00), "repairing" the client
[16b4fca2c5399e64|22:29:50] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:51] Too far away (15239129074381.85), "repairing" the client
[16b4fca2c5399e64|22:29:51] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:51] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:51] Too far away (617457608111370696677916672.00), "repairing" the client
[16b4fca2c5399e64|22:29:51] Too far away (1386338750307044160482805816387229764623031992148218810646629115847599518657838378730243269039476404385690948688936960.00), "repairing" the client
[16b4fca2c5399e64|22:29:51] Too far away (3944153089434.43), "repairing" the client
[16b4fca2c5399e64|22:29:51] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:51] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client
[16b4fca2c5399e64|22:29:51] Too far away (7126018399316005921426704530727650317483426483727306744046855938040048360540323446784.00), "repairing" the client
[16b4fca2c5399e64|22:29:51] Too far away (179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216.00), "repairing" the client

I've attached a video recording of both the game and the server console running side-by-side for a visual demonstration of what happens

I gave myself admin powers and attempted to respawn as well as use teleport commands but neither were able to change my X/Y/Z value from 0,0,0

https://youtu.be/4G7CtOYG_tg

@Archaemic
Copy link

Archaemic commented Dec 13, 2023

This appears to be an issue with the 8 byte endian swapping functions in Endianness.h

https://github.com/cuberite/cuberite/blob/master/src/Endianness.h#L5
https://github.com/cuberite/cuberite/blob/master/src/Endianness.h#L16

These implementations unconditionally swap the top and bottom 4 bytes, which only makes sense on little endian platforms. Adding an #ifdef __BIG_ENDIAN__ and then just passing the parameter through in that block will fix it. MSVC doesn't support that, but I don't think there are any big endian platfoms that MSVC compiles to so that doesn't really matter.

@indrora
Copy link

indrora commented Dec 13, 2023

The big question is: Why are you reimplementing a standard library call?

ntohll and friends exist in Win32's winsock.h, while on POSIX systems (really "linux and friends") you want the calls out of <endian.h>: htobe64 and be32toh.

Furthermore: C++20 now introduces std::endian (docs) which would be a good option (constexpr values are evaluated by the compiler and linker, making this a zero-cost runtime choice).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants