Opened 3 years ago

Last modified 2 years ago

#6320 closed defect

Start game - freeze before main menu - black or distorted graphics — at Version 10

Reported by: dave_k Owned by:
Priority: Should Have Milestone: Alpha 26
Component: Core engine Keywords: freeze, frozen, halt, hang, hung, stop, stuck, artifact, black, blank, corrupt, distort, garbage, garble
Cc: dave_k Patch:

Description (last modified by dave_k)

Summary
After upgrading to a new version, multiple users have experienced a problem where the game seems to be frozen and has black or distorted video output. User-installed mods seem to trigger this problem.

Removing all user-installed mod files seems to resolve the problem, but should only be considered a workaround. I think that this bug will still be experienced by users in the future due to design flaws in the game startup sequence.

Visual proof
Example 1 (dave_k's computer)
Symptoms on dave_k's computer - scaled down

Example 2 (dave_k's computer)
Symptoms on dave_k's computer - scaled down

Example 3 (Tirili's computer)
Example symptoms - Tirili's computer

Expected vs. actual results
Expected results: The game starts up, displays the main menu and thematic artwork, and plays music. The main menu responds to mouse clicks and the game functions correctly.

Actual results: The game starts, and the game window is all black or else very garbled with strange colors and a collage of various parts of the windows on the desktop. Mouse input has no effect other than moving the 0ad-themed mouse cursor around. No audio plays, not even music, despite resetting the user configuration.

Tirili is one such user who has experienced this problem. Based on a debugging session with Tirili, the main game loop is actually running, and the game responds correctly to keyboard input such as F2 for taking a screenshot. But the game is not usable.

Steps to reproduce

  1. If you are using Debian or a Debian-derived distribution of Linux such as Ubuntu, ensure that 0ad-data was not built with dh_strip_nondeterminism enabled for .zip files. This ensures reliable reproduction of the symptoms.
  1. Backup and remove all files and directories in /home/<yourusername>/.local/share/0ad/mods, or the equivalent path for your operating system. See GameDataPaths for equivalent paths on different operating systems.
  1. Extract two files from the attached file, "Tirili 0ad dot local share 0ad files aka 0adRenamed3.tar.gz", to /home/<yourusername>/.local/share/0ad/, or the equivalent Windows folder for user mods. The two files that one should extract, mods/user/gui/page_pregame.xml.cached.xmb and mods/user/gui/page_splashscreen.xml.cached.xmb, will produce a minimal test case that should reproduce the symptoms. See "Note" at the end of this section.
  1. Clear the 0ad cache (remove all files and folders in ~/.cache/0ad
  1. Start the game.

Note: Other files in the attached tarball are unnecessary. In fact, there are security issues with unverified mods, and I don't know whether or not Tirili avoided installing unverified mods. So, I would suggest testing with only the minimal test case of the two simple xmb files.

I have attached the entire user mods folder that Tirili sent as proof that this problem is practically occurring in a realistic user environment. Specifically, user mods were installed in the past, 0ad was upgraded and previously-invisible bugs were triggered.

Environnment
Two users have reported this problem so far, Tirili and Farid.
Tirili uses GNU/Linux. Slackware distribution. AMD APU (CPU combined with GPU) that is approximately 6 months old.
Farid uses GNU/Linux. Unknown distribution and hardware.
And, I am able to reproduce the symptoms with Debian GNU/Linux. Intel CPU and nVIDIA GPU.

Console logs
See attached file, "2021-08-21 bug report from Tirili - backtrace.txt". Note that the last console log message is "TIMER| ps_lang_hotkeys: 1.00483 ms". Also note that the current source line in the backtrace is just where it happened to be at the time that I asked Tirili to press Ctrl-C in order to obtain a backtrace. The game loop is able to continue normally and calls to Render() and LimitFPS() complete. Yet the game window video output remains black (or garbled, depending on the test environment).

Related tickets
I plan to post additional tickets for the following related issues.

  1. Add diagnostics: listing files accessed and gui error messages on console and in log file instead of only in graphical window. The latter can't be read if the GUI is not working correctly.
  2. Add ability to enable verbose startup, error and warning messages or logging.
  3. Add detection of broken mods and offer to reset mod configuration. Or, support a command line switch to reset the mod configuration. Or, support a command line switch to enable "safe mode" where mods are disabled, and advanced graphics features are also disabled.

Change History (19)

by dave_k, 3 years ago

Attachment: screenshot0001.png added

Example symptoms on dave_k's computer

by dave_k, 3 years ago

Attachment: screenshot0002.png added

Example symptoms on dave_k's computer

comment:1 by dave_k, 3 years ago

Description: modified (diff)

by dave_k, 3 years ago

Symptoms on dave_k's computer - scaled down

by dave_k, 3 years ago

Symptoms on dave_k's computer - scaled down

comment:2 by dave_k, 3 years ago

Description: modified (diff)

comment:3 by dave_k, 3 years ago

Description: modified (diff)

comment:4 by dave_k, 3 years ago

Description: modified (diff)

comment:5 by dave_k, 3 years ago

Description: modified (diff)

by dave_k, 3 years ago

Attachment: tirili screenshot.png added

Example symtoms - Tirili's computer

comment:6 by dave_k, 3 years ago

Description: modified (diff)

by dave_k, 3 years ago

Example symptoms - Tirili's computer

comment:7 by dave_k, 3 years ago

Description: modified (diff)

comment:8 by Langbart, 3 years ago

Related IRC 0ad-dev conversation 31/May/21:

10:03 < Langbart> wraitii when I distribute my mod I run the pyrogenesis command. After rP25375 it creates some xmb files in this folder: /Users/picus/Library/Application Support/0ad/mods/user. Changing the appearance of the game even if no mod is enabled.
10:03 < Langbart> Is the problem with my mod, do I need to make changes in the mod that this does not occur anymore?
10:04 < wraitii> what is that xmb file?
10:04 < Langbart> https://pasteall.org/media/6/7/6769447654b2bf964acce130fb462669.png
10:06 < wraitii> mh, well that's peculiar
10:06 < wraitii> Can you clear your cache, your user/ mod folder, and retry?
10:06 < Langbart> This xmb file is created when I enable the pyromod mod.
10:09 < Langbart> When I create the pyromod mod with rP25374 and enable the mod --> no file is created, but with 25375 there is. I deleted the cache and the contents of user/ mod folder as well.
10:10 < wraitii> and only that file?
10:10 < wraitii> can you send me your mod?
10:10 < Langbart> hmm

  • Summarize: When I created a mod with the SVN version after [25375] and enabled this mod with A24, some files were created in my 0ad/mod/user folder. Since I created my mods after [25375] and enabled them using A25, there were no problems. All good :)

by Langbart, 3 years ago

Attachment: picus_xmb.jpg added

by dave_k, 3 years ago

Console logs and backtrace during problem reproduction by Tirili

comment:9 by dave_k, 3 years ago

Description: modified (diff)
Keywords: corrupt added

comment:10 by dave_k, 3 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.