On 28.07.2025 13:51, Rick McGuire wrote:
You broke, you fix it.
:)
But having said that, I see one obvious problem. Updating the instance field of an InstanceBlock
is a very, very, very bad idea. That was a new interpreter instance that was created for that
block of code that will be automatically removed when it goes out of scope. Changing this means a)
you are preventing that instance from getting cleaned up when it's supposed to, and b) when the
destructor runs, you are cleaning up the instance that has already been detached. The dispatching
internals are going to be seriously messed up.
Thanks. Enclosed the code in a proper block to make sure that the instance is
available:
// the resource lock needs to be released here because unloading
packages
// will require the kernel lock, which can never be requested while
holding
// the resource lock
try
{
// this may seem funny, but we need to create an instance
// to shut down so that the package manager can unload
// the libraries (it needs to pass a RexxThreadContext
// pointer out to package unloaders, if they are defined)
InstanceBlock tmpInstance;
*// make sure that attaching and detaching is done for this
particular block {*
InstanceAttacherDetacher instAttDet(tmpInstance.instance);
// run whatever uninits we can before we start releasing the
libraries
memoryObject.lastChanceUninit();
PackageManager::unload();
*}*
}
catch (ActivityException)
{
// we're shutting down, so ignore any failures while processing this
}
Ran the testsuite on Windows and it did not crash anymore, hence planning to commit this version to
see how it fares on the Jenkins farm.
Any comments, hints, suggestions before doing so?
---rony
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel