godotengine / godotengine/godot-cpp
get_world() causing crash possibly leak!
- Dominant language
- C++
- Stars
- 2.7k
- Forks
- 809
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 8
Description
calling `get_world()` from `KinematicBody` causing crash possibly leak! , currently I'm calling it in the `_ready` method :
```
void Hero::_ready() {
space_state = get_world()->get_direct_space_state();
}
```
```
simple demo : https://github.com/AbanoubNassem/godot-cpp-cmake
operating system : MacOS BigSur 11.4
Process: Godot [6302]
Path: /Applications/Godot.app/Contents/MacOS/Godot
Identifier: org.godotengine.godot
Version: 3.3.2 (3.3.2)
Code Type: X86-64 (Native)
Parent Process: Godot [89971]
Responsible: Godot [89971]
User ID: 501
Date/Time: 2021-06-02 14:18:33.186 +0400
OS Version: macOS 11.4 (20F71)
Report Version: 12
Anonymous UUID: 5A760DD8-1F25-4DF6-F63B-F44F00976AC4
Sleep/Wake UUID: E33078B4-1206-4335-B5E6-5B38E6F7FD46
Time Awake Since Boot: 140000 seconds
Time Since Wake: 1200 seconds
System Integrity Protection: disabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGABRT)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000122946aa0
Exception Note: EXC_CORPSE_NOTIFY
VM Regions Near 0x122946aa0:
__LINKEDIT 119bd4000-119bda000 [ 24K] rw-/rwx SM=NUL /System/Library/Frameworks/CoreMediaIO.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC
-->
CG image 122ece000-122ed3000 [ 20K] rw-/rwx SM=COW
Application Specific Information:
abort() called
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff2030992e __pthread_kill + 10
1 libsystem_pthread.dylib 0x00007fff203385bd pthread_kill + 263
2 libsystem_c.dylib 0x00007fff2028d411 abort + 120
3 org.godotengine.godot 0x000000010494e73c 0x10494c000 + 10044
4 libsystem_platform.dylib 0x00007fff2037dd7d _sigtramp + 29
5 ??? 000000000000000000 0 + 0
6 org.godotengine.godot 0x00000001072ef508 0x10494c000 + 43660552
7 org.godotengine.godot 0x00000001062d4395 0x10494c000 + 26772373
8 org.godotengine.godot 0x000000010628a728 0x10494c000 + 26470184
9 org.godotengine.godot 0x000000010495cd2a 0x10494c000 + 68906
10 org.godotengine.godot 0x0000000104963421 0x10494c000 + 95265
11 libdyld.dylib 0x00007fff20353f5d start + 1
Thread 1:
0 libsystem_pthread.dylib 0x00007fff20334420 start_wqthread + 0
Thread 2:
0 libsystem_pthread.dylib 0x00007fff20334420 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x00007fff20305cde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20338e49 _pthread_cond_wait + 1298
2 libc++.1.dylib 0x00007fff202a1d72 std::__1::condition_variable::wait(std::__1::unique_lock&) + 18
3 org.godotengine.godot 0x0000000107508c9b _IP_ResolverPrivate::_thread_function(void*) + 171
4 org.godotengine.godot 0x000000010747f02f 0x10494c000 + 45297711
5 org.godotengine.godot 0x000000010747f567 0x10494c000 + 45299047
6 libsystem_pthread.dylib 0x00007fff203388fc _pthread_start + 224
7 libsystem_pthread.dylib 0x00007fff20334443 thread_start + 15
Thread 4:
0 libsystem_kernel.dylib 0x00007fff20305cde __psynch_cvwait + 10
1 libsystem_pthread.dylib 0x00007fff20338e49 _pthread_cond_wait + 1298
2 libc++.1.dylib 0x00007fff202a1d72 std::__1::condition_variable::wait(std::__1::unique_lock&) + 18
3 org.godotengine.godot 0x00000001070b5bfb 0x10494c000 + 41327611
4 org.godotengine.godot 0x000000010747f02f 0x10494c000 + 45297711
5 org.godotengine.godot 0x000000010747f567 0x10494c000 + 45299047
6 libsystem_pthread.dylib 0x00007fff203388fc _pthread_start + 224
7 libsystem_pthread.dylib 0x00007fff20334443 thread_start + 15
Thread 5:: AMCP Logging Spool
0 libsystem_kernel.dylib 0x00007fff203032f6 semaphore_wait_trap + 10
1 com.apple.audio.caulk 0x00007fff2864b8da caulk::mach::semaphore::wait_or_error() + 16
2 com.apple.audio.caulk 0x00007fff28638836 caulk::semaphore::timed_wait(double) + 110
3 com.apple.audio.caulk 0x00007fff28638784 caulk::concurrent::details::worker_thread::run() + 30
4 com.apple.audio.caulk 0x00007fff28638502 void* caulk::thread_proxy > >(void*) + 45
5 libsystem_pthread.dylib 0x00007fff203388fc _pthread_start + 224
6 libsystem_pthread.dylib 0x00007fff20334443 thread_start + 15
Thread 6:: com.apple.audio.IOThread.client
0 libsystem_kernel.dylib 0x00007fff203032ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2030362c mach_msg + 60
2 com.apple.audio.CoreAudio 0x00007fff21d378f5 HALB_MachPort::SendSimpleMessageWithSimpleReply(unsigned int, unsigned int, int, int&, bool, unsigned int) + 111
3 com.apple.audio.CoreAudio 0x00007fff21bda3ed invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 3367
4 com.apple.audio.CoreAudio 0x00007fff21d760c4 HALB_IOThread::Entry(void*) + 72
5 libsystem_pthread.dylib 0x00007fff203388fc _pthread_start + 224
6 libsystem_pthread.dylib 0x00007fff20334443 thread_start + 15
Thread 7:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x00007fff203032ba mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff2030362c mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff204318c5 __CFRunLoopServiceMachPort + 316
3 com.apple.CoreFoundation 0x00007fff2042ff7b __CFRunLoopRun + 1332
4 com.apple.CoreFoundation 0x00007fff2042f380 CFRunLoopRunSpecific + 567
5 com.apple.AppKit 0x00007fff22ce068a _NSEventThread + 124
6 libsystem_pthread.dylib 0x00007fff203388fc _pthread_start + 224
7 libsystem_pthread.dylib 0x00007fff20334443 thread_start + 15
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000000 rbx: 0x0000000114bb6e00 rcx: 0x00007ffeeb2b0e78 rdx: 0x0000000000000000
rdi: 0x0000000000000103 rsi: 0x0000000000000006 rbp: 0x00007ffeeb2b0ea0 rsp: 0x00007ffeeb2b0e78
r8: 0x00007fff80630068 r9: 0x0000000000000000 r10: 0x0000000114bb6e00 r11: 0x0000000000000246
r12: 0x0000000000000103 r13: 0x00007ffeeb2b1710 r14: 0x0000000000000006 r15: 0x0000000000000016
rip: 0x00007fff2030992e rfl: 0x0000000000000246 cr2: 0x00007fff87050228
Logical CPU: 0
Error Code: 0x02000148
Trap Number: 133
Thread 0 instruction stream not available.
Thread 0 last branch register state not available.
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.