P2: A table missing its end tag hangs the game at startup with no message
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 47/100
Direzione di ricerca
Start with the loop in lighting_profiles.cpp:365 and the EOF behavior of stuff_string in parselo.cpp; the issue reports a reproducible hang using data/tables/test-ltp.tbm without #END PROFILES. Then inspect the similar loops in the nebula and list parsers mentioned in the report. Done means EOF no longer hangs startup and a release build reports a clear parse error for the missing terminator; only the lighting profile case was run.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
A lighting profile table (lighting_profiles.tbl or a *-ltp.tbm) that ends without its #END PROFILES tag hangs the game at startup. The window never opens, one core sits at 100%, and nothing is written to the log, so the player has no idea which mod or which file is at fault. In a debug build the same file ends in a parse error dialog, which is the behavior a release build should also have.
The same shape exists in a few other table parsers that loop "until the end tag" and fall back to stuff_string or advance_to_eoln when a line is unknown: at end of file those calls do not advance, so the loop never ends. nebula.tbl missing its #end, and string or boolean lists missing their closing ) at end of file, behave the same way from reading the code. Only the lighting profile case was run.
Steps to reproduce
- FSO master 12a36dc1a (also current as of 76219fd1e;
lighting_profiles.cppandparselo.cppare unchanged between them), release build, Linux, MediaVPs 5.0.2. - Make a mod with one file,
data/tables/test-ltp.tbm, containing exactly:
(no#PROFILES $Profile: Test $Exposure: 4#END PROFILESline). - Launch the game with that mod active.
Expected vs. actual behavior
Expected: the game starts, and either the profile loads with the missing tag tolerated, or a clear error names the file ("missing #END PROFILES in test-ltp.tbm").
Actual: the process never reaches the main hall. After two minutes it was still at 99.6% CPU with no log output. A debugger shows the main thread looping in lighting_profiles::profile::parse through optional_string and strncasecmp, called from parse_modular_table inside game_init. The loop at lighting_profiles.cpp:365 keeps asking for the end tag, finds nothing it recognizes, and the stuff_string(buffer, F_RAW) fallback at end of file reads an empty string without moving the parse pointer. The Warning() that would have named the line is compiled out of release builds.
Proposed fixes
- Stop the loop at end of file. In
profile::parse(and the matching nebula and list loops), break when the parse pointer reaches the end of the text, then raise a parse error naming the missing tag. A few lines each, release-visible. - Make the parser primitives refuse to stand still at EOF. Have
advance_to_eolnand the raw-string path ofstuff_stringraise a parse exception when called with the pointer already at the terminating NUL. One change covers every "until end tag" loop in the tree, but it needs a check that no existing table relies on a trailing read at EOF being harmless. - Add an EOF guard to
optional_string_either/required_string_either. Return the "end" branch when no more text remains, so every loop written against those helpers terminates. Smaller blast radius than 2, but misses loops written against plainoptional_string.
- Lingua principale
- C++
- Stelle
- 488
- Fork
- 184
- Merge medio
- 2g 9h
- PR unite (30g)
- 40
Preparare l'ambiente
Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di scp-fs2open/fs2open.github.com
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
scp-fs2open/fs2open.github.com#7918 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scp-fs2open/fs2open.github.com#7917 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scp-fs2open/fs2open.github.com#7916 ·
I maintainer di solito rispondono entro 1 giorno
-
P2: A timed rotation maneuver does nothing on a ship that had an earlier timed lateral maneuverForse già presa @vovosta l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
scp-fs2open/fs2open.github.com#7914 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scp-fs2open/fs2open.github.com#7901 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di scp-fs2open/fs2open.github.com
Issue simili
-
(S1 - Need confirmation)
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CleverRaven/Cataclysm-DDA#89212 ·
I maintainer di solito rispondono entro 1 giorno
-
Status: Needs confirmation Status: Needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
ai_p2 comp-dictionary
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
ClickHouse/ClickHouse#127261 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
NVIDIA-Omniverse/usd-brep#23 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
qbittorrent/qBittorrent#25121 ·
I maintainer di solito rispondono entro 2 giorni