Bug report - AGS 3.0.23 - Attempted to read or write protected memory

Started by Stian78, Mon 24/03/2008 12:01:53

Previous topic - Next topic

Stian78

Hello.
After running my game in the no-debug mode, the following error is triggered. It actually makes AGS completely unstable, and it will reoccur when typing, clicking icons etc:

Error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Version: AGS 3.0.0.23

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
   at System.Drawing.SafeNativeMethods.Gdip.GdipFillPath(HandleRef graphics, HandleRef brush, HandleRef path)
   at System.Drawing.Graphics.FillPath(Brush brush, GraphicsPath path)
   at AGS.Editor.TabbedDocumentContainer.DrawPane(Graphics graphics, ContentDocument pane, Boolean selected, Int32 x, Int32 y)
   at AGS.Editor.TabbedDocumentContainer.tabsPanel_Paint(Object sender, PaintEventArgs e)
   at System.Windows.Forms.Control.OnPaint(PaintEventArgs e)
   at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
   at System.Windows.Forms.Control.WmPaint(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

At the time being, the script for room9 (where the error seems to occur) is quite simple:

function room_AfterFadeIn()
{
object[0].SetView(28,0,0);
object[0].Animate(0, 5, eOnce, eBlock, eForwards);
character[EGO].Walk(142, 128, eBlock, eAnywhere);
object[0].Animate(0, 5, eOnce, eBlock, eBackwards);
}

Quite vexing...  :-\

That being said: Thanx for the v.3.0 - and for a great program all together!  8)

Pumaman

Hmm, seems to be a crash inside the .NET Framework itself. So does this start happening immediately after you exit the game after testing it? Does it matter which tab pane is selected in the editor? Does it happen every time?

Stian78

Quote from: Pumaman on Mon 24/03/2008 22:28:40
Hmm, seems to be a crash inside the .NET Framework itself. So does this start happening immediately after you exit the game after testing it? Does it matter which tab pane is selected in the editor? Does it happen every time?

I worked with AGS several hours yesterday, and did find a way to avoid the crash: Close every editing window manually before testing the game (script window and room edit window). As of now, doing so has avoided the chrash initially reported.

I also have problems with cut/copy/paste (Yes, I have seen it reported by others), but I don't know whether these to problems are related. I'm not at all familiar with the .NET Framework. I learned my C++ back in them good ol' DOS-days...  ;D

Have a nice day.

cat

Uh, I have an idea. Perhaps this is because windows runs out of GDI resources. Although .NET uses a garbage collector there might be GDI resources not freed. This can happen for example when attaching gui components to events of static classes. If this ever happens again, please check in windows taskmanager the number of used GDI objects.

Just a guess.

Pumaman

Quote from: Stian78 on Tue 25/03/2008 05:36:30
I worked with AGS several hours yesterday, and did find a way to avoid the crash: Close every editing window manually before testing the game (script window and room edit window). As of now, doing so has avoided the chrash initially reported.

Hmm, interesting. Could you please answer my questions:

When does the crash start happening? Immediately after you exit the game after testing it?
Does it matter which tab pane is selected in the editor? Does it happen every time?

Stian78

Quote from: Pumaman on Tue 25/03/2008 15:23:13
Quote from: Stian78 on Tue 25/03/2008 05:36:30
I worked with AGS several hours yesterday, and did find a way to avoid the crash: Close every editing window manually before testing the game (script window and room edit window). As of now, doing so has avoided the chrash initially reported.

Hmm, interesting. Could you please answer my questions:

When does the crash start happening? Immediately after you exit the game after testing it?
Does it matter which tab pane is selected in the editor? Does it happen every time?

Yes, of course...  :=

Chrash occurs only after quiting the game in an ordinary way in the fullscreen F5-mode (There is a 1-2 sec black screen delay before the error-message appears). Running in debug-mode has not triggered a chrash.

The chrash occurs ONLY when one of the edit-tabs are open (even the start-tab). And yes, it appears to happen every time.

As I stated earlier, if none of the tabs are open the chrash will not occur.

I'm running an up-to-date Win XP with 2GBs ram, by the way.

SMF spam blocked by CleanTalk