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

Crash on loading world #4402

Open
Seadragon91 opened this issue Sep 28, 2019 · 1 comment

Comments

@Seadragon91
Copy link
Contributor

@Seadragon91 Seadragon91 commented Sep 28, 2019

Client version: 1.12.2
Server OS: Windows

Actual behavior

Server crashed on loading world. Tried many times to reproduce it no luck.

>	[Inline Frame] Cuberite.exe!std::_Uninitialized_move(Vector3<int> * const) Line 1697	C++
 	[Inline Frame] Cuberite.exe!std::vector<Vector3<int>,std::allocator<Vector3<int> > >::_Umove(Vector3<int> *) Line 1558	C++
 	Cuberite.exe!std::vector<Vector3<int>,std::allocator<Vector3<int> > >::_Emplace_reallocate<Vector3<int> const &>(Vector3<int> * const _Whereptr, const Vector3<int> & <_Val_0>) Line 708	C++
 	[Inline Frame] Cuberite.exe!std::vector<Vector3<int>,std::allocator<Vector3<int> > >::emplace_back(const Vector3<int> &) Line 661	C++
 	[Inline Frame] Cuberite.exe!std::vector<Vector3<int>,std::allocator<Vector3<int> > >::push_back(const Vector3<int> &) Line 670	C++
 	[Inline Frame] Cuberite.exe!cIncrementalRedstoneSimulatorChunkData::WakeUp(const Vector3<int> &) Line 18	C++
 	Cuberite.exe!cIncrementalRedstoneSimulator::AddBlock(Vector3<int> a_Block, cChunk * a_Chunk) Line 37	C++
 	Cuberite.exe!cSimulator::WakeUp(Vector3<int> a_Block, cChunk * a_Chunk) Line 36	C++
 	[Inline Frame] Cuberite.exe!cChestEntity::OnSlotChanged::__l5::<lambda>(cChunk &) Line 96	C++
 	Cuberite.exe!cFunctionRef<bool __cdecl(cChunk &)>::ObjectFunctionCaller<bool <lambda>(cChunk &) >(void * a_Callable, cChunk & <a_Args_0>) Line 71	C++
 	[Inline Frame] Cuberite.exe!cFunctionRef<bool __cdecl(cChunk &)>::operator()(cChunk &) Line 57	C++
 	Cuberite.exe!cChunkMap::DoWithChunk(int a_ChunkX, int a_ChunkZ, cFunctionRef<bool __cdecl(cChunk &)> a_Callback) Line 305	C++
 	[Inline Frame] Cuberite.exe!cChunkMap::DoWithChunkAt(Vector3<int>) Line 316	C++
 	[Inline Frame] Cuberite.exe!cWorld::DoWithChunkAt(Vector3<int>) Line 1568	C++
 	Cuberite.exe!cChestEntity::OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum) Line 101	C++
 	Cuberite.exe!cItemGrid::TriggerListeners(int a_SlotNum) Line 824	C++
 	Cuberite.exe!cItemGrid::SetSlot(int a_SlotNum, const cItem & a_Item) Line 153	C++
 	Cuberite.exe!cWSSAnvil::LoadItemGridFromNBT(cItemGrid & a_ItemGrid, const cParsedNBT & a_NBT, int a_ItemsTagIdx, int) Line 869	C++
 	Cuberite.exe!cWSSAnvil::LoadChestFromNBT(const cParsedNBT & a_NBT, int a_TagIdx, unsigned char a_BlockType, unsigned char a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ) Line 1095	C++
 	Cuberite.exe!cWSSAnvil::LoadBlockEntityFromNBT(const cParsedNBT & a_NBT, int a_Tag, int a_BlockX, int a_BlockY, int a_BlockZ, unsigned char a_BlockType, unsigned char a_BlockMeta) Line 738	C++
 	Cuberite.exe!cWSSAnvil::LoadBlockEntitiesFromNBT(std::map<int,cBlockEntity *,std::less<int>,std::allocator<std::pair<int const ,cBlockEntity *> > > & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx, unsigned char * a_BlockTypes, unsigned char * a_BlockMetas) Line 672	C++
 	Cuberite.exe!cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT & a_NBT, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & a_RawChunkData) Line 424	C++
 	Cuberite.exe!cWSSAnvil::LoadChunkFromData(const cChunkCoords & a_Chunk, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & a_Data) Line 333	C++
 	Cuberite.exe!cWSSAnvil::LoadChunk(const cChunkCoords & a_Chunk) Line 149	C++
 	Cuberite.exe!cWorldStorage::LoadChunk(int a_ChunkX, int a_ChunkZ) Line 293	C++
 	[Inline Frame] Cuberite.exe!cWorldStorage::LoadOneChunk() Line 238	C++
 	Cuberite.exe!cWorldStorage::Execute() Line 217	C++
 	[External Code]	
 	[Inline Frame] Cuberite.exe!invoke_thread_procedure(unsigned int(*)(void *)) Line 91	C++
 	Cuberite.exe!thread_start<unsigned int (__cdecl*)(void * __ptr64)>(void * const parameter) Line 115	C++

Looking at the stack trace:

  • Server loads a chunk containing a chest
  • Chest contains items and items are loaded
  • Loading the items triggers the cChestEntity::OnSlotChanged
  • This wakes up the redstone simulator
  • A Vector3 is pushed into a vector map

Something here is in a invalid state and this crashes the server.

@madmaxoft

This comment has been minimized.

Copy link
Member

@madmaxoft madmaxoft commented Sep 28, 2019

I'd venture a guess that while the chunk is being loaded,it doesn't have proper redstone simulator data attached to it (can't have, the cChunk object doesn't exist at this point). For unknown reason cChunkMap::DoWithChunkAt still manages to find a semi-valid chunk and execute code on it. Perhaps cChestEntity's world is not properly initialized, so it contains garbage while loading?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.