Alaska Software Inc. - waa hangs on shutdown
Username: Password:
AuthorTopic: waa hangs on shutdown
Les C. Csehwaa hangs on shutdown
on Thu, 15 Sep 2005 11:13:26 -0400
Any idea how to figure out what is causing WAA to hang when shutting it 
down?

I click the close button in the top-right of the waa window, click Yes to 
confirm I want to shut WAA down. It shows that the first (of 4) package dlls 
has been unloaded. And then hangs. Whether in regular or debug mode.

And all the WAA?????.LOG file shows si the same message about the first 
package having been unloaded.

Thanks in advance,

Les
Vladimir IahnencoRe: waa hangs on shutdown
on Thu, 15 Sep 2005 19:21:06 -0400
Hi Les,
How many packages have you loaded? If more then one, try to figure out which 
one causes the hung.
When you unload waa and it is hung, check if waa1gate instance in the 
memory, this means one thread is probably active and waa cannot stop it.
Check if you have a dll loaded in  _Register(). Append  _DeRegister() 
function to unload it and perform some clean up if required.
Also this may happens if by chance you compressed your dll.

Try to load and unload waa without any waa packages calls. If it hung, 
something is wrong in _Register() functions. Try comment one by one package 
to figure out which one causes this.

Regards,
Vladimir

"Les C. Cseh" <les.cseh@asapchecks.com> wrote in message 
news:nw0b9fguFHA.2944@S15147418...
> Any idea how to figure out what is causing WAA to hang when shutting it 
> down?
>
> I click the close button in the top-right of the waa window, click Yes to 
> confirm I want to shut WAA down. It shows that the first (of 4) package 
> dlls has been unloaded. And then hangs. Whether in regular or debug mode.
>
> And all the WAA?????.LOG file shows si the same message about the first 
> package having been unloaded.
>
> Thanks in advance,
>
> Les
>
>
Vladimir IahnencoRe: waa hangs on shutdown
on Thu, 15 Sep 2005 19:31:12 -0400
One more thing,
How many WAA_WORKERTHREADS do you have? I don't think you have/need more 
then 10.
Try to reduce them to for example 5, and check the logs if one of them by 
chance went in a do-while loop.

Regards,
Vladimir

"Les C. Cseh" <les.cseh@asapchecks.com> wrote in message 
news:nw0b9fguFHA.2944@S15147418...
> Any idea how to figure out what is causing WAA to hang when shutting it 
> down?
>
> I click the close button in the top-right of the waa window, click Yes to 
> confirm I want to shut WAA down. It shows that the first (of 4) package 
> dlls has been unloaded. And then hangs. Whether in regular or debug mode.
>
> And all the WAA?????.LOG file shows si the same message about the first 
> package having been unloaded.
>
> Thanks in advance,
>
> Les
>
>
Phil Ide
Re: waa hangs on shutdown
on Fri, 16 Sep 2005 12:15:23 +0100
Les,

> Any idea how to figure out what is causing WAA to hang when shutting it 
> down?

THis may be totally unrelated, and probably is, but there is problem with
unloading certain dynamic dll's (you DID compile your dll's with the
/dll:dynamic switch didn't you?).

The problem is where a dynamically loaded DLL (or any DLL statically linked
to it) contains the definition for a CLASS.  If any instance of this class
has been instantiated, then unloading the DLL will cause the code for the
class to be unloaded.  However, any instances of the class which still
exist in memory will require this code.

Do not think that because there are no active instances of the class that
the class code is not required.  Inactive instances require the class code
to be available in order for the garbage collector to properly destroy
out-of-scope objects.

If your WAA package loads HRF, and you attempt to unload the package
through the WAA console, you'll get a crash.  You can see this better
through the debugger, even if you close WAA down - because it will attempt
to unload each package (and any DLL's each package has loaded).  The result
will be a normal shutdown as far as your logs are concerned,  but the
debugger will notify you that the application has crashed.

The only fix I can see is for Alaska to add code to the _DllMain()
procedure to force a full cycle of the GC before unloading any DLL -
however thi will have a severe impact on the performance of your
application while this occurs, and is probably better remedied in other
ways (i.e. by you deciding not to unload DLL's that contain class
definitions except as part of the application shutdown sequence).

Regards,

Phil Ide

*******************************************
*   Xbase++ FAQ, Libraries and Sources:   *
*   goto: http://www.idep.org.uk/xbase    *
* --------------------------------------- *
* www.xodc.org.uk - openSource Dev-Center *
*******************************************

He who throws mud loses ground.