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

kdtree asserting when removing station #7461

Closed
SamuXarick opened this issue Apr 2, 2019 · 4 comments
Closed

kdtree asserting when removing station #7461

SamuXarick opened this issue Apr 2, 2019 · 4 comments

Comments

@SamuXarick
Copy link
Contributor

SamuXarick commented Apr 2, 2019

Sorry, this crash triggered when I was testing a custom build… will try to see if I can make it crash in master.

Version of OpenTTD

2019-04-02-variable-script_max_op_codes-me1aa0e3e71

Expected result

No crash

Actual result

crash

Steps to reproduce

 	KernelBase.dll!00007ffc3642a388()	Unknown
 	openttd.exe!raise(int signum) Line 516	C++
 	openttd.exe!abort() Line 71	C++
 	openttd.exe!error(const char * s, ...) Line 126	C++
 	openttd.exe!Kdtree<ViewportSignKdtreeItem,int (__cdecl*)(ViewportSignKdtreeItem const &,int),int,int>::RemoveRecursive(const ViewportSignKdtreeItem & element, unsigned __int64 node_idx, int level) Line 213	C++
 	openttd.exe!Kdtree<ViewportSignKdtreeItem,int (__cdecl*)(ViewportSignKdtreeItem const &,int),int,int>::RemoveRecursive(const ViewportSignKdtreeItem & element, unsigned __int64 node_idx, int level) Line 216	C++
 	openttd.exe!Kdtree<ViewportSignKdtreeItem,int (__cdecl*)(ViewportSignKdtreeItem const &,int),int,int>::RemoveRecursive(const ViewportSignKdtreeItem & element, unsigned __int64 node_idx, int level) Line 216	C++
 	openttd.exe!Kdtree<ViewportSignKdtreeItem,int (__cdecl*)(ViewportSignKdtreeItem const &,int),int,int>::RemoveRecursive(const ViewportSignKdtreeItem & element, unsigned __int64 node_idx, int level) Line 216	C++
 	openttd.exe!Kdtree<ViewportSignKdtreeItem,int (__cdecl*)(ViewportSignKdtreeItem const &,int),int,int>::RemoveRecursive(const ViewportSignKdtreeItem & element, unsigned __int64 node_idx, int level) Line 216	C++
 	openttd.exe!Kdtree<ViewportSignKdtreeItem,int (__cdecl*)(ViewportSignKdtreeItem const &,int),int,int>::RemoveRecursive(const ViewportSignKdtreeItem & element, unsigned __int64 node_idx, int level) Line 216	C++
 	openttd.exe!Kdtree<ViewportSignKdtreeItem,int (__cdecl*)(ViewportSignKdtreeItem const &,int),int,int>::RemoveRecursive(const ViewportSignKdtreeItem & element, unsigned __int64 node_idx, int level) Line 216	C++
 	openttd.exe!Kdtree<ViewportSignKdtreeItem,int (__cdecl*)(ViewportSignKdtreeItem const &,int),int,int>::RemoveRecursive(const ViewportSignKdtreeItem & element, unsigned __int64 node_idx, int level) Line 216	C++
 	openttd.exe!Kdtree<ViewportSignKdtreeItem,int (__cdecl*)(ViewportSignKdtreeItem const &,int),int,int>::RemoveRecursive(const ViewportSignKdtreeItem & element, unsigned __int64 node_idx, int level) Line 216	C++
 	openttd.exe!Kdtree<ViewportSignKdtreeItem,int (__cdecl*)(ViewportSignKdtreeItem const &,int),int,int>::Remove(const ViewportSignKdtreeItem & element) Line 414	C++
>	openttd.exe!Station::~Station() Line 167	C++
 	[External Code]	
 	[Inline Frame] openttd.exe!StationHandleBigTick(BaseStation *) Line 3271	C++
 	openttd.exe!OnTick_Station() Line 3694	C++
 	openttd.exe!CallLandscapeTick() Line 1397	C++
 	openttd.exe!StateGameLoop() Line 1375	C++
 	openttd.exe!GameLoop() Line 1463	C++
 	openttd.exe!VideoDriver_Win32::MainLoop() Line 1275	C++
 	openttd.exe!openttd_main(int argc, char * * argv) Line 849	C++
 	openttd.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Line 443	C++
 	[External Code]	

assert(next != INVALID_NODE); // node must exist somewhere and must be found before a leaf is reached
line 213 of kdtree.hpp

@nielsmh
Copy link
Contributor

nielsmh commented Apr 3, 2019

Need a series of steps to trigger the error, or a savegame that will trigger it.

@SamuXarick
Copy link
Contributor Author

Couldn't manage to make it crash in master yet. It was in a all Random AIs + Company Value GS game. Map size wasn't that big, 256x256 if I recall. It crashed rather early too, about a few months into the game.

I'm still trying to make it crash in master.

@SamuXarick
Copy link
Contributor Author

SamuXarick commented Apr 4, 2019

OpenTTD.zip - crash files
Crashed again, but not on master. I'm disappointed that I can't be of better help.
EDIT: The exact build was this: SamuXarick@a702fbc

EDIT2: on the savegame, the station is named Funham Central, it's a demolished station at tile 106034, from white company, RoadAI.

@nielsmh
Copy link
Contributor

nielsmh commented Dec 31, 2019

Likely solved by #7849

@nielsmh nielsmh closed this as completed Dec 31, 2019
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

No branches or pull requests

2 participants