rfht / fnaify

Run FNA/XNA games on OpenBSD - DEPRECATED! Check out the successor: https://github.com/IndieRunner/IndieRunner
https://www.PlayOnBSD.com
ISC License
36 stars 2 forks source link

Shenzhen I/O crashes when you write in the editor #34

Closed rfht closed 4 years ago

rfht commented 4 years ago

reported by @reivyr

rfht commented 4 years ago
exception inside UnhandledException handler: (null) assembly:/usr/local/lib/mono/gac/System/4.0.0.0__b77a5c561934e089/System.dll type:Win32Exception member:(null)

[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <140e9c8aca7b45b6a2ccab03bee4c5a7>:0 
  at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in <140e9c8aca7b45b6a2ccab03bee4c5a7>:0 
  at GameLogic+CircuitEditorScreen.#=q7o_SKklIwv1XLFebcgL4ig== (System.Single #=qp2b$fXwZN69dP_N3tmMcpw==) [0x01c66] in <2b8f867b6da340539d72cc51147f62df>:0 
  at GameLogic.#=qwvkOb1r0gUQsqyzgjghyuSfnz2pzenJ$U472ZK$usz8= () [0x01633] in <2b8f867b6da340539d72cc51147f62df>:0 
  at #=qw$AYeDSRlWP5BEzaVDgHug==.#=qQywpvjzLrObXWtZKsng60Q== (System.String[] #=qDoGQnCoMtG6W9RDGBaZKlg==) [0x00048] in <2b8f867b6da340539d72cc51147f62df>:0
reivyr commented 4 years ago

The error is solved with your mono patch: https://pbot.rmdir.de/ggGbmZu_4LAAGPbZ8NAE5g Tested with two puzzles and the solitaire game.

rfht commented 4 years ago

Documenting the patch here inline (because pbot deletes pastes after a while):

Index: Makefile
===================================================================
RCS file: /cvs/ports/lang/mono/Makefile,v
retrieving revision 1.136
diff -u -p -r1.136 Makefile
--- Makefile    14 Apr 2020 14:43:21 -0000  1.136
+++ Makefile    4 Jun 2020 14:10:49 -0000
@@ -5,7 +5,7 @@ USE_WXNEEDED=   Yes
 COMMENT=   cross platform, open source .NET developement framework

 V=     6.8.0.105
-REVISION=  1
+REVISION=  2

 DISTNAME=  mono-${V}

Index: patches/patch-external_corefx_src_Common_src_CoreLib_System_Collections_Generic_List_cs
===================================================================
RCS file: /cvs/ports/lang/mono/patches/patch-external_corefx_src_Common_src_CoreLib_System_Collections_Generic_List_cs,v
retrieving revision 1.1
diff -u -p -r1.1 patch-external_corefx_src_Common_src_CoreLib_System_Collections_Generic_List_cs
--- patches/patch-external_corefx_src_Common_src_CoreLib_System_Collections_Generic_List_cs 11 Nov 2019 17:05:02 -0000  1.1
+++ patches/patch-external_corefx_src_Common_src_CoreLib_System_Collections_Generic_List_cs 4 Jun 2020 14:10:49 -0000
@@ -8,17 +8,25 @@ well-defined cases.
 Index: external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs
 --- external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs.orig
 +++ external/corefx/src/Common/src/CoreLib/System/Collections/Generic/List.cs
-@@ -578,8 +578,11 @@ namespace System.Collections.Generic
-                 action(_items[i]);
+@@ -579,7 +579,10 @@ namespace System.Collections.Generic
              }

--            if (version != _version)
+             if (version != _version)
 -                ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion();
-+            if (Environment.GetEnvironmentVariable ("MONO_FORCE_COMPAT") == null)
 +            {
-+                if (version != _version)
++                if (Environment.GetEnvironmentVariable ("MONO_FORCE_COMPAT") == null)
 +                    ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion();
 +            }
          }

          // Returns an enumerator for this list with the given
+@@ -1160,7 +1163,8 @@ namespace System.Collections.Generic
+             {
+                 if (_version != _list._version)
+                 {
+-                    ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion();
++                    if (Environment.GetEnvironmentVariable ("MONO_FORCE_COMPAT") == null)
++                        ThrowHelper.ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion();
+                 }
+ 
+                 _index = _list._size + 1;
rfht commented 4 years ago

Fixed with https://github.com/openbsd/ports/commit/1a775255dde3b7a31c39c8f28c53e0d30d91d1ed and https://github.com/rfht/fnaify/commit/6cc2e2268c34ef1fa94739d67471b957d9c21c6b