Thread

SDK 62 Console bot Application Error when closed (Sdk)

SDK 62 Console bot Application Error when closed // Sdk

1  |  

mauz

Jul 18, 2006, 9:00am
Since SDK 62, my Win32 Console Application bots, even the Simple Greeter Bot sample,
say an Application Error when closed, after return 0:
The instruction at "0x1008468d" referenced memory at "0xffffffff". The memory could not be "read".
Is there a way to close them more gracefully, am I leaving something hanging in memory?
Using Microsoft Visual C++ 6.0, got .NET Framework 2.0 and the latest XP SP2 patches installed.

--
Mauz
http://mauz.info

andras

Jul 18, 2006, 10:36am
[View Quote] Take the aw_term() call out.

--
Andras
"It's MY computer" (tm Steve Gibson)

grimble

Jul 18, 2006, 1:42pm
Can you elaborate on why this is necessary please? In its role of
"terminating" the Activeworlds SDK, its fair to assume that this should shut
up shop gracefully.

Is this a long-term thing or just a stop-gap until build 63? Has the purpose
of aw_term changed now?

Thanks, Grims

[View Quote]

goshenta

Jul 22, 2006, 4:50pm
Do NOT take aw_term() out. That does not solve the problem at all. You need
to completely log out your bot before shutting down the program, that will
solve your problem temporarily until it is fixed.

neophile

Jul 29, 2006, 3:33pm
Goshenta a écrit :
> Do NOT take aw_term() out. That does not solve the problem at all. You need
> to completely log out your bot before shutting down the program, that will
> solve your problem temporarily until it is fixed.
>
>
On my ChatGlobal I'm sure all bots are Out when I send the aw_term();
I try to put a wait loop unblocked to let time SDK shutdown.
Always the same error at the app closing.
I don't know what to do, I'll back to SDK 61 for moment...

mauz

Aug 10, 2006, 3:17pm
[View Quote] Forwarding an email I got from a Mr Steve (no AW name given).
That new aw.dll did not help me either, by the way.
Earlier a certain hacker (ahem) emailed me about the aw_term function in 62
that "it appears that the vector handling of g_instances is wrong".

> AW support told me there is a new 62 release to address this problem. If you go to the SDK download page, it still says it is
> version 62. When I first downloaded the 62 release several weeks ago I got an aw.dll file with a timestamp of July 13, 2006 at
> 4:45pm. When I downloaded 62 yesterday, I got an aw.dll file with a timestamp of August 4, 2006 at 12:34pm.
>
> The new 62 release hasn't helped. I've still got the same application error on program exit. Has the new release worked for
> anyone else?
>
> One potential work around is to have the bot kill its own process. In C#, this is done by:
> Process process = System.Diagnostics.Process.GetCurrentProcess();
> process.Kill();
>
> This does actually terminate the program without any Application Error nonsense. Does anyone know why I really shouldn't do this?
>
> Finally, to AW staff, I must mention that having multiple releases with the same number is truly frowned upon.
>
> Steve

--
Mauz
http://mauz.info

dr. squailboont

Aug 16, 2006, 1:31am
In C with Win32, the following code will also 'work' (in the sense that the Application Error will not show):

TerminateProcess(GetCurrentProcess(), 0);


-- Remarks from the Win32 reference page on 'TerminateProcess', which I assume is the equivalent of your C# code:

The TerminateProcess function is used to unconditionally cause a process to exit. Use it only in extreme circumstances. The state of global data maintained by dynamic-link libraries (DLLs) may be compromised if TerminateProcess is used rather than ExitProcess.

TerminateProcess causes all threads within a process to terminate, and causes a process to exit, but DLLs attached to the process are not notified that the process is terminating.

Terminating a process causes the following:

1. All of the object handles opened by the process are closed.
2. All of the threads in the process terminate their execution.
3. The state of the process object becomes signaled, satisfying any threads that had been waiting for the process to terminate.
4. The states of all threads of the process become signaled, satisfying any threads that had been waiting for the threads to terminate.
5. The termination status of the process changes from STILL_ACTIVE to the exit value of the process.

Terminating a process does not cause child processes to be terminated.
Terminating a process does not necessarily remove the process object from the system. A process object is deleted when the last handle to the process is closed.

grimble

Aug 17, 2006, 7:19am
Hi Mauz,

Is there any chance you could ask the enigmatic Mr Steve to post his
comments in Andras's AW.Bots_And_SDK newsgroup (assuming its not possible to
do so here)? That way we can actively discuss this. I use C# and haven't
experienced a problem with aw_term, so it would be interesting to nail down
the root cause.

Btw ... the aw.dll I'm using is timestamped 12th July 2006 (14:42), but I
will experiment with the 4th August version to see if it solves my other two
issues with Build 62 (no AW_AVATAR_ADD for bot sessions and
AW_EVENT_WORLD_ATTRIBUTES/AW_CALLBACK_ENTER sequencing).

We could really do with an "Announcements" newsgroup or something so that we
can tell when new versions are uploaded (be it correctly numbered or not)
with a change log.

Thanks, Grims.

[View Quote]

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn