[1.09.06] Crash on AIs turn (Full Version)

All Forums >> [New Releases from Matrix Games] >> Shadow Empire >> Tech Support



Message


YppY -> [1.09.06] Crash on AIs turn (7/11/2021 3:29:10 PM)

Got a game crash on AIs turn. It did not happen again when I ran the turn again. Here is the crash log:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: Object is currently in use elsewhere.
at System.Drawing.Bitmap.UnlockBits(BitmapData bitmapdata)
at WindowsApplication1.DrawMod.CopyPerLineAndGrayscale(Bitmap& from, Bitmap& dest, Int32 fx, Int32 fy, Int32 fw, Int32 fh, Int32 x, Int32 y, Int32 tr, Int32 tg, Int32 tb, Int32 ta) in G:\VR\VRDevelopment\WindowsApplication1\GUI\GraphicsAndSounds\DrawMod.vb:line 335
at WindowsApplication1.DrawMod.DrawSimplePart2ColouredNewFast(Graphics& objGraphics, Bitmap& objBitmap, Rectangle srcrect, Rectangle destrect, Single r, Single g, Single b, Single a, Bitmap& destBitmap) in G:\VR\VRDevelopment\WindowsApplication1\GUI\GraphicsAndSounds\DrawMod.vb:line 589
at WindowsApplication1.CustomBitmapClass.DrawHeightMap(Graphics& useg, Int32 cx, Int32 cy, Int32 cmap, Int32 tx, Int32 ty, Int32 Zoom, Boolean forInteriorSea, Bitmap& gBitmap) in G:\VR\VRDevelopment\WindowsApplication1\GUI\GraphicsAndSounds\Se1_CustomBitmapClass.vb:line 320
at WindowsApplication1.CustomBitmapClass.DrawHex(Int32 cx, Int32 cy, Int32 cmap, Boolean InfoMode, Boolean NoShader, Boolean ispredrawing, Graphics tempg, Int32 tx, Int32 ty, Int32 counteralpha, Int32 Zoom, Boolean UseRegimeColoring, Boolean neverusehistory, Boolean combatSetup, Bitmap& gBitmap, Boolean& tFromMapPopup) in G:\VR\VRDevelopment\WindowsApplication1\GUI\GraphicsAndSounds\Se1_CustomBitmapClass.vb:line 10015
at WindowsApplication1.MapPartClass.Paint() in G:\VR\VRDevelopment\WindowsApplication1\GUI\Subparts\OldSubparts\MapPartClass.vb:line 505
at WindowsApplication1.MapWindowClass2.DoRefresh() in G:\VR\VRDevelopment\WindowsApplication1\GUI\Windows\Se1_Windows\Se1_MapWindowClass2.vb:line 613
at WindowsApplication1.HistoryScreenClass2.HandleWR(WindowReturnClass wr, Boolean setflag, ScreenReturnClass& obj) in G:\VR\VRDevelopment\WindowsApplication1\GUI\Screens\NewScreens\HistoryScreenClass2.vb:line 100
at WindowsApplication1.HistoryScreenClass2.HandleTimer() in G:\VR\VRDevelopment\WindowsApplication1\GUI\Screens\NewScreens\HistoryScreenClass2.vb:line 416
at WindowsApplication1.Form1.Timer1_Tick(Object sender, EventArgs e) in G:\VR\VRDevelopment\WindowsApplication1\Form1.vb:line 2284
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4360.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
WindowsApplication1
Assembly Version: 1.0.7849.22899
Win32 Version: 1.0.7849.22899
CodeBase: file:///C:/Program%20Files%20(x86)/Steam/steamapps/common/Shadow%20Empire/ShadowEmpire.exe
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 10.0.0.0
Win32 Version: 14.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4360.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4360.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
irrKlang.NET4
Assembly Version: 1.0.6617.18847
Win32 Version:
CodeBase: file:///C:/Program%20Files%20(x86)/Steam/steamapps/common/Shadow%20Empire/irrKlang.NET4.DLL
----------------------------------------
ICSharpCode.SharpZipLib
Assembly Version: 0.84.0.0
Win32 Version: 0.84.0.0
CodeBase: file:///C:/Program%20Files%20(x86)/Steam/steamapps/common/Shadow%20Empire/ICSharpCode.SharpZipLib.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.





Vic -> RE: [1.09.06] Crash on AIs turn (7/16/2021 9:20:47 AM)

This kind of crash seems to be extremely rare and might have been caused by alt-tabbing or other windows-interop. If it happens to you again let me know

Best wishes,
Vic




zgrssd -> RE: [1.09.06] Crash on AIs turn (7/16/2021 12:22:35 PM)


quote:

ORIGINAL: Vic

This kind of crash seems to be extremely rare and might have been caused by alt-tabbing or other windows-interop. If it happens to you again let me know

Best wishes,
Vic

The error message itself I know well. It pops up all over Stackoverflow - "System.InvalidOperationException: Object is currently in use elsewhere"
As you recently added some Multithreading, it is propably related to that and forgetting to invoke: https://stackoverflow.com/questions/14703698/invokedelegate/14703806#14703806

The likely culptript is Windows Forms Modification from another thread. However those would trigger for any attempt to write from that thread.
I found something that GDI+ objects are doing a wierd kind of locking, where they throw a exception if a second thread tries to use it at the same time: https://stackoverflow.com/a/1852451/3346583




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
2.078125