Kode / Kha

Ultra-portable, high performance, open source multimedia framework.
http://kha.tech
zlib License
1.49k stars 174 forks source link

Native 3D build on OSX 10.14.6 crashes app on start (html5 works) #1248

Closed Lykdraft closed 3 years ago

Lykdraft commented 4 years ago

Copied from Discord: Downloaded & compiled a Kha Kodegarden example from Lubos to test what happens... It did build but crashes on open.

This code:

http://kodegarden.org/#c9fd447c82cc95428d974ecddd487bdcff2a2564

compiled to html5 works, but when compiled to native OSX:

crashes the app and spits this:

Process:               Kode Project [4311]
Path:                  /Users/USER/Downloads/*/Kode Project.app/Contents/MacOS/Kode Project
Identifier:            tech.kode.Kode-Project
Version:               1.0 (1)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Kode Project [4311]
User ID:               501

Date/Time:             2020-09-17 14:03:52.703 +0200
OS Version:            Mac OS X 10.14.6 (18G6020)
Report Version:        12

Time Awake Since Boot: 3800 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Application Specific Information:
-[MTLVertexAttributeDescriptorArrayInternal objectAtIndexedSubscript:]:384: failed assertion `vertex attribute index (18446744073709551615) must be < 31.'

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib          0x00007fff78e422c2 __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff78efdbf1 pthread_kill + 284
2   libsystem_c.dylib               0x00007fff78dac6a6 abort + 127
3   libsystem_c.dylib               0x00007fff78d7520d __assert_rtn + 324
4   com.apple.Metal                 0x00007fff518cf68e MTLReportFailure + 567
5   com.apple.Metal                 0x00007fff51884ffd -[MTLVertexAttributeDescriptorArrayInternal objectAtIndexedSubscript:] + 141
6   tech.kode.Kode-Project          0x0000000108ce469b kinc_g5_pipeline_compile + 2274 (PipelineState5Impl.mm:149)
7   tech.kode.Kode-Project          0x0000000108cf4a8a Kore::Graphics4::PipelineState::compile() + 452
8   tech.kode.Kode-Project          0x0000000108b7b1ea kha::graphics4::PipelineState_obj::linkWithStructures2(hx::ObjectPtr<kha::graphics4::VertexStructure_obj>, hx::ObjectPtr<kha::graphics4::VertexStructure_obj>, hx::ObjectPtr<kha::graphics4::VertexStructure_obj>, hx::ObjectPtr<kha::graphics4::VertexStructure_obj>, int) + 748
9   tech.kode.Kode-Project          0x0000000108b7b4c0 kha::graphics4::PipelineState_obj::compile() + 384 (PipelineState.cpp:275)
10  tech.kode.Kode-Project          0x0000000108a8edc8 Empty_obj::loadingFinished() + 476 (Empty.cpp:173)
11  tech.kode.Kode-Project          0x0000000108a90112 __Empty_objloadingFinished(hx::Object*) + 17 (Empty.cpp:270)
12  tech.kode.Kode-Project          0x0000000108c9a0c7 hx::CMemberFunction0::__run() + 19 (DynamicImpl.h:54)
13  tech.kode.Kode-Project          0x0000000108ab5cf1 kha::Assets_obj::loadEverything(Dynamic, Dynamic, Dynamic, Dynamic)::_hx_Closure_6::_hx_run() + 183 (Assets.cpp:212)
14  tech.kode.Kode-Project          0x0000000108ab5c21 kha::Assets_obj::loadEverything(Dynamic, Dynamic, Dynamic, Dynamic)::_hx_Closure_6::__run() + 17 (Assets.cpp:213)
15  tech.kode.Kode-Project          0x0000000108ab57b0 kha::Assets_obj::loadEverything(Dynamic, Dynamic, Dynamic, Dynamic)::_hx_Closure_5::_hx_run(Dynamic, Dynamic, Dynamic)::_hx_Closure_2::__run(Dynamic const&) + 66 (Assets.cpp:161)
16  tech.kode.Kode-Project          0x0000000108ab60f9 kha::Assets_obj::loadImage(String, Dynamic, Dynamic, Dynamic)::_hx_Closure_0::_hx_run(hx::ObjectPtr<kha::Image_obj>) + 105 (Assets.cpp:299)
17  tech.kode.Kode-Project          0x0000000108ab606e kha::Assets_obj::loadImage(String, Dynamic, Dynamic, Dynamic)::_hx_Closure_0::__run(Dynamic const&) + 64 (Assets.cpp:300)
18  tech.kode.Kode-Project          0x0000000108ac879d kha::LoaderImpl_obj::imageLoaded(unsigned long long, hx::ObjectPtr<kha::Image_obj>) + 115 (LoaderImpl.cpp:350)
19  tech.kode.Kode-Project          0x0000000108ac8be4 kha::LoaderImpl_obj::tick() + 612
20  tech.kode.Kode-Project          0x0000000108ad969d kha::SystemImpl_obj::frame() + 11 (SystemImpl.cpp:529)
21  tech.kode.Kode-Project          0x0000000108bca4f8 (anonymous namespace)::update() + 14 (main.cpp:178)
22  tech.kode.Kode-Project          0x0000000108d08178 kinc_internal_frame + 20 (system.c:190)
23  tech.kode.Kode-Project          0x0000000108cea3b1 withAutoreleasepool + 20 (System.mm:19)
24  tech.kode.Kode-Project          0x0000000108d081a1 kinc_start + 28 (system.c:201)
25  tech.kode.Kode-Project          0x0000000108bca784 run_kore() + 65 (main.cpp:371)
26  tech.kode.Kode-Project          0x0000000108ad8b0b kha::SystemImpl_obj::postInit(Dynamic) + 521 (SystemImpl.cpp:395)
27  tech.kode.Kode-Project          0x0000000108ad8806 kha::SystemImpl_obj::init(hx::ObjectPtr<kha::SystemOptions_obj>, Dynamic) + 518 (SystemImpl.cpp:358)
28  tech.kode.Kode-Project          0x0000000108ad3a3d kha::System_obj::init(Dynamic, Dynamic) + 2003 (System.cpp:163)
29  tech.kode.Kode-Project          0x0000000108a94af4 Main_obj::main() + 236 (Main.cpp:46)
30  tech.kode.Kode-Project          0x0000000108bca8bd kickstart + 69 (main.cpp:414)
31  tech.kode.Kode-Project          0x0000000108ceb34b -[MyApplication run] + 172 (System.mm:295)
32  com.apple.Foundation            0x00007fff4efda7d8 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 1119
33  com.apple.Foundation            0x00007fff4efe2202 -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 131
34  tech.kode.Kode-Project          0x0000000108ceb09e main + 114 (System.mm:256)
35  libdyld.dylib                   0x00007fff78d073d5 start + 

(By the way: A lot of examples just won't work at all. Hard to find any that work right out of the box. I.e. these won't compile to anything at all: http://kodegarden.org/#5da5a3e87cb3d29e8785653b15bc2a7c64f02b1e http://kodegarden.org/#1257c442d0b9e74f37ce871bd1c0fc08bf4b5700

will spit this:

kha/graphics4/PipelineState.hx:87: Error: Could not compile shader:
Log.hx:66
ERROR: 0:? : '' : syntax error

undefined
RobDangerous commented 3 years ago

Fixed the original bug. Couldn't reproduce the problem you have with 5da5a3e87cb3d29e8785653b15bc2a7c64f02b1e. Please create a new issue for that if that's still happening for you and please use the bug-template next time. And ideally directly create new Issues for, well, new issues instead of attaching them to an old Issue - makes it hard to keep an overview of things.