question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Model import crashes the Unity Editor

See original GitHub issue

When importing a glTF model in Unity using glTFast and the KtxUnity package the Unity editor crashes. This is observed when KtxUnity is added via the file system (either the current main branch or the commit tagged 2.0.1. If I add the package via git URL glTFast claims that the KtxUnity package is not even available (see the issue in the glTFast repo https://github.com/atteneder/glTFast/issues/381).

Expected behavior

The model is imported correctly. Addtitionally, a model import should never crash the editor or a runtime application, even for completely broken models.

OS: macOS Unity editor version: 2021.2.19f1 KtxUnity version: main / 2.0.1 Test model: https://github.com/KhronosGroup/glTF/files/4132437/Avocado.zip

package.json

    "com.atteneder.gltfast": "4.6.0",
    "com.atteneder.ktx": "file:../mypackages/KtxUnity",

editor.log

Start importing Assets/Avocado/Avocado.gltf using Guid(a7299cc32fc4d43a3856f49f0bc3efcf) Importer(-1,00000000000000000000000000000000) Assertion failed: (colorModel == KHR_DF_MODEL_UASTC), function ktxTexture2_TranscodeBasis, file /Users/runner/work/KTX-Software-Unity/KTX-Software-Unity/KTX-Software/lib/basis_transcode.cpp, line 177.
Obtained 0 stack frames.
Launching bug reporter
Assertion failed: (colorModel == KHR_DF_MODEL_UASTC), function ktxTexture2_TranscodeBasis, file /Users/runner/work/KTX-Software-Unity/KTX-Software-Unity/KTX-Software/lib/basis_transcode.cpp, line 177.
Obtained 0 stack frames.
Launching bug reporter
Assertion failed: (colorModel == KHR_DF_MODEL_UASTC), function ktxTexture2_TranscodeBasis, file /Users/runner/work/KTX-Software-Unity/KTX-Software-Unity/KTX-Software/lib/basis_transcode.cpp, line 177.
Obtained 0 stack frames.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
attenedercommented, Apr 12, 2022

@MarkCallow That’s a great question! I assumed asserts are active in release builds as well, but that’s not true. Turns out my macOS build was misconfigured. After re-building the lib, libktx returns a proper error and does not crash anymore.

Thanks for pointing it out!

1reaction
attenedercommented, Apr 8, 2022

@seyfeb You’re right about crashes are not a reasonable reaction to corrupt data. Since the assertion is inside the third party code, I forwarded the request in a discussion. Let’s see what their answer is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unity crashing on asset import
I import unitypackage files either from my hard drive or downloaded from the asset store and randomly Unity crashes.
Read more >
unity crashes whenever i try importing a certain package
unity crashes whenever i try importing a certain package ... I would check the Unity editor log files and see if there's a...
Read more >
Crash when importing a specific FBX asset - Unity Issue Tracker
Open a new Unity project 2. Try to import the "crash_fbx. ... Actual result: Editor crashes when trying to import the FBX asset....
Read more >
unity crashes after git reset with no hint on what is going on
As mentioned by @RetiredNinja and @PSGuy, the solution is to: git clean -fdx with Unity closed; Doing restore tests with another local repo ......
Read more >
Unity Editor Crash Using OVRLipSync On MacOS
I have noticed however if we create a whole new Unity project (same Unity Editor version) and import the OVRLipSync package then run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found