godot-cpp
godot-cpp copied to clipboard
UnReference causing crashes
Godot version
4.1.1 stable
godot-cpp version
4.1
System information
Godot v4.1.1.stable - Arch Linux #1 ZEN SMP PREEMPT_DYNAMIC Thu, 03 Aug 2023 16:01:52 +0000 - Vulkan (Forward+) - dedicated AMD Radeon RX 6950 XT (RADV NAVI21) () - 13th Gen Intel(R) Core(TM) i9-13900K (32 Threads)
Issue description
so, I've been developing a game solely in c++ and a friend of mine has decided to help me with linux builds as cross compilation doesn't appear to be easily doable on windows (I could use WSL but it's a really big project).
For some reason when compiled for linux unreference appears to be causing some kind of crash leading back to the file libc.so.6
Steps to reproduce
I'm not entirely sure but if you open a directory or something along those lines or use something that is a reference, when it unreferences itself after it's done being used it'll cause a crash.
Minimal reproduction project
N/A
I'm not entirely sure but if you open a directory or something along those lines or use something that is a reference, when it unreferences itself after it's done being used it'll cause a crash.
Unfortunately, I think we're going to need more information than this.
Personally, I use Linux for development, and have no problem using references in GDExtension. So, there must be more to triggering the bug.
Can you make a minimal reproduction project that causes issue so that we can reproduce the issue?
I'm not entirely sure how to provide a minimal reproduction project because other scenarios regarding using references seem to sometimes work and sometimes not work.
EDIT: I just realized the screenshot is of the error stack (I originally wrote this at like 3 am)
this is the code that is represented in the stacktrace
NOTE: this is being called in a singleton, more specifically in the singleton's constructor
so, I've rebuilt everything from the ground up after the last major release of godot, and it seems to be a user issue. I was trying to save to a directory which didn't actually exist yet. I was trying to make a file in "user://WiredPulse/memory" while that directory never was going to exist, it would create "user://WiredPulse" and not where it was. it's fixed now, it was just me not understanding how the directory access works.