| Description | Ported over from GitHub issues: https://github.com/travisvroman/kohi/issues/281
Bug: Segmentation fault on first run due to missing binary assets (.kbi, .k3d, .kaf, .spv)
Summary
A fresh clone of the repository segfaults immediately on launching testbed.kapp because all binary asset files (.kbi, .k3d, .kaf, .spv) are absent from the repo and there are no documented instructions for generating them. The README covers building the engine but says nothing about the required asset import step.
Steps to Reproduce
git clone --recurse-submodules https://github.com/travisvroman/kohi
make all-debug
cd bin && ./testbed.kapp
Crash Output
[DEBUG]: Attempting to load asset 'Texture.DefaultWaterNormal' from package 'Kohi.Runtime'...
[TRACE]: Package 'Kohi.Runtime': Invalid path ('../kohi.runtime/assets/images/Texture.DefaultWaterNormal.kbi') for asset 'Texture.DefaultWaterNormal'.
[TRACE]: Failed to load binary asset. See logs for details.
[ERROR]: Cannot deserialize image without a nonzero size, block of memory and an asset to write to.
[ERROR]: Failed to deserialize image asset. See logs for details.
Segmentation fault (core dumped)
Root Cause
The engine expects pre-imported binary assets at paths like:
kohi.runtime/assets/images/Texture.DefaultWaterNormal.kbi
testbed.kapp/assets/images/*.kbi
testbed.kapp/assets/models/*.k3d
testbed.kapp/assets/music/*.kaf / assets/sounds/*.kaf
kohi.runtime/assets/shaders/*.spv
None of these files exist in the repository. Only source assets are present (.png, .jpg, .tga, .obj, .mp3, .ogg, .glsl). The .gitignore excludes all generated binary assets.
The asset importer (kohi.tools importmanifest) exists in source (tools_main.c) and must be run before first launch, but:
- It is not documented anywhere in the README or wiki.
- It is broken in the release build of
kohi.tools due to a separate Makefile bug (stale .o files — see related issue), making it hard to discover even for users who dig into the source.
- There is also no manifest provided for the
Kohi.Runtime package itself, only for testbed.kapp — so even running importmanifest on the testbed manifest does not generate the runtime assets (e.g. Texture.DefaultWaterNormal.kbi) that crash the engine on startup.
Environment
- OS: Ubuntu 24.04.4 LTS (kernel 6.17.0-20-generic)
- Compiler: clang / LLVM
- GPU: Intel UHD Graphics 620 (integrated), Mesa 25.2.8
- Vulkan API: 1.4.4
Suggested Fixes
Short term:
Medium term:
- Add a
make import-assets target to the root Makefile that runs the importer automatically as part of first-time setup.
- Consider whether the engine should fail gracefully (log a clear error + exit cleanly) rather than segfaulting when a required binary asset is missing, to improve the developer experience.
Long term:
- Consider committing a pre-built set of binary assets, or providing a download script/release artifact, so that new contributors can get up and running without needing to debug the toolchain first.
|
|---|