Fix crash on aot unloading#106502
Conversation
|
I don't think that error is anything to do with this pr. Someone correct me if I'm wrong tho and I'll fix it |
|
This is correct, NativeAOT does not support unloading. I'm not sure why we're reusing the
Yes, the CI errors are unrelated to this PR. I see someone already restarted the CI check. |
|
Sounds good! I'll go update it :) |
|
@raulsntos Fixed per suggestion! :) At least I think I did. Is that the idiomatic way to discard the result of a variable that would have normally been assigned to? Or is there a different way that is normally taken in the godot repo? |
raulsntos
left a comment
There was a problem hiding this comment.
Thanks. I think it's fine, but we could also remove the argument in the try_load_native_aot_library function since this is the only place where we call it.
|
Thanks! |
We are currently debugging why AOT build are crashing on ios devices. In doing so, we tried to reproduce it on our Linux devices. I'm unable to reproduce the ios crash on linux BUT I did discover a new crash on Linux. I expect this issue applies to all platforms when exiting the application as well. Anyways, the segfault is due to attempting to unload the .net aot dll on program exit. .NET does not support this for aot builds. Here's the issue confirming as such on the .net side:
dotnet/runtime#79348
The fix is simple. Don't unload aot dll's and just let them die with the process on program exit :)