Jump to content

My Plugin cant be load Being Used by "Another Process" after crash


Recommended Posts

Hai, im not sure if anyone knows whats happening, but when LSPDFR is running, im able to delete everyones .dlls(as tests), except for my plugin, which says its being used by GTA5 and cant be deleted for that reason, this causes an issue when LSPDFR crashes and you try and reload it, it will continously crash because my plugin is being used by "another process", im not sure what in my code is causing this, but i have seen a few people have this issue with my plugin, and was wondering if anyone had any ideas? Theres an awful lot of code, but i cannot begin to pin point the problem the plugin is https://www.lcpdfr.com/downloads/gta5mods/scripts/28322-immersive-dispatch/

Edited by OfficerPope

Oliver Pope

Link to comment
Share on other sites

  • Management Team

Does this also happen when your plugin is the only active LSPDFR plugin?

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Link to comment
Share on other sites

22 minutes ago, LMS said:

Does this also happen when your plugin is the only active LSPDFR plugin?

I havent checked this i will in the morning, ive seen it happen to only a few people with my plugin, and i feel like i would have heard it more, even from testers if it happened all the time, but i can reproduce it flawlessly at the moment

Oliver Pope

Link to comment
Share on other sites

9 hours ago, LMS said:

Does this also happen when your plugin is the only active LSPDFR plugin?

Ive diagnosed that it only occurs when running my plugin with GrammarPolice, it could be be due to the interaction between the two plugins, and im speaking to the dev of grammarpolice about it, thank you for pointing out that test 🙂

Oliver Pope

Link to comment
Share on other sites

I have this bug too. What makes me curious is that it doesn't matter which dll lspdfr tries to load. Its like every dll in the plugins folder is after that crash not accessible anymore. 

How i came to that conclusion: when i move that specific dll (beeing used by another process) out of the folder the same error occurs with the next dll in the list.

Edited by ziipzaaapM16A4

Take a look at my Plugins:

AmbientAICallouts: Ai get calls too. Callouts can turn into a backup request for the player [YouTube Link]

Search Vehicle Plugin: Simple and more Immersive Vehicle Search Plugin [YouTube Link]

What Was You Name Again?: Get the name of a Suspect even when arrested and placed in your Vehicle [YouTube Link]
Corpse Inspection:  Investigate the corpse. Interact and search for details in a more Cinematic way  [YouTube Link]
[WIP] EnvoirementalCallouts: A couple of Callouts and WorldEvents that are likely to happen to you while you're on duty [Youtube Link]

[OnHold] EMS Support: Be the First Responder of Medical Emergency's and do CPR on Patients [YouTube Link]

 

spacer.png

Checkout my Patreon for Early Access to my mods                                       checkout my Discord Server

Link to comment
Share on other sites

1 minute ago, ziipzaaapM16A4 said:

I have this bug too. What makes me curious is that it doesn't matter which dll lspdfr tries to load. Its like every dll in the plugins folder is after that crash not accessible anymore. 

How i came to that conclusion: when i move that specific dll (beeing used by another process) out of the folder the same error occurs with the next dll in the list.

Yes exactly, im speaking to OPUS about it when he gets up, itll just be how hes reading the targets of the action, not a huge issue but would hope it can be fixed

Oliver Pope

Link to comment
Share on other sites

  • Management Team

Please note that proper DLL isolation without file locking is only really possible when using a separate AppDomain which then requires you to remote all communcation (essentially IPC). You could however try hooking AppDomain.AssemblyResolve and resolve all references using the byte context. This does not create a hard link to the file and might be enough for your case.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Link to comment
Share on other sites

19 hours ago, LMS said:

Please note that proper DLL isolation without file locking is only really possible when using a separate AppDomain which then requires you to remote all communcation (essentially IPC). You could however try hooking AppDomain.AssemblyResolve and resolve all references using the byte context. This does not create a hard link to the file and might be enough for your case.

 

Could you specify how to: 

Quote

hooking AppDomain.AssemblyResolve and resolve all references using the byte context

Edited by ziipzaaapM16A4

Take a look at my Plugins:

AmbientAICallouts: Ai get calls too. Callouts can turn into a backup request for the player [YouTube Link]

Search Vehicle Plugin: Simple and more Immersive Vehicle Search Plugin [YouTube Link]

What Was You Name Again?: Get the name of a Suspect even when arrested and placed in your Vehicle [YouTube Link]
Corpse Inspection:  Investigate the corpse. Interact and search for details in a more Cinematic way  [YouTube Link]
[WIP] EnvoirementalCallouts: A couple of Callouts and WorldEvents that are likely to happen to you while you're on duty [Youtube Link]

[OnHold] EMS Support: Be the First Responder of Medical Emergency's and do CPR on Patients [YouTube Link]

 

spacer.png

Checkout my Patreon for Early Access to my mods                                       checkout my Discord Server

Link to comment
Share on other sites

  • Management Team

Assemblies can be loaded into different "contexts" within an AppDomain. The context used by Load(byte[]) does not resolve Assemblies automatically which means for dependent types/future loads you need to keep track of your loaded assemblies and return the already loaded one if you do not want to end up in DLL hell (where fun things happen like casting MyType to MyType and getting an exception that they are not the same type despite being identical).

 

You hook AppDomain.CurrentDomain.AssemblyResolve and in the callback you check if your specific DLL is being requested. If so, you use the Load(byte[]) overload. See here: https://docs.microsoft.com/en-US/dotnet/api/system.reflection.assembly.load

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Link to comment
Share on other sites

  • 2 months later...

Hi  I am helping a dude with his lspdfr. Lspdfr keeps crashing (occasionally works like 1 in 20 times) one thing i notice is that ragehook is not prompting to unlock files. secondly, in the log there is an error about the process is being used by another and can not be loaded. i gad him install everything from fresh including gta. Everything is up to date. There is no plugins besides lspdfr and no cars or ped. there is a trainer. openiv is fine and all asi loaders installed. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...