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 placing vehicle in group that used to contain 1 vehicle #7831

Closed
Montandalar opened this issue Nov 13, 2019 · 9 comments
Closed

Crash on placing vehicle in group that used to contain 1 vehicle #7831

Montandalar opened this issue Nov 13, 2019 · 9 comments

Comments

@Montandalar
Copy link

Version of OpenTTD

1.9.3

Expected result

The vehicle is placed in the empty group. There is now one vehicle in the group where previously there was none.

Actual result

Game crash

Steps to reproduce

  1. Have a group with only 1 road vehicle "Perenjori Bus".
  2. Have that vehicle destroyed by a UFO - may be hard to replicate, I know.
  3. Buy a new vehicle of the same kind, name it "Perenjori Memorial Bus".
  4. Try to place that vehicle in the old road vehicle group "Perenjori". The game crashes.

Zip file with log, png, dmp and emergency sav:

crash.zip

@glx22
Copy link
Contributor

glx22 commented Nov 13, 2019

>	openttd.exe!VehicleGroupWindow::OnDragDrop_Group(Point pt, int widget) Ligne 754	C++
 	openttd.exe!VehicleGroupWindow::OnDragDrop(Point pt, int widget) Ligne 815	C++
 	openttd.exe!HandleMouseDragDrop() Ligne 2003	C++
 	openttd.exe!MouseLoop(MouseClick click, int mousewheel) Ligne 2867	C++
 	openttd.exe!HandleMouseEvents() Ligne 3038	C++
 	openttd.exe!WndProcGdi(HWND__ * hwnd, unsigned int msg, unsigned __int64 wParam, __int64 lParam) Ligne 1007	C++
 	[Code externe]	
 	openttd.exe!VideoDriver_Win32::MainLoop() Ligne 1224	C++
 	openttd.exe!openttd_main(int argc, char * * argv) Ligne 870	C++
 	openttd.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * hPrevInstance, char * lpCmdLine, int nCmdShow) Ligne 443	C++
 	[Code externe]	

@glx22
Copy link
Contributor

glx22 commented Nov 13, 2019

if (this->group_sel != new_g && g->parent != new_g) {

g is null here but I don't see how it's even possible, and I fail to reproduce. BTW in crash.sav "Perenjori Memorial Bus" is in "Perenjori" group.

@LordAro
Copy link
Member

LordAro commented Nov 13, 2019

Perhaps groups are not updated properly when a vehicle is destroyed? Destroying a vehicle with a train might also work.

Looking at the code, probably have to have the GUI open the whole time as well - similar to the AI settings window crashes when an AI slot is changed.

@glx22
Copy link
Contributor

glx22 commented Nov 13, 2019

I already tried the train trick, with the GUI open. And when looking at the code the weird thing is to enter in VehicleGroupWindow::OnDragDrop_Group() while dragging the vehicle, that should not happen at all.

@Montandalar
Copy link
Author

I re-loaded an auto-save. The UFO came at around the same time, destroyed the old bus and I bought the new bus, named it and grouped it successfully. The underlying cause may have been different?

@HazelLessiter
Copy link

I got a crash when I created a group while I had another group selected. I'm unsure if it's related to this issue as well.
crash.zip
Here is my crash.dmp file

@Montandalar
Copy link
Author

I think this was resolved with #8223.

@LordAro
Copy link
Member

LordAro commented Nov 3, 2020

I agree. Duplicate of #7838

@LordAro LordAro closed this as completed Nov 3, 2020
@Montandalar
Copy link
Author

On second thought, I experienced a very similar crash just today. I accidentally bought an older model tram, so I bought and set it to clone the original one's orders with ctrl+go to in the orders window. I hadn't grouped the old tram, but I had made a group for it called Mulga Downs. I then added a second group under Local called Mulga Downs (should that even be possible?) before realising it was in error and deleting it. Then when I tried to move the new tram into the remaining group (sorry, no idea if it was the original or the 2nd group), the game crashed.

Crash zip:
crash_2020-11-05.zip

I also experienced a similar group-related crash yesterday but sorry, I think the files from that one were overwritten. I was playing on a server in that case but it only crashed my client.

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

4 participants