Random Chitchat 2012-2016
What? how?
Thanks given by:
well i was strip-mining in survival and when i came up i saw all the pickups at the surface.
Thanks given by:
Ah, finally a description that makes sense. I suppose that would be because I fiddled with the cTracer code - it had been throwing asserts at me.
I think for now the best thing to do is put it in the bug tracker, I'm working on other things right now so can't fix bugs.
Thanks given by:
added to the bug tracker: http://www.mc-server.org/support/index.p...&sort=desc
Thanks given by:
i found a bug in the OnPlayerPlacingBlock/OnPlayerPlacedBlock hook. it doesn't get fired if you place: a water bucket, a lava bucket or flint & steel.
Thanks given by:
Because that's not exactly placement, it's item use. So you need to use the OnPlayerUsingItem / OnPlayerUsedItem hooks.
Thanks given by:
Just found a deadlock. Maybe that's the cause of all those reports of server not responding after a while.

Thread 1 callstack:
Code:
MCServer_debug.exe!cCSLock::cCSLock(cCriticalSection & a_CS={...})  Line 127    C++
MCServer_debug.exe!cChunkMap::GetBlock(int a_BlockX=0x0000000f, int a_BlockY=0x00000007, int a_BlockZ=0x0000000f)  Line 955 + 0xc bytes    C++
MCServer_debug.exe!cWorld::GetBlock(int a_X=0x0000005f, int a_Y=0x00000007, int a_Z=0xffffffcf)  Line 1095    C++
MCServer_debug.exe!cPickup::HandlePhysics(float a_Dt=0.10000000)  Line 113 + 0x21 bytes    C++
MCServer_debug.exe!cEntity::Tick(float a_Dt=100.00000, MTRand & a_TickRandom={...})  Line 257 + 0x16 bytes    C++
MCServer_debug.exe!cPickup::Tick(float a_Dt=100.00000, MTRand & a_TickRandom={...})  Line 66    C++
MCServer_debug.exe!cWorld::Tick(float a_Dt=100.00000)  Line 494 + 0x33 bytes    C++
MCServer_debug.exe!cRoot::TickWorlds(float a_Dt=100.00000)  Line 354 + 0x17 bytes    C++

Thread 2 callstack:
Code:
MCServer_debug.exe!cCSLock::cCSLock(cCriticalSection & a_CS={...})  Line 127    C++
MCServer_debug.exe!cWorld::AddEntity(cEntity * a_Entity=0x20aa2680)  Line 2092 + 0x11 bytes    C++
MCServer_debug.exe!cEntity::Initialize(cWorld * a_World=0x02860040)  Line 122    C++
MCServer_debug.exe!cPickup::Initialize(cWorld * a_World=0x02860040)  Line 46    C++
MCServer_debug.exe!cChunk::SetAllData(const unsigned char * a_BlockTypes=0x0318fdb4, const unsigned char * a_BlockMeta=0x03187dac, const unsigned char * a_BlockLight=0x00000000, const unsigned char * a_BlockSkyLight=0x00000000, ...)  Line 302 + 0x26 bytes    C++
MCServer_debug.exe!cChunkMap::SetChunkData(int a_ChunkX=0xfffffff6, int a_ChunkY=0x00000000, int a_ChunkZ=0xfffffff7, ...)  Line 758    C++
MCServer_debug.exe!cWorld::SetChunkData(int a_ChunkX=0xfffffff6, int a_ChunkY=0x00000000, int a_ChunkZ=0xfffffff7, ...)  Line 1611    C++
MCServer_debug.exe!cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk={...}, const cParsedNBT & a_NBT={...})  Line 371    C++
MCServer_debug.exe!cWSSAnvil::LoadChunkFromData(const cChunkCoords & a_Chunk={...}, ...)  Line 243 + 0x13 bytes    C++
MCServer_debug.exe!cWSSAnvil::LoadChunk(const cChunkCoords & a_Chunk={...})  Line 104 + 0x10 bytes    C++
MCServer_debug.exe!cWorldStorage::LoadChunk(int a_ChunkX=0xfffffff6, int a_ChunkY=0x00000000, int a_ChunkZ=0xfffffff7)  Line 382 + 0x21 bytes    C++

Thread 1 has the cWorld::m_CSEntities critical section locked and is requesting cWorld::m_ChunkMap::m_CS (via cWorld::GetBlock())
Thread 2 has the cWorld::m_ChunkMap::m_CS critical section locked and is requesting cWorld::m_CSEntities (via cWorld::AddEntity())
Thanks given by:
Is that committed now?
Thanks given by:
No, I haven't fixed that deadlock yet. I have thought about a hotfix which would probably work, but I'd prefer a more systematic solution, so I'll keep it in my head for a bit longer.
Thanks given by:
Hotfix didn't work (as expected), so I'm implementing a proper fix. It's proving to be rather big, however. It requires me to rewrite how entities are handled by MCServer.
Right now the cWorld object has a list of all entities and each chunk has a copy of that list that contains that chunk's entities. I need to get rid of cWorld's global list and make the chunks' lists the one and only true list of entities. Ouch!
Thanks given by:




Users browsing this thread: 95 Guest(s)