New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ue4] Hot Reloading with a character in the scene results in a crash #1246
Comments
@Drew-Clowery I've tried to reproduce the issue as per your reproduction steps using UE 4.21.1 and the latest spine-ue4/spine-cpp from the 3.7 branch from today on Windows 10 with Visual Studio 2017. I've tried both re-importing the assets as outlined by you, and also by overwriting the asset source file (spineboy.json). Both things worked as expected without the editor crashing. Could you maybe give me more information? What Spine Runtimes branch are you working off of? What Visual Studio version are you using? What VS build configuration are you using? I'm using "Development Editor" on my end. |
Sorry for the slow reply. I have just reproduced this using the 3.7 Spine runtimes, Unreal Engine 4.21.1, Visual Studio 17 Community v15.9.4 on Windows 10. My exact repro steps were:
At that point Visual studio hit an uncaught exception at USpineSkeletonRendererComponent.cpp line 220. I will attempt to record a video of these steps in a moment and attach it to this bug. |
This are my exact reproduction steps. Looks like we have an indeterministic memory corruption on our hands. I'll try to get this to crash on my end. |
So my assessment was that this was happening because the Actor in the level was not properly cleaned up, or cleaned up too early. I haven't stepped through it in exacting detail, but a little quick debugging showed that the attachment and maybe the slot were both partially or completely cleaned-up. This repros at 100% with me, I've run it over a dozen times now, so I don't think it's indeterministic. |
I've uploaded a video of my repro: https://youtu.be/IL9nSbCEcvw |
Thanks, this is essentially what I've been trying. The indeterminism stems from the fact that memory management even in debug builds is not deterministic. On some machines, access to freed memory crashes immediately, either due to a trap or because the data has been overwritten and is thus invalid (as in your case, where a pointer dereference fails). On some machines (like mine), the same build may still have the bug, but the segfault trap is not triggered, nor is the freed memory reused and overwritten. Sometimes things change because of a reboot, or because other programs are running. In any case, there's clearly a bug, and it definitely looks like a use-after-free bug. I think VS has some memory debugging tools I can try to see where this use-after-free error bug from. Thank you a lot for helping out with this! |
Ahh, I understand what you are saying now. Thank you very much for working on this, and please let me know if there's anything else I can do to help. |
Hi, I just ran into this issue, this is what Unreal editor shows at the moment it crashes: `Access violation - code c0000005 (first/second chance not available) UE4Editor_SpinePlugin!spine::PathConstraint::update() [d:\proyectos\nachosadventures\support\unreal\spineruntimecompile\plugins\spineplugin\source\spineplugin\public\spine-cpp\src\spine\pathconstraint.cpp:78] I restarted the editor, deleted the only actor using the asset and it reimported without problem. Using 4.20.3 with runtime 3.7, updated 2 days ago. |
@scardario to be clear, this happened when you tried to re-import assets as described above? |
Mmmhh, sorry, not exactly, after reading more carefully I realize my issue is a bit different:
It seems to be related to having an actor using the asset while importing, since it worked when I deleted from the level the only actor using it. I apologize if this is not the correct place to post this problem. |
@scardario no, this is the perfect place for the report! Thanks! Some good news: I think I have identified the issue (documenting it here for when I return to the code tomorrow): Both All this works fine when a previously imported asset is loaded for a scene to construct The first problem is, that the factories for the two asset types simply override the existing raw data, prompting a deallocation of the old raw data. Any Worse, upon re-import, the It will take me a bit to rewrite how all of this works. In the end, we should have a working, cleaner version of the current setup. Again, thanks to @Drew-Clowery and @scardario for reporting this and helping out with steps and stack traces. The clue to all these non-obvious side effects of reimporting assets actually came from your stack traces. Without those, I would not have been able to identify where things go wrong. Cheers! |
Glad to be of any help. |
@Drew-Clowery @scardario the latest commit should fix the re-import issue you are seeing. While I was not able to reproduce the error locally, this new way of handling (re-)imports should be stable. Please try out the changes in the latest 3.7 or 3.8-beta branch, and let me know if you run into issues with it. Thank you both for helping out with this! |
Hi, I couldn't compile the new version on 4.20.3 using branch 3.7: I get this error in a lot of files:
I know this should be easy to figure out, but I don't work with C++. I already tried twice to check if I was making some mistake following the runtime compile instructions. |
@scardario did you also update the |
I updated all the github project, deleted the spineplugin folder from plugins and copied it again. (I have the repository in a separate folder) If you're asking about the project build.cs. No, I usually don't modify it in order to compile spinePlugin. The result so far with SpinePlugin added to PublicDependencyModuleNames is the same list of errors. I'll try to get all the files again, maybe my git client didn't update all the files. |
@scardario sorry for the late reply, I've overlooked your last reply. What
UE4 version are you using? There were some changes in recent versions in
the way builds are defined. Also, could you try our sample project from the
GitHub repository?
…On Wed, Jan 23, 2019 at 6:00 PM scardario ***@***.***> wrote:
No, I usually don't modify the build.cs in order to compile spinePlugin.
I tried to though and added SpinePlugin to PublicDependencyModuleNames,
but didn't find PublicIncludePaths to add SpinePlugin/Public and
SpinePlugin/Classes (step 2 of these instructions
<http://esotericsoftware.com/spine-ue4>) and the sample build.cs
<https://github.com/EsotericSoftware/spine-runtimes/blob/3.7/spine-ue4/Source/SpineUE4/SpineUE4.Build.cs#L9>
doesn't show where.
The result so far with SpinePlugin added to PublicDependencyModuleNames is
the same list of errors.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1246 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAfYBMSSZHzk1T1GRIxh6CwiEl-HQltPks5vGJUQgaJpZM4Z4oSb>
.
|
No problem, I've had a busy week too. I'm using unreal 4.20.3, trying to compile main branch - 3.7 I deleted the repository from my disk and cloned it again, and copied the sample project, followed instructions (copy spine-cpp folder to ... etc) and the results are the same. The same errors, at least the same type:
|
Oki, I'll give those steps a try on Monday. FWIW, I'm on 4.21.2 here. |
I've tried to reproduce this without success. @scardario could you figure out a solution to this on your end? |
I see @scardario has posted new UE4 forum threads, I assume you have figured out the include path issue. Closing this. |
A crash occurs with 100% frequency if you reimport the asset data of a spine skeleton while a pawn/actor with that skeleton is in the currently loaded level.
Repro Steps:
Results:
The UE4 editor crashes due to uncaught exceptions
Additional Notes:
It appears this is related to Issue #1180 (Certainly the issue wasn't exposed until we could hot load skeleton data). The uncaught exceptions occur at SpineSkeletonRendererComponent.cpp line 220. It appears that the some or all of the Slots/Attachments in the skeleton have been partially cleaned up.
The text was updated successfully, but these errors were encountered: