Warzone2100 / old-trac-import

Archived Import of (old) Warzone 2100 Trac
0 stars 0 forks source link

Host calls startMultiplayerGame() too many times, clients crash #2346

Closed wzdev-ci closed 14 years ago

wzdev-ci commented 14 years ago

keyword_crash resolution_fixed type_bug | by Cyp


All clients crash due to the host calling startMultiplayerGame() too many times, if the last client clicks ready too many times too fast.

Easy to reproduce in master. When trying to test why it seemed to be fixed in 3.0, I finally ended up reproducing it by clicking ready emphatically enough.

In master, complains about an unhandled NET_FIREUP, and crashes mysteriously. In 3.0, just crashes mysteriously (but probably did get an extra NET_FIREUP).

diff --git a/src/multiint.c b/src/multiint.c
index cd244f0..386a7d0 100644
--- a/src/multiint.c
+++ b/src/multiint.c
@@ -2833,6 +2833,8 @@ static void processMultiopWidgets(UDWORD id)
 /* Start a multiplayer or skirmish game */
 void startMultiplayerGame(void)
 {
+   debug(LOG_ERROR, "startMultiplayerGame()");
+
    decideWRF();                                        // set up swrf & game.map
    bMultiPlayer = true;
    bMultiMessages = true;

Host log: (Note extra startMultiplayerGame().)

error   |03:00:00: [PlayList_Read] PHYSFS_openRead("music/music.wpl") failed with error: File not found
error   |03:00:24: [startMultiplayerGame] startMultiplayerGame()
error   |03:00:25: [widgAddForm] widgAddForm: Could not find parent form from formID
error   |03:00:25: [widgAddForm] Assert in Warzone: ../../../lib/widget/widget.c:298 (0), last script event: 'N/A'
error   |03:00:25: [widgAddButton] widgAddButton: Could not find parent form from formID
error   |03:00:25: [widgAddButton] Assert in Warzone: ../../../lib/widget/widget.c:386 (0), last script event: 'N/A'
error   |03:00:25: [widgAddLabel] widgAddLabel: Could not find parent form from formID
error   |03:00:25: [widgAddLabel] Assert in Warzone: ../../../lib/widget/widget.c:342 (0), last script event: 'N/A'
error   |03:00:25: [startMultiplayerGame] startMultiplayerGame()
error   |03:00:25: [widgAddForm] widgAddForm: Could not find parent form from formID
error   |03:00:25: [widgAddForm] Assert in Warzone: ../../../lib/widget/widget.c:298 (0), last script event: 'N/A'
error   |03:00:25: [widgAddButton] widgAddButton: Could not find parent form from formID
error   |03:00:25: [widgAddButton] Assert in Warzone: ../../../lib/widget/widget.c:386 (0), last script event: 'N/A'
error   |03:00:25: [widgAddLabel] widgAddLabel: Could not find parent form from formID
error   |03:00:25: [widgAddLabel] Assert in Warzone: ../../../lib/widget/widget.c:342 (0), last script event: 'N/A'
error   |03:00:25: [widgAddForm] widgAddForm: Could not find parent form from formID
error   |03:00:25: [widgAddForm] Assert in Warzone: ../../../lib/widget/widget.c:298 (0), last script event: 'N/A'
error   |03:00:25: [widgAddButton] widgAddButton: Could not find parent form from formID
error   |03:00:25: [widgAddButton] Assert in Warzone: ../../../lib/widget/widget.c:386 (0), last script event: 'N/A'
error   |03:00:25: [widgAddLabel] widgAddLabel: Could not find parent form from formID
error   |03:00:25: [widgAddLabel] Assert in Warzone: ../../../lib/widget/widget.c:342 (0), last script event: 'N/A'
error   |03:00:25: [widgAddForm] widgAddForm: Could not find parent form from formID
error   |03:00:25: [widgAddForm] Assert in Warzone: ../../../lib/widget/widget.c:298 (0), last script event: 'N/A'
error   |03:00:25: [widgAddButton] widgAddButton: Could not find parent form from formID
error   |03:00:25: [widgAddButton] Assert in Warzone: ../../../lib/widget/widget.c:386 (0), last script event: 'N/A'
error   |03:00:25: [widgAddLabel] widgAddLabel: Could not find parent form from formID
error   |03:00:25: [widgAddLabel] Assert in Warzone: ../../../lib/widget/widget.c:342 (0), last script event: 'N/A'
error   |03:00:25: [widgAddForm] widgAddForm: Could not find parent form from formID
error   |03:00:25: [widgAddForm] Assert in Warzone: ../../../lib/widget/widget.c:298 (0), last script event: 'N/A'
error   |03:00:25: [widgAddButton] widgAddButton: Could not find parent form from formID
error   |03:00:25: [widgAddButton] Assert in Warzone: ../../../lib/widget/widget.c:386 (0), last script event: 'N/A'
error   |03:00:25: [widgAddLabel] widgAddLabel: Could not find parent form from formID
error   |03:00:25: [widgAddLabel] Assert in Warzone: ../../../lib/widget/widget.c:342 (0), last script event: 'N/A'
warning |03:00:26: [CheckpsMouseOverWidget] psMouseOverWidget (0x2c6eea0) has become dangling. Reseting.
info    |03:00:34: [NETrecv] Player, (player 1) seems to have dropped/disconnected.
info    |03:00:34: [NETrecv] sending NET_PLAYER_DROPPED for player 1 (invalid socket)
info    |03:00:34: [MultiPlayerLeave] ** Player 1 [Cyp], has left the game.

Issue migrated from trac:2346 at 2022-04-16 06:48:57 -0700

wzdev-ci commented 14 years ago

Buginator commented


I don't have a way to test this, but here is my 'easy' fix.

In theory, it should work, going by what you printed above. I think I got both cases.

Note, I was a bit lazy, and merged the conditions together--then again, even though that is a BOOL, we don't actually check the results, so it don't matter what we return.

wzdev-ci commented 14 years ago

Buginator uploaded file readyabuse.patch (2.1 KiB)

wzdev-ci commented 14 years ago

Cyp commented


Hmmm, for some reason, UTF-16 patches with \r\n line endings like the above seem to confuse the patch command.

wzdev-ci commented 14 years ago

Cyp commented


Fix clients and/or host crashing due to the last client clicking ready too many times. Based on patch by Buggy.

Throw in a few checks for changing player position or team, too.

Closes #2346.

Changelog: Fixed crash for all players when the last player clicks "Ready" too many times. Changeset: 1699da10cf0c517e567992fb71d2ccca78a1dfc7

wzdev-ci commented 14 years ago

Cyp changed status from new to closed

wzdev-ci commented 14 years ago

Cyp changed resolution from ` tofixed`

wzdev-ci commented 14 years ago

Cyp commented


Fix clients and/or host crashing due to the last client clicking ready too many times. Based on patch by Buggy.

Throw in a few checks for changing player position or team, too.

Closes #2346.

Changelog: Fixed crash for all players when the last player clicks "Ready" too many times. Changeset: eea0d0276ac0d295dcb6397d96cc32043cbca3be

wzdev-ci commented 14 years ago

Cyp commented


Fix clients and/or host crashing due to the last client clicking ready too many times. Based on patch by Buggy.

Throw in a few checks for changing player position or team, too.

Closes #2346.

Changelog: Fixed crash for all players when the last player clicks "Ready" too many times. Changeset: b665e9d8cf1edd3ad5274bb40af32911c9719fb2

wzdev-ci commented 13 years ago

Cyp commented


Fix clients and/or host crashing due to the last client clicking ready too many times. Based on patch by Buggy.

Throw in a few checks for changing player position or team, too.

Closes #2346.

Changelog: Fixed crash for all players when the last player clicks "Ready" too many times. Changeset: 1699da10cf0c517e567992fb71d2ccca78a1dfc7