Menu ▾ ▴

#702 -dedicated segfaults in R_Setup_SkyDraw when loading a map (textures not found); -server works

Linux only
open
nobody
None
5
2 days ago
2 days ago
No

Summary
Starting Doom Legacy with -dedicated and loading any map crashes with SIGSEGV in
R_Setup_SkyDraw. All textures (switches, SKY1, ...) are reported as missing just
before the crash. It happens with both doom2.wad and doom.wad. The same IWAD and
the same autoexec.cfg work fine with -server.

Versions tested (same result in both)

  • Doom Legacy 1.48.14 (rev 1663), doomlegacy_1.48.14_linux3.2_64_sdl1.tar.bz2
  • Doom Legacy 1.48.10, doomlegacy_1.48.10_linux3.2_64_sdl.tar.bz2
  • Also seen earlier on Debian 12

Platform

  • Ubuntu 22.04, x86_64 (VPS, no display)
  • IWADs tested: doom2.wad (14,951,361 bytes, "2928 lumps" as reported by Doom Legacy,
    map01 and others) and doom.wad (12,996,515 bytes, map e1m1 and others])
  • legacy.wad from the matching common.zip

Steps to reproduce

  1. Create autoexec.cfg next to the binary containing the single line:
    map map01 (for doom.wad: map [map name])
  2. Run:
    ./doomlegacy -dedicated -iwad doom2.wad
  3. After "Warping to map..." / "Setup Level" the program crashes.

Output (abridged, doom2.wad)
R_Init: Init DOOM refresh daemon - S_Init: Setting up sound.
ST_Init: Init status bar.
D_Startup_NetGame: Checking network game status.
Starting Server ...
Network port: 5029
Exec System autoexec
executing autoexec.cfg
Warping to map...
Setup Level
Warn: Switch 0 missing texture SW1BRCOM, using 1
... (same warning for all 40 switches)
Warn: R_TextureNumForName: SKY1 not found
Segmentation fault (core dumped)

Backtrace (gdb, doom2.wad)
Program received signal SIGSEGV, Segmentation fault.
#0 R_Setup_SkyDraw ()
#1 P_Setup_LevelSky ()
#2 P_SetupLevel ()
#3 G_DoLoadLevel ()
#4 Got_NetXCmd_Mapcmd ()
#5 ExtraDataTicker ()
#6 TryRunTics ()
#7 D_DoomLoop ()
#8 main ()

Additional observations

  • Running under a virtual display does not change anything:
    SDL_AUDIODRIVER=dummy xvfb-run -a ./doomlegacy -dedicated -iwad doom2.wad
    crashes the same way.
  • With -server instead of -dedicated (under xvfb-run) the log additionally shows
    "RequestFullGraphics...", "VID_SetMode(fullscreen,1)" and "HU_Init: Setting up
    heads up display", the map loads and a client can join and play. These lines
    never appear with -dedicated.
  • My guess (not verified in the source): in dedicated mode the texture tables are
    never initialised, and R_Setup_SkyDraw does not check that the sky texture exists.

Expected behaviour
A dedicated server (no local player) should load the map and accept clients.

Workaround
Use -server (with xvfb-run on a headless host), which however adds an unwanted
local player to the game.

Discussion


Log in to post a comment.