[Critical][3.8.2] Crash on Android While Instantiating a Prefab with Null _lrot

Hello, Cocos Creator Development Team!

I’m experiencing a game crash on Android devices when instantiating a prefab in debug mode, specifically within Cocos Creator version 3.8.2. The issue arises due to null values being assigned to the _lrot parameter of the prefab by the editor, unexpectedly. Here’s the problematic part of the prefab’s JSON:

"_lrot": {
  "__type__": "cc.Quat",
  "x": null,
  "y": null,
  "z": null,
  "w": null
},

The crash occurs immediately after attempting to instantiate an instance from this prefab, with the error log indicating a failure in type assertion within the engine:

Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid xxxx (Thread-2), pid xxxx
Abort message: '.../Value.cpp:451: double se::Value::toDouble() const: assertion "_type == Type::Number || _type == Type::Boolean || _type == Type::BigInt || _type == Type::String" failed'

#00 pc 00000b89  [vdso] (__kernel_vsyscall+9)
#01 pc 0005ad68  /apex/com.android.runtime/lib/bionic/libc.so (syscall+40)
#02 pc 00076511  /apex/com.android.runtime/lib/bionic/libc.so (abort+209)
#03 pc 00076a28  /apex/com.android.runtime/lib/bionic/libc.so (__assert2+56)
#04 pc 033331da  /data/app/~~OKTguK2nSPiJHAEf9Qs-LA==/lib/x86/libcocos.so (se::Value::toDouble() const+138)
#05 pc 03333794  /data/app/~~OKTguK2nSPiJHAEf9Qs-LA==/lib/x86/libcocos.so (se::Value::toFloat() const+36)
#06 pc 0283d2a9  /data/app/~~OKTguK2nSPiJHAEf9Qs-LA==/lib/x86/libcocos.so (sevalue_to_native(se::Value const&, float*, se::Object*)+41)
#07 pc 02a54244  /data/app/~~OKTguK2nSPiJHAEf9Qs-LA==/lib/x86/libcocos.so
#08 pc 032930e6  /data/app/~~OKTguK2nSPiJHAEf9Qs-LA==/lib/x86/libcocos.so (jsbFunctionWrapper+598)
#09 pc 02a54114  /data/app/~~OKTguK2nSPiJHAEf9Qs-LA==/lib/x86/libcocos.so (js_cc_Node_setRotationForJSRegistry+68)
#10 pc 040c0c40  /data/app/~~OKTguK2nSPiJHAEf9Qs-LA==/lib/x86/libcocos.so

Manually editing the .prefab file to set lrot values to zero (x=0, y=0, z=0, w=0) appears to fix the crash temporarily. However, the editor seems to reset these values back to null after some edits, without clear steps to reproduce this behavior consistently.

This issue seems somewhat analogous to a previously discussed problem affecting the iOS build and a prior version of Cocos Creator, documented here.

I am seeking advice on a more permanent solution to this issue, as manual prefab modifications are not viable long-term. Any insights, workarounds, or information about potential fixes would be greatly appreciated.

Thank you for your time and help!

1 Like

As previously reported, I have asked for the help of editor colleagues and asked them to help check it