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

Redstone on Y:1 Crashes the server

dxomg opened this issue · comments

commented

Client version: Server side issue but 1.12.2
Server OS: Windows but im aware that also work on every other build
Cuberite Commit id: b2e5f4d

Expected behavior

When i make a redstone clock on Y:1 it would work

Actual behavior

but when i make a redstone clock on Y:1 it crashes the server

Steps to reproduce the behavior

Just make a redstone clock on Y:1 just above bedrock

Server log

Nothing relevant in here

Relevant part of server log:

Err [12:29:13] Deadlock detected: world world has been stuck at age 2141. Aborting the server.
[12:29:13] CS at 0x3830768, World world chunkmap: RecursionCount = 1, ThreadIDHash = d5c1b19f855c6526
[12:29:13] CS at 0x3f82090, World world tasks: RecursionCount = 0, ThreadIDHash = d5c1b19f855c6526
[12:29:13] CS at 0x53a0768, World world_nether chunkmap: RecursionCount = 0, ThreadIDHash = eabe61e44a3abecc
[12:29:13] CS at 0x5af2090, World world_nether tasks: RecursionCount = 0, ThreadIDHash = eabe61e44a3abecc
[12:29:13] CS at 0x6310768, World world_the_end chunkmap: RecursionCount = 0, ThreadIDHash = 81ec6fbfd5439f58
[12:29:13] CS at 0x6a62090, World world_the_end tasks: RecursionCount = 0, ThreadIDHash = 81ec6fbfd5439f58
[12:29:13] CS at 0x43419f8, cLuaState plugin APIDump: RecursionCount = 0, ThreadIDHash = 4d25767f9dce13f5
[12:29:13] CS at 0x4341488, cLuaState plugin ChatLog: RecursionCount = 0, ThreadIDHash = a42193f8f5519dd5
[12:29:13] CS at 0x4341bc8, cLuaState plugin Core: RecursionCount = 0, ThreadIDHash = 2edbd3b8085443bb
[12:29:13] CS at 0x4341d98, cLuaState plugin Debuggers: RecursionCount = 0, ThreadIDHash = 4d25767f9dce13f5
[12:29:13] CS at 0x4341f68, cLuaState plugin DumpInfo: RecursionCount = 0, ThreadIDHash = 4d25767f9dce13f5
[12:29:13] CS at 0x4342138, cLuaState plugin HookNotify: RecursionCount = 0, ThreadIDHash = 4d25767f9dce13f5
[12:29:13] CS at 0x4342308, cLuaState plugin NetworkTest: RecursionCount = 0, ThreadIDHash = 4d25767f9dce13f5
[12:29:13] CS at 0x43424d8, cLuaState plugin ProtectionAreas: RecursionCount = 0, ThreadIDHash = 4d25767f9dce13f5
[12:29:13] CS at 0x43426a8, cLuaState plugin TestLuaRocks: RecursionCount = 0, ThreadIDHash = 4d25767f9dce13f5
Err [12:29:13] Failure report:

:( | Cuberite has encountered an error and needs to close
| SIGABRT: Server self-terminated due to an internal fault
|
| Cuberite AppVeyor

(id: 2442)
| from commit b2e5f4d

Video: https://user-images.githubusercontent.com/101947415/163031364-0b402f5d-a0d4-4827-8a8b-f3b5573a305e.mp4

I was able to reproduce this but it doesn't need to be a clock... just powering redstone (I tried with torch and redstone block)
will crash the server (even a single piece of redstone)

I'm running my server locally on my Archlinux destkop
Cuberite: Self Compiled in debug mode

Here is the output of the server

[bc2160725585235d|21:01:23] Destroying entity #98 (cPickup) from chunk (10, -3)
[bc2160725585235d|21:01:24] Destroying entity #153 (cPickup) from chunk (7, 7)
[bc2160725585235d|21:01:24] Destroying entity #114 (cPickup) from chunk (11, -8)
[bc2160725585235d|21:01:24] Destroying entity #115 (cPickup) from chunk (11, -8)
[bc2160725585235d|21:01:25] HandleRightClick: {31, 0, -15}, face 1, Cursor {10, 16, 4}, Hand: true, HeldItem: redstonedust:0 * 1; Dist: 8.58
[bc2160725585235d|21:01:26] HandleRightClick: {29, 2, -15}, face 5, Cursor {16, 0, 8}, Hand: true, HeldItem: redstoneblock:0 * 1; Dist: 11.48
[bc2160725585235d|21:01:26] Destroying entity #147 (cPickup) from chunk (3, -11)
[bc2160725585235d|21:01:26] Destroying entity #148 (cPickup) from chunk (4, -11)
[bc2160725585235d|21:01:26] Destroying entity #143 (cPickup) from chunk (2, -11)
[bc2160725585235d|21:01:27] HandleLeftClick: {30, 2, -15}; Face: 2; Stat: 0
[bc2160725585235d|21:01:27] HandleRightClick: {31, 2, -14}, face 2, Cursor {15, 11, 0}, Hand: true, HeldItem: redstoneblock:0 * 1; Dist: 8.63
[bc2160725585235d|21:01:27] Assertion failed: cChunkDef::IsValidRelPos(a_RelPos), file /home/tonitch/cuberite/src/ChunkData.cpp, line 24
[bc2160725585235d|21:01:27] Terminate event raised from std::signal
./Cuberite(+0x2afcf4)[0x5593728e3cf4]
./Cuberite(+0x5bb0a9)[0x559372bef0a9]
/usr/lib/libc.so.6(+0x42560)[0x7f98270ca560]
/usr/lib/libc.so.6(+0x8f34c)[0x7f982711734c]
/usr/lib/libc.so.6(raise+0x18)[0x7f98270ca4b8]
/usr/lib/libc.so.6(abort+0xd3)[0x7f98270b4534]
./Cuberite(+0x6a6447)[0x559372cda447]
./Cuberite(+0x6b0664)[0x559372ce4664]
./Cuberite(+0xa8dde)[0x5593726dcdde]
./Cuberite(+0x137646)[0x55937276b646]
./Cuberite(+0x6a5beb)[0x559372cd9beb]
./Cuberite(+0x121a76)[0x559372755a76]
./Cuberite(+0x121c85)[0x559372755c85]
./Cuberite(+0x16234b)[0x55937279634b]
./Cuberite(+0x6a238d)[0x559372cd638d]
./Cuberite(+0x6ac7da)[0x559372ce07da]
./Cuberite(+0x5b2e4c)[0x559372be6e4c]
./Cuberite(+0x5ab20b)[0x559372bdf20b]
./Cuberite(+0x2ad0bd)[0x5593728e10bd]
./Cuberite(+0x2c3bce)[0x5593728f7bce]
./Cuberite(+0x2c3ab1)[0x5593728f7ab1]
./Cuberite(+0x2c3991)[0x5593728f7991]
./Cuberite(+0x2c3830)[0x5593728f7830]
./Cuberite(+0x2c36f8)[0x5593728f76f8]
/usr/lib/libstdc++.so.6(+0xd54d4)[0x7f982746a4d4]
/usr/lib/libc.so.6(+0x8d5c2)[0x7f98271155c2]
/usr/lib/libc.so.6(clone+0x44)[0x7f982719a584]
[bc2160725585235d|21:01:27] Failure report:

  :(   | Cuberite has encountered an error and needs to close
       | SIGABRT: Server self-terminated due to an internal fault
       |
       | Cuberite local build (id: Unknown)
       | from commit approx: de5b89dbea938db5a7ea58f59a9b1a91d0df4208

zsh: IOT instruction (core dumped)  ./Cuberite

Assertion is on this line :

ASSERT(cChunkDef::IsValidRelPos(a_RelPos));

I have noticed that it happens because

IsValidHeight(a_RelPos.y) &&
the y is set to -1 so the function return false

I assume this is due to redstone behavior to try and update the power of block below it and so It calls cChunkData::set with a y of -1 ans so it crash

I'm new to this project and I just started to analyze it. so I can't really pinpoint the problem here... might be on the RedstoneWireHandler.h somewhere