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 save on macOS #8935

Closed
smsm1 opened this issue Apr 3, 2021 · 11 comments
Closed

Crash on save on macOS #8935

smsm1 opened this issue Apr 3, 2021 · 11 comments

Comments

@smsm1
Copy link

@smsm1 smsm1 commented Apr 3, 2021

Version of OpenTTD

1.11.0
zip download

Expected result

When saving the game, the game should continue.

Actual result

The game might be saved properly, the application crashes with the error:

Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: Assertion failed: Block was expected to execute on queue [com.apple.main-thread]

otp_crash.log

Steps to reproduce

  1. Start or load a saved game
  2. Play the game for a bit
  3. Save the game
  4. On clicking the save button when choosing the file name the game save file is created and then there is the crash.

I can reproduce this on both a Mac Mini 2018 Intel and MacBook Pro M1.

Previous versions (1.10.3) didn't have this issue.

Screenshot 2021-04-03 at 08 20 07

@andythenorth
Copy link
Contributor

@andythenorth andythenorth commented Apr 3, 2021

Confirmed with 1.11.0. Haven't bisected, but a quick test of 1.11.0 Beta 2 didn't trigger this issue.

@smsm1
Copy link
Author

@smsm1 smsm1 commented Apr 3, 2021

e56d2c6 has the crash.
The commit parent of the above one i.e. 3a4a15c does not have the crash when compiling locally with cmake ..; make -j 8.

@michicc
Copy link
Member

@michicc michicc commented Apr 3, 2021

I'm currently unable to test this myself, but https://gist.github.com/michicc/1c6f8f0b5322c2cb8f0acc908d6b755a might possibly fix this issue.

@amf0336
Copy link

@amf0336 amf0336 commented Apr 3, 2021

When a crash occurs during a save operation, the file can not be used to load a game.

Overwriting an existing save file always works.

@smsm1
Copy link
Author

@smsm1 smsm1 commented Apr 3, 2021

@michicc on master branch with your patch I have been unable to reproduce the crash and it is now working as expected. Without the patch the crash occurs.

@amf0336 I can confirm the behaviour that you are seeing too. With the above patch the issue goes away, as I've been able to load any of the files I've saved.

@michicc
Copy link
Member

@michicc michicc commented Apr 3, 2021

@smsm1 If it's not too much a bother, could you try the patch with both waitUntilDone:NO and waitUntilDone:YES? Principally, YES would be more correct, but I'm worried about it causing a thread stall.

I'm going to prepare a pull request tomorrow for this.

@smsm1
Copy link
Author

@smsm1 smsm1 commented Apr 4, 2021

Screenshot 2021-04-04 at 08 17 12

When I use waitUntilDone:YES, when clicking save I get a beachball and openttd is completely unresponsive.

@michicc
Copy link
Member

@michicc michicc commented Apr 4, 2021

Thanks, then NO it is.

michicc added a commit to michicc/OpenTTD that referenced this issue Apr 4, 2021
michicc added a commit to michicc/OpenTTD that referenced this issue Apr 4, 2021
@michicc michicc closed this as completed in 1cd3a3b Apr 5, 2021
LordAro pushed a commit to LordAro/OpenTTD that referenced this issue Apr 17, 2021
@rafalkrupinski
Copy link

@rafalkrupinski rafalkrupinski commented Apr 15, 2022

I'm experiencing this bug, latest version, same message, but ONLY if I save by hitting enter in the save dialog

@TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Apr 15, 2022

Can you please create a new bug-report, with the crash log attached? It is possible, although the issues look alike, that they aren't. With a fresh bug-report and crash log we can look into that :)

Thank you!

@rafalkrupinski
Copy link

@rafalkrupinski rafalkrupinski commented Apr 15, 2022

Can you please create a new bug-report

#9856

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

6 participants