cuberite / cuberite

A lightweight, fast and extensible game server for Minecraft

Home Page:https://cuberite.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server crashes when mining bedrock with hack client

dxomg opened this issue · comments

commented

Client version: Every client/ Server side bug
Server OS: Linux, Debian 11 bullseye Openvz virt
Cuberite Commit id: (from commit de5b89d built at: Thu Feb 17 19:02:07 UTC 2022t)

2022-03-19.15-58-24.mp4
commented

Someone should fix this

Please add a server log as asked for in the template. There should be a message why the server crashed.

commented

Please add a server log as asked for in the template. There should be a message why the server crashed.

[14:55:19] Player fermalbet has joined the game
[14:55:19] AddEntity: Entity at 0x7fe790269770 (cPlayer, ID 234) spawning in a non-existent chunk.
./Cuberite[0x6e5cb8]
./Cuberite[0x4c760d]
/lib/x86_64-linux-gnu/libc.so.6(+0x3bd60)[0x7fe7b3a42d60]
./Cuberite[0x42b202]
./Cuberite[0x42551b]
./Cuberite[0x42e191]
./Cuberite[0x5ef3a0]
./Cuberite[0x5ef5c9]
./Cuberite[0x5ef6cc]
./Cuberite[0x43b76b]
./Cuberite[0x43b218]
./Cuberite[0x716db1]
./Cuberite[0x722e6c]
./Cuberite[0x711ee6]
./Cuberite[0x6ffc46]
./Cuberite[0x437e56]
./Cuberite[0x4b023f]
./Cuberite[0x4b003f]
./Cuberite[0x6e16dc]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0xceed0)[0x7fe7b3cb4ed0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x8ea7)[0x7fe7b3dbbea7]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7fe7b3b04def]
[14:57:52] Failure report:

:( | Cuberite has encountered an error and needs to close
| SIGSEGV: Segmentation fault
|
| Cuberite Jenkins x86_64-linux-gnu -DCMAKE_BUILD_TYPE=Release (master) (id: #324)
| from commit 3a9bd50

Segmentation fault

commented

ive tested it with other commits and it works too

Fastbreak irrelevant.

Reproduce: Attempt to mine any block while under bedrock and in survival mode.

Problem:

GetDigSpeed calls IsInsideWater which causes asserts to fail (or crashes in release) since the player is not in a valid chunk.

Not sure how to resolve:

  • Kick players / ignore players in survival trying to break blocks from under bedrock?
  • Return false from IsInsideWater if below bedrock?
  • Return Air from GetBlock if not in a valid relative position?
  • Something else

Relevant logs:

[7e4af5d17d4eca2c|00:49:04] HandleLeftClick: {-94, 0, -21}; Face: 0; Stat: 0
[7e4af5d17d4eca2c|00:49:04] Assertion failed: cChunkDef::IsValidRelPos(a_RelPos), file: cuberite/src/ChunkData.cpp, line 24

Relevant backtrace:

  * frame #0: 0x00007ffff7a8003b libc.so.6`raise + 203
    frame #1: 0x00007ffff7a5f859 libc.so.6`abort + 299
    frame #2: 0x0000555555c4e8b8 Cuberite`(anonymous namespace)::IndicesFromRelPos(a_RelPos=(x = 8, y = -2, z = 4)) at ChunkData.cpp:24:3
    frame #3: 0x0000555555c5c121 Cuberite`ChunkDataStore<unsigned char, 4096ul, (unsigned char)0>::Get(this=0x00007fffe406d848, a_Position=(x = 8, y = -2, z = 4)) const at ChunkData.cpp:75:23
    frame #4: 0x0000555555600bdd Cuberite`ChunkBlockData::GetBlock(this=0x00007fffe406d848, a_Position=(x = 8, y = -2, z = 4)) const at ChunkData.h:80:66
    frame #5: 0x000055555569a5c4 Cuberite`cChunk::GetBlock(this=0x00007fffe406d738, a_RelCoords=(x = 8, y = -2, z = 4)) const at Chunk.h:147:70
    frame #6: 0x0000555555c4c4ac Cuberite`cChunk::GetBlockTypeMeta(this=0x00007fffe406d738, a_RelPos=(x = 8, y = -2, z = 4), a_BlockType=0x00007fffec604bbf, a_BlockMeta=0x00007fffec604bbe) const at Chunk.cpp:1774:16
    frame #7: 0x0000555555c52200 Cuberite`cChunkMap::GetBlockTypeMeta(this=0x00007ffff5ae0588, a_BlockPos=(x = -88, y = -2, z = -12), a_BlockType=0x00007fffec604bbf, a_BlockMeta=0x00007fffec604bbe) const at ChunkMap.cpp:595:10
    frame #8: 0x0000555555b572f4 Cuberite`cWorld::GetBlockTypeMeta(this=0x00007ffff5ae0050, a_BlockPos=(x = -88, y = -2, z = -12), a_BlockType=0x00007fffec604bbf, a_BlockMeta=0x00007fffec604bbe) const at World.cpp:1768:20
    frame #9: 0x00005555559f5263 Cuberite`cPlayer::IsInsideWater(this=0x00007fffbc007290) at Player.cpp:2582:11
    frame #10: 0x00005555559f54ec Cuberite`cPlayer::GetDigSpeed(this=0x00007fffbc007290, a_Block='\a') at Player.cpp:2647:6
    frame #11: 0x00005555559f56cf Cuberite`cPlayer::CanInstantlyMine(this=0x00007fffbc007290, a_Block='\a') at Player.cpp:2693:9
    frame #12: 0x0000555555c1d6cf Cuberite`cClientHandle::HandleBlockDigStarted(this=0x00007ffff0000c70, a_BlockX=-85, a_BlockY=0, a_BlockZ=-15, a_BlockFace=BLOCK_FACE_YM) at ClientHandle.cpp:1303:13
    frame #13: 0x0000555555c1cf31 Cuberite`cClientHandle::HandleLeftClick(this=0x00007ffff0000c70, a_BlockX=-85, a_BlockY=0, a_BlockZ=-15, a_BlockFace=BLOCK_FACE_YM, a_Status='\0') at ClientHandle.cpp:1199:4
commented

Thanks, KingCol13 it was my first issue

#5220 related.

Also crashes with pistons trying to push blocks below bedrock for the same reason.

Relevant backtrace:

* thread #10, name = 'Cuberite', stop reason = signal SIGABRT
  * frame #0: 0x00007ffff7a8003b libc.so.6`raise + 203
    frame #1: 0x00007ffff7a5f859 libc.so.6`abort + 299
    frame #2: 0x0000555555c4e8b8 Cuberite`(anonymous namespace)::IndicesFromRelPos(a_RelPos=(x = 9, y = -1, z = 13)) at ChunkData.cpp:24:3
    frame #3: 0x0000555555c5c121 Cuberite`ChunkDataStore<unsigned char, 4096ul, (unsigned char)0>::Get(this=0x0000555556e3a198, a_Position=(x = 9, y = -1, z = 13)) const at ChunkData.cpp:75:23
    frame #4: 0x0000555555600bdd Cuberite`ChunkBlockData::GetBlock(this=0x0000555556e3a198, a_Position=(x = 9, y = -1, z = 13)) const at ChunkData.h:80:66
    frame #5: 0x000055555569a5c4 Cuberite`cChunk::GetBlock(this=0x0000555556e3a088, a_RelCoords=(x = 9, y = -1, z = 13)) const at Chunk.h:147:70
    frame #6: 0x0000555555c4c4ac Cuberite`cChunk::GetBlockTypeMeta(this=0x0000555556e3a088, a_RelPos=(x = 9, y = -1, z = 13), a_BlockType=0x00007fffec62539f, a_BlockMeta=0x00007fffec62539e) const at Chunk.cpp:1774:16
    frame #7: 0x0000555555c52200 Cuberite`cChunkMap::GetBlockTypeMeta(this=0x00007ffff5ae0588, a_BlockPos=(x = 25, y = -1, z = -3), a_BlockType=0x00007fffec62539f, a_BlockMeta=0x00007fffec62539e) const at ChunkMap.cpp:595:10
    frame #8: 0x0000555555b572f4 Cuberite`cWorld::GetBlockTypeMeta(this=0x00007ffff5ae0050, a_BlockPos=(x = 25, y = -1, z = -3), a_BlockType=0x00007fffec62539f, a_BlockMeta=0x00007fffec62539e) const at World.cpp:1768:20
    frame #9: 0x0000555555a15469 Cuberite`cBlockPistonHandler::CanPushBlock(a_BlockPos=0x00007fffec625400, a_World=0x00007ffff5ae0050, a_RequirePushable=true, a_BlocksPushed=size=1, a_PushDir=0x00007fffec625640) at BlockPiston.cpp:229:10
    frame #10: 0x0000555555a15680 Cuberite`cBlockPistonHandler::CanPushBlock(a_BlockPos=0x00007fffec6255e8, a_World=0x00007ffff5ae0050, a_RequirePushable=true, a_BlocksPushed=size=1, a_PushDir=0x00007fffec625640) at BlockPiston.cpp:279:9
    frame #11: 0x0000555555a2267f Cuberite`cBlockPistonHandler::ExtendPiston(this=0x00007fffe41a7398, World=0x00007ffff5ae0050)::$_1::operator()(cWorld&) const at BlockPiston.cpp:80:9
    frame #12: 0x0000555555a22432 Cuberite`std::_Function_handler<void (cWorld&), cBlockPistonHandler::ExtendPiston(Vector3<int>, cWorld&)::$_1>::_M_invoke(__functor=0x00007fffe41a7398, __args=0x00007ffff5ae0050) at std_function.h:300:2