Hot reload decrements refcounted objects refcount, causing a crash.
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 50/100
Hướng nghiên cứu
Start with the provided hot-reload-refcount-bug.zip reproduction and run it with the godot-cpp submodule initialized and hot reload enabled through CMake or SCons. Read SafeRefCount::_check_unref_safety and trace what happens to a Ref<> resource with a refcount of 1 during reload. Done means the same reload no longer decrements an already-zero refcount or crashes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Godot version
4.7.1
godot-cpp version
507ed9d
System information
Windows 11, Kubuntu amd64
Issue description
Hot reloading would cause random crashes. Running a godot debug build it would trigger a crash condition in SafeRefCount::_check_unref_safety with this message:
"Upon a SafeRefCount reaching zero any object whose lifetime is tied to it, as well as the ref count itself, must be destroyed.\n"
"Moreover, to guarantee that, no multiple threads should be racing to do the final unreferencing to zero."
Steps to reproduce
The gist of reproducing the issue is to have a Ref<> to a resource with a refcount of 1. On hot reload this will crash.
The easiest way to set this up was to create a Node in the scene that holds a Ref to a resource. One hot reload should trigger a crash.
Minimal reproduction project
hot-reload-refcount-bug.zip
Extract this zip, init the godot-cpp submodule, run the cmake project or build modules with scons with hot reload enabled.
Open the project in godot.
Make a whitespace change in the extension source, recompile the module.
Return to the opened project in godot to trigger hot reload, it should crash.
- Ngôn ngữ chính
- C++
- Star
- 2.8k
- Fork
- 825
- Merge trung bình
- 3 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của godotengine/godot-cpp
-
Building gdextensions with lto=full warns about serial compilatonCó thể đã có người làm @marcozee03 đã nhận 56 ngày trước. Đang mởenhancement topic:buildsystem
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
godotengine/godot-cpp#2002 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
godotengine/godot-cpp#1969 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
godotengine/godot-cpp#1967 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
godotengine/godot-cpp#2083 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Missing OKHSL related bindingsCó thể đã có người làm @realybin đã nhận 2 ngày trước. Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
godotengine/godot-cpp#2081 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của godotengine/godot-cpp
Issue tương tự
-
.NET ep:WebGPU platform:web
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/onnxruntime#33755 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
grumpycoders/pcsx-redux#2530 ·
-
A-tools P-medium S-ready-to-start studio task
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Status: Needs confirmation Status: Needs triage Type: Code Quality
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Image.resolveAssetSource's TypeScript declaration drops the null it returns for an unknown assetĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
react/react-native#59648 ·
Maintainer thường phản hồi trong vòng 2 ngày