Error: Extra content at the end of the document
Error: Failed to load XML document from memory
Load failed in COLLADA DOM
Failed to load 'meshes/ashlar_ledge.dae': ... code 3, using marker_error instead
It's intermittent. In the Game Template the player body meshes/basicplayerbody.dae failed in 2 of 3 runs before the fix, and the byte-identical test box loaded in SCENARIO=mantle but failed in both SCENARIO=camera runs. A failed model falls back to marker_error, which has no collision, so scenario checks that rely on it fail as well.
Cause (as best I can tell): OSG 3.6.5's dae plugin readNode(std::istream&) copies the stream into a buffer with no terminating NUL and passes it to collada-dom, which parses it as a C string. Whatever bytes follow in memory become "extra content". I didn't have the OSG plugin source in the build image to confirm the line, so this is from memory of that code plus the symptoms.
Fix:Resource::loadNonNif in components/resource/scenemanager.cpp now reads a .dae stream into a string, appends a NUL and hands the plugin an istringstream of that. Non-COLLADA formats are unchanged. This is game-neutral and could go upstream.
Acceptance: three SCENARIO=camera runs and a default boot with zero .dae load failures, and the player body renders instead of the error marker.
Found while testing #29 headlessly on 2026-11-16.
**Symptom:** valid `.dae` files sometimes fail with
```
Error: Extra content at the end of the document
Error: Failed to load XML document from memory
Load failed in COLLADA DOM
Failed to load 'meshes/ashlar_ledge.dae': ... code 3, using marker_error instead
```
It's intermittent. In the Game Template the player body `meshes/basicplayerbody.dae` failed in 2 of 3 runs before the fix, and the byte-identical test box loaded in `SCENARIO=mantle` but failed in both `SCENARIO=camera` runs. A failed model falls back to `marker_error`, which has no collision, so scenario checks that rely on it fail as well.
**Cause (as best I can tell):** OSG 3.6.5's dae plugin `readNode(std::istream&)` copies the stream into a buffer with no terminating NUL and passes it to collada-dom, which parses it as a C string. Whatever bytes follow in memory become "extra content". I didn't have the OSG plugin source in the build image to confirm the line, so this is from memory of that code plus the symptoms.
**Fix:** `Resource::loadNonNif` in `components/resource/scenemanager.cpp` now reads a `.dae` stream into a string, appends a NUL and hands the plugin an `istringstream` of that. Non-COLLADA formats are unchanged. This is game-neutral and could go upstream.
**Acceptance:** three `SCENARIO=camera` runs and a default boot with zero `.dae` load failures, and the player body renders instead of the error marker.
claude
added this to the 1. Baseline milestone 2026-11-16 20:44:57 +00:00
Fixed in 76d1796e6c. After the fix: three SCENARIO=camera runs and the default boot had zero .dae load failures, against one or two per run before. The Game Template's player body now renders instead of the error marker. Unit tests pass (1644 and 637). There's no dedicated unit test, because loading a DAE needs the OSG plugin and a scene manager; the scenarios cover it.
Fixed in `76d1796e6c`. After the fix: three `SCENARIO=camera` runs and the default boot had zero `.dae` load failures, against one or two per run before. The Game Template's player body now renders instead of the error marker. Unit tests pass (1644 and 637). There's no dedicated unit test, because loading a DAE needs the OSG plugin and a scene manager; the scenarios cover it.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Found while testing #29 headlessly on 2026-11-16.
Symptom: valid
.daefiles sometimes fail withIt's intermittent. In the Game Template the player body
meshes/basicplayerbody.daefailed in 2 of 3 runs before the fix, and the byte-identical test box loaded inSCENARIO=mantlebut failed in bothSCENARIO=cameraruns. A failed model falls back tomarker_error, which has no collision, so scenario checks that rely on it fail as well.Cause (as best I can tell): OSG 3.6.5's dae plugin
readNode(std::istream&)copies the stream into a buffer with no terminating NUL and passes it to collada-dom, which parses it as a C string. Whatever bytes follow in memory become "extra content". I didn't have the OSG plugin source in the build image to confirm the line, so this is from memory of that code plus the symptoms.Fix:
Resource::loadNonNifincomponents/resource/scenemanager.cppnow reads a.daestream into a string, appends a NUL and hands the plugin anistringstreamof that. Non-COLLADA formats are unchanged. This is game-neutral and could go upstream.Acceptance: three
SCENARIO=cameraruns and a default boot with zero.daeload failures, and the player body renders instead of the error marker.Fixed in
76d1796e6c. After the fix: threeSCENARIO=cameraruns and the default boot had zero.daeload failures, against one or two per run before. The Game Template's player body now renders instead of the error marker. Unit tests pass (1644 and 637). There's no dedicated unit test, because loading a DAE needs the OSG plugin and a scene manager; the scenarios cover it.