godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.43k stars 20.25k forks source link

Importing COLLADA file with armature controlling multiple meshes causes segfault #6222

Closed hikari-no-yume closed 7 years ago

hikari-no-yume commented 8 years ago

Operating system or device - Godot version: OS X El Capitan 10.11.6, Godot v2.1.stable.official

Issue description (what happened, and what was expected): Attempting to import my COLLADA file caused Godot to segfault. Attempting to open the scene it creates causes Godot to segfault.

Steps to reproduce: Import human body.dae. This didn't happen with an earlier version of the COLLADA file which lacked a skeleton. This makes sense given the error message.

Backtrace:

Process:               Godot [4091]
Path:                  /Applications/Godot.app/Contents/MacOS/Godot
Identifier:            org.godotengine.godot
Version:               2.1 (2.1)
Code Type:             X86-64 (Native)
Parent Process:        ??? [1]
Responsible:           Godot [4091]
User ID:               501

Date/Time:             2016-08-21 01:27:03.305 +0100
OS Version:            Mac OS X 10.11.6 (15G31)
Report Version:        11
Anonymous UUID:        D94AC874-325F-24BB-B79E-CBA80BB17B5E

Time Awake Since Boot: 41000 seconds

System Integrity Protection: enabled

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

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x00000000000000b0
Exception Note:        EXC_CORPSE_NOTIFY

VM Regions Near 0xb0:
--> 
    __TEXT                 000000010a51d000-000000010ca75000 [ 37.3M] r-x/rwx SM=COW  /Applications/Godot.app/Contents/MacOS/Godot

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   org.godotengine.godot           0x000000010b031bcd Collada::_merge_skeletons(Collada::VisualScene*, Collada::Node*) + 397
1   org.godotengine.godot           0x000000010b0339ca Collada::_optimize() + 298
2   org.godotengine.godot           0x000000010b0341e3 Collada::load(String const&, int) + 1203
3   org.godotengine.godot           0x000000010af91edc ColladaImport::load(String const&, int, bool) + 28
4   org.godotengine.godot           0x000000010af971ec EditorSceneImporterCollada::import_scene(String const&, unsigned int, int, List<String, DefaultAllocator>*, Error*) + 460
5   org.godotengine.godot           0x000000010afd0b8d EditorSceneImportPlugin::import1(Ref<ResourceImportMetadata> const&, Node**, List<String, DefaultAllocator>*) + 1997
6   org.godotengine.godot           0x000000010afcef53 EditorSceneImportDialog::_import(bool) + 6483
7   org.godotengine.godot           0x000000010aff10a1 MethodBind1<EditorSceneImportDialog, bool>::call(Object*, Variant const**, int, Variant::CallError&) + 449
8   org.godotengine.godot           0x000000010bb434d2 Object::call(StringName const&, Variant const**, int, Variant::CallError&) + 642
9   org.godotengine.godot           0x000000010bb45538 Object::emit_signal(StringName const&, Variant const**, int) + 1480
10  org.godotengine.godot           0x000000010bb439e0 Object::emit_signal(StringName const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&) + 96
11  org.godotengine.godot           0x000000010b1110ac BaseButton::_input_event(InputEvent) + 4076
12  org.godotengine.godot           0x000000010b118815 MethodBind1<BaseButton, InputEvent>::call(Object*, Variant const**, int, Variant::CallError&) + 533
13  org.godotengine.godot           0x000000010bb41b04 Object::call_multilevel(StringName const&, Variant const**, int) + 244
14  org.godotengine.godot           0x000000010bb43231 Object::call_multilevel(StringName const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&) + 97
15  org.godotengine.godot           0x000000010b0fa394 Viewport::_gui_call_input(Control*, InputEvent const&) + 484
16  org.godotengine.godot           0x000000010b0fba4a Viewport::_gui_input_event(InputEvent) + 3690
17  org.godotengine.godot           0x000000010b0f9a89 Viewport::input(InputEvent const&) + 313
18  org.godotengine.godot           0x000000010b0f9943 Viewport::_vp_input(InputEvent const&) + 355
19  org.godotengine.godot           0x000000010b10ad95 MethodBind1<Viewport, InputEvent const&>::call(Object*, Variant const**, int, Variant::CallError&) + 469
20  org.godotengine.godot           0x000000010bb434d2 Object::call(StringName const&, Variant const**, int, Variant::CallError&) + 642
21  org.godotengine.godot           0x000000010bb431aa Object::call(StringName const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&) + 106
22  org.godotengine.godot           0x000000010b0d751b SceneTree::call_group(unsigned int, StringName const&, StringName const&, Variant const&, Variant const&, Variant const&, Variant const&, Variant const&) + 1627
23  org.godotengine.godot           0x000000010b0d861a SceneTree::input_event(InputEvent const&) + 330
24  org.godotengine.godot           0x000000010a5277d1 InputDefault::parse_input_event(InputEvent const&) + 1201
25  org.godotengine.godot           0x000000010a51f356 -[GodotContentView mouseUp:] + 246
26  com.apple.AppKit                0x00007fff923af713 -[NSWindow _handleMouseUpEvent:isDelayedEvent:] + 119
27  com.apple.AppKit                0x00007fff923b03ad -[NSWindow _reallySendEvent:isDelayedEvent:] + 212
28  com.apple.AppKit                0x00007fff91def539 -[NSWindow sendEvent:] + 517
29  com.apple.AppKit                0x00007fff91d6fa38 -[NSApplication sendEvent:] + 2540
30  org.godotengine.godot           0x000000010a51e9b8 -[GodotApplication sendEvent:] + 136
31  org.godotengine.godot           0x000000010a522dbb OS_OSX::run() + 235
32  org.godotengine.godot           0x000000010a5250ab main + 523
33  libdyld.dylib                   0x00007fff8cfe35ad start + 1

Thread 1:: Dispatch queue: com.apple.libdispatch-manager
0   libsystem_kernel.dylib          0x00007fff8cef8efa kevent_qos + 10
1   libdispatch.dylib               0x00007fff8a320165 _dispatch_mgr_invoke + 216
2   libdispatch.dylib               0x00007fff8a31fdcd _dispatch_mgr_thread + 52

Thread 2:: com.apple.audio.IOThread.client
0   libsystem_kernel.dylib          0x00007fff8cef1f72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8cef13b3 mach_msg + 55
2   com.apple.audio.CoreAudio       0x00007fff956a935e HALB_MachPort::SendMessageWithReply(unsigned int, unsigned int, unsigned int, unsigned int, mach_msg_header_t*, bool, unsigned int) + 98
3   com.apple.audio.CoreAudio       0x00007fff956a92ec HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 42
4   com.apple.audio.CoreAudio       0x00007fff956a76a9 HALC_ProxyIOContext::IOWorkLoop() + 1149
5   com.apple.audio.CoreAudio       0x00007fff956a715e HALC_ProxyIOContext::IOThreadEntry(void*) + 88
6   com.apple.audio.CoreAudio       0x00007fff956a7033 HALB_IOThread::Entry(void*) + 75
7   libsystem_pthread.dylib         0x00007fff9b6c899d _pthread_body + 131
8   libsystem_pthread.dylib         0x00007fff9b6c891a _pthread_start + 168
9   libsystem_pthread.dylib         0x00007fff9b6c6351 thread_start + 13

Thread 3:: AudioServerSW
0   libsystem_kernel.dylib          0x00007fff8cef810a __semwait_signal + 10
1   libsystem_c.dylib               0x00007fff87617d0f nanosleep + 199
2   libsystem_c.dylib               0x00007fff87617c02 usleep + 54
3   org.godotengine.godot           0x000000010bac4fe3 AudioServerSW::_thread_func(void*) + 115
4   org.godotengine.godot           0x000000010a65166e ThreadPosix::thread_callback(void*) + 30
5   libsystem_pthread.dylib         0x00007fff9b6c899d _pthread_body + 131
6   libsystem_pthread.dylib         0x00007fff9b6c891a _pthread_start + 168
7   libsystem_pthread.dylib         0x00007fff9b6c6351 thread_start + 13

Thread 4:
0   libsystem_kernel.dylib          0x00007fff8cef810a __semwait_signal + 10
1   libsystem_c.dylib               0x00007fff87617d0f nanosleep + 199
2   libsystem_c.dylib               0x00007fff87617c02 usleep + 54
3   org.godotengine.godot           0x000000010a967b18 EditorExportPlatformAndroid::_device_poll_thread(void*) + 1928
4   org.godotengine.godot           0x000000010a65166e ThreadPosix::thread_callback(void*) + 30
5   libsystem_pthread.dylib         0x00007fff9b6c899d _pthread_body + 131
6   libsystem_pthread.dylib         0x00007fff9b6c891a _pthread_start + 168
7   libsystem_pthread.dylib         0x00007fff9b6c6351 thread_start + 13

Thread 5:
0   libsystem_kernel.dylib          0x00007fff8cef810a __semwait_signal + 10
1   libsystem_c.dylib               0x00007fff87617d0f nanosleep + 199
2   libsystem_c.dylib               0x00007fff87617c02 usleep + 54
3   org.godotengine.godot           0x000000010a9783f8 EditorExportPlatformBB10::_device_poll_thread(void*) + 4984
4   org.godotengine.godot           0x000000010a65166e ThreadPosix::thread_callback(void*) + 30
5   libsystem_pthread.dylib         0x00007fff9b6c899d _pthread_body + 131
6   libsystem_pthread.dylib         0x00007fff9b6c891a _pthread_start + 168
7   libsystem_pthread.dylib         0x00007fff9b6c6351 thread_start + 13

Thread 6:
0   libsystem_kernel.dylib          0x00007fff8cef9362 read + 10
1   org.godotengine.godot           0x000000010a5257b9 SemaphoreOSX::wait() + 25
2   org.godotengine.godot           0x000000010ab4c44c EditorResourcePreview::_thread() + 108
3   org.godotengine.godot           0x000000010a65166e ThreadPosix::thread_callback(void*) + 30
4   libsystem_pthread.dylib         0x00007fff9b6c899d _pthread_body + 131
5   libsystem_pthread.dylib         0x00007fff9b6c891a _pthread_start + 168
6   libsystem_pthread.dylib         0x00007fff9b6c6351 thread_start + 13

Thread 7:
0   libsystem_kernel.dylib          0x00007fff8cef810a __semwait_signal + 10
1   libsystem_c.dylib               0x00007fff87617d0f nanosleep + 199
2   libsystem_c.dylib               0x00007fff87617c02 usleep + 54
3   org.godotengine.godot           0x000000010af5a4e3 EditorFileServer::_thread_start(void*) + 819
4   org.godotengine.godot           0x000000010a65166e ThreadPosix::thread_callback(void*) + 30
5   libsystem_pthread.dylib         0x00007fff9b6c899d _pthread_body + 131
6   libsystem_pthread.dylib         0x00007fff9b6c891a _pthread_start + 168
7   libsystem_pthread.dylib         0x00007fff9b6c6351 thread_start + 13

Thread 8:: com.apple.NSEventThread
0   libsystem_kernel.dylib          0x00007fff8cef1f72 mach_msg_trap + 10
1   libsystem_kernel.dylib          0x00007fff8cef13b3 mach_msg + 55
2   com.apple.CoreFoundation        0x00007fff881171c4 __CFRunLoopServiceMachPort + 212
3   com.apple.CoreFoundation        0x00007fff8811668c __CFRunLoopRun + 1356
4   com.apple.CoreFoundation        0x00007fff88115ed8 CFRunLoopRunSpecific + 296
5   com.apple.AppKit                0x00007fff91d38d95 _NSEventThread + 149
6   libsystem_pthread.dylib         0x00007fff9b6c899d _pthread_body + 131
7   libsystem_pthread.dylib         0x00007fff9b6c891a _pthread_start + 168
8   libsystem_pthread.dylib         0x00007fff9b6c6351 thread_start + 13

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000001  rcx: 0x0000000000000000  rdx: 0x00007ff882378d60
  rdi: 0x000000010cb191d0  rsi: 0x00007fff556e0118  rbp: 0x00007fff556e0230  rsp: 0x00007fff556e01a0
   r8: 0x0000000000000000   r9: 0x00007ff87ad1a2a0  r10: 0xffffffffffffffff  r11: 0x00007ff882300001
  r12: 0x0000000000000000  r13: 0x00007ff8821a7ea8  r14: 0x0000000000000000  r15: 0x00007ff882375730
  rip: 0x000000010b031bcd  rfl: 0x0000000000010202  cr2: 0x00007fb101aecc00

Logical CPU:     0
Error Code:      0x0100001f
Trap Number:     133
hikari-no-yume commented 8 years ago

This COLLADA file was produced from a Blender project where I had one armature that controls multiple meshes (one for each limb).

Fusing the meshes together into one mesh in Blender and exporting that as a new COLLADA file produces a file that Godot can successfully import.

Therefore, I think the issue is actually Godot not being able to handle multiple meshes within one armature.

(I might be using the wrong terminology here, I don't know what COLLADA calls these, only what Blender does.)

reduz commented 8 years ago

Godot supports this fine, what is not supported is multiple armatures for a single mesh. I think a requirement is that meshes are children of the armature.

On Wed, Sep 7, 2016 at 2:20 PM, Andrea Faulds notifications@github.com wrote:

This COLLADA file was produced from a Blender project where I had one armature that controls multiple meshes (one for each limb).

Fusing the meshes together into one mesh in Blender and exporting that as a new COLLADA file produces a file that Godot can successfully import.

Therefore, I think the issue is actually Godot not being able to handle multiple meshes within one armature.

(I might be using the wrong terminology here, I don't know what COLLADA calls these, only what Blender does.)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/6222#issuecomment-245353661, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z2_WYGiHRudmHEkQfdzkwCCKrZILOks5qnvJEgaJpZM4JpMjA .

hikari-no-yume commented 8 years ago

There's only a single armature in play here, and all the meshes were indeed children of it, so I'm not sure what's going on.

reduz commented 7 years ago

does this still break in 3.0?

hikari-no-yume commented 7 years ago

I can't figure out how to import it in 3.0. But 3.0's importers were disabled last I checked.

reduz commented 7 years ago

just copy the dae to your project and it will import automatically

On Sat, Aug 5, 2017 at 12:45 PM, Andrea notifications@github.com wrote:

I can't figure out how to import it in 3.0. But 3.0's importers were disabled last I checked.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/6222#issuecomment-320450829, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z22JQyrg3qrrdlWj5jejIs0fONxI2ks5sVI40gaJpZM4JpMjA .

hikari-no-yume commented 7 years ago

Ah, yes, that immediately crashes Godot 3.

hikari-no-yume commented 7 years ago

Also, for reference, all the meshes are children of the armature.

reduz commented 7 years ago

danm it, please attach a file that breaks the importer and will give it a check

On Sat, Aug 5, 2017 at 12:52 PM, Andrea notifications@github.com wrote:

Also, for reference, all the meshes are children of the armature.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/6222#issuecomment-320451140, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z2_35DhFiQOMiVHcXXegPsg9qDk4Sks5sVI-hgaJpZM4JpMjA .

hikari-no-yume commented 7 years ago

@reduz it's the one attached in the OP already.

reduz commented 7 years ago

It seems the Collada file was broken, as it seems to be exported by Blender internal exporter. Using the BetterCollada exporter will probably solve this. In any case, made it not crash