-
Notifications
You must be signed in to change notification settings - Fork 67
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
[REGRESSION] Host can throw InvalidOperationException at any point in time #58
Comments
FabianTerhorst
pushed a commit
that referenced
this issue
Sep 23, 2019
…e to keep the ResourceAssemblyLoadContext alive until ExecuteResourceUnload is called. (#59)
Thanks, the pr is merged and everyone has confirmed that it's fixed for them. |
FabianTerhorst
added a commit
that referenced
this issue
Oct 8, 2019
* Improve dimension update for networking entity * Update altv-cpp-api * Fix resource restart * Cleanup example * Add player connect documentation * Improve websocket data handling * Update networking entity version * Improve docs * Filter auto generated apis * Add player communication * Add more weapon extensions to player * Improve entity streamer imports * Return assembly for assembly loading * update cpp sdk * Make root directory lookup lazy * Optimize server script event * Improve script runtime delete * update cpp sdk * Cleanup coreclr * Update CSharpResourceImpl.cpp * Cleanup runtime implementation * Improve coreclr execution results * Fix exports * Add explosion and weapon damage events * update versions * Fix windows build * Cleanup mvalue on import * Code cleanup * Add create logging * Some more cleanup and logging * Remove logging * Cleanup delegates * Rewrite delegate handling * Fixed resource delegates from being garbage collected * Fixed spelling of Weapons.CompatPwd, Weapons.CarbinRifle and Weapons.Fired * Small export improvements * Export logging * Improve mvalue pointers for windows * Update resource.cpp * Update CSharpResourceImpl.cpp * Fix assemblyloadcontext unloading * Add hostwrapper imports * Update dotnet core version * Improve host import export * Fix host import * Update versions * Improve MValue_CallFunctionValue * Add logging * Move invoker create and destroy to csharp impl * Return alt::MValueFunction::Invoker pointer instead of pointer to custom implementation * Use default MValue constructor for function creation * Improve mvalue constructor call * Add logging * Improve performance and fix mvalue create function * Add experimental tracing * Catch hostwrapper function setters * Disable tracing result for now * Add EventParams attribute * Throw when null arguments array is provided * Add nullable types support to server events * Fix nullables * Added Equals and GetHashCode methods to some classes Position, Rgba a… …nd Rotation, fixed spelling of BodyPart.LeftElbrow and BodyPart.RightElbrow, removed unused imports, removed unnecessary constructors and initializers & Minor formatting fixes in Position and Rotation (#57) * Added Equals and GetHashCode methods to some classes Position, Rgba and Rotation, fixed spelling of BodyPart.LeftElbrow and BodyPart.RightElbrow, removed unused imports, removed unnecessary constructors and initializers * Fix #58 (random InvalidOperationException) by using a strong reference to keep the ResourceAssemblyLoadContext alive until ExecuteResourceUnload is called. (#59) * Improve default AuthenticationProvider to accept new players after exceptions, cleanup mvalues in function wrapper call * Update dependencies, fix async events, improve async damage event * Move cdn publish above github * Indent travis file * Update dotnet travis version * Remove websocket from networking client on broken connection * Improve tracing api * update Versions * Update .travis.yml * Add Resource start / stop and error events * update cpp-sdk * Update altv-cpp-api * Add NativeResource pool to reuse resource instances and provide own native resource factory * Last minute event rename * Fix colored message * Update cpp-sdk Add Server.Start/Stop/Restart resource * Remove includes that are now included in altv sdk.h * Update versions * workaround * Update resource event delegates allocation * indent host * Add IEntity::NetworkOwner * Update versions * update build * Add code generator for p/invokes (#66) * Add c header source code parser and p invoke method generator * A lot of parser and generator improvements, fix negative dimensions discovered in parsing, cleanup none used exports * Remove old import * Fix col shapes entity in * Write resource communication docs (#70) * Update protobuf, Update networking entity version, Add networking entity icon (#71) * Update protobuf * Update AltV.Net.NetworkingEntity * Add NetworkingEntity nuget icon * update cpp sdk (#73) * Validate thread safety for api calls (#75) * Feature/improve websocket client lock (#76) * Lock client websocket for disconnect or connection broken connection broken * Feature/enum function parser (#77) * Add enum support to function parser * Add icons for AltV.Net and AltV.Net.Async * Upload debug dlls Debug dlls for AltV.Net and AltV.Net.Async * Create debug dlls upload directory * publish debug pdb files * Fix death events for passive deaths * Fix death event * Fix compile * Added ExplosionType enum (#88) * Added ExplosionTypes enum * Fix deprecated webview resource path (#69) * Feature/dynamic module system (#67) * Make method indeer public * AltV.Net.Chat -> AltV.Net.Resources.Chat * Add dynamic module api * Add FunctionStringParsers to Function and make CalculateStringInvokeValues and InvokeNoResult public * Add dynamic module for chat named AltV.Net.Resources.Chat.Api * Add sample chat command * Init dynamic modules before resource started * Fix typo in function init * Fix chat register command function for default js chat resource * Add dynamic module OnStop, dispose all gchandles in chat module * Update CSharpResourceImpl.cpp * Create AltV.Net.nuspec
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is currently a regression bug in the
AltV.Net.Host
implementation, that can lead to the following exception:As it turns out, the
Host
class only holds a weak reference to the load context in its static dictionary and no other objects are holding any references on it.coreclr-module/api/AltV.Net.Host/Host.cs
Lines 100 to 103 in f97394f
Therefore, the load context is eligible for garbage collection at any time!
This is exactly what happens in our case, when we load larger libraries with lots of dependencies in our
ServerResource.OnStart()
method.It happens at different points in time, with different assemblies, but GC is always triggert at some point in the start process and an exception is thrown on the next try to load an assembly into the already finalized load context.
This is a regression. It should work on the master branch, because it does not use a
WeakReference
there.I will provide a PR, that fixes this issue and should not leak any memory either.
This was reported to our repo as a possible .NET Core 3.0 incompatibility of our database provider, but turned out to be unrelated to that (PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#825).
/cc @lsvMoretti
The text was updated successfully, but these errors were encountered: