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

Open
Montandalar opened this issue Nov 13, 2019 · 6 comments
Open

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

Montandalar opened this issue Nov 13, 2019 · 6 comments

Comments

@Montandalar
Copy link

@Montandalar Montandalar commented Nov 13, 2019

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 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 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 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 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

@Montandalar Montandalar commented Nov 15, 2019

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

@HazelLessiter HazelLessiter commented Jan 23, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.