[Mono-dev] StackOverflow in System.Array.Clear

lambdalice marisachar at gmail.com
Mon Feb 3 14:35:47 UTC 2014


Hi there!
I'm lambdalice, a 16 years old Japanese student studying the .NET
technology.
I like Nemerle, a multi paradigm .NET program language and use it.

One day I've tried to process some Nemerle macro, which converts a brainf*ck
into a Nemerle code.
It perfectly works on the native(?) Windows .NET environment and the Mono
for Windows.
But, in Mono on Linux, it fails with a strange error message:

Stack overflow in unmanaged: IP: 0xb7565a1a, fault addr: 0xb5b43fac
Stack overflow in unmanaged: IP: 0x80e9cc7, fault addr: 0xb5b42fcc
Stack overflow in unmanaged: IP: 0x80e9cbe, fault addr: 0xb5b42ffc
Stack overflow in unmanaged: IP: 0x81b21fe, fault addr: 0xb5b42fa0
bfrun.n:20:1:20:357: error: internal compiler error: got some unknown
exception of type System.StackOverflowException: The requested operation
caused a stack overflow.
  at (wrapper managed-to-native) System.Array:ClearInternal
(System.Array,int,int)
  at System.Array.Clear (System.Array array, Int32 index, Int32 length)
[0x00000] in <filename unknown>:0 
  at System.Collections.Generic.Queue`1[Nemerle.Builtins.FunctionVoid].Clear
() [0x00000] in <filename unknown>:0 
  at Nemerle.Compiler.Solver.Enqueue (Nemerle.Builtins.FunctionVoid action)
[0x00000] in <filename unknown>:0 
  at Nemerle.Compiler.TypesManager.EmitDecls () [0x00000] in <filename
unknown>:0 
  at Nemerle.Compiler.ManagerClass.Run () [0x00000] in <filename unknown>:0 
  at Nemerle.CommandlineCompiler.MainClass.main_with_catching () [0x00000]
in <filename unknown>:0 

I can't imagine why only the Array.Clear causes stack overflow.
Array.ClearInternal looks going internally into a native code.
I'm not good at the C language and not know about implementation of Array in
Mono, so I couldn't realize how the exception happens.

The source code causing that issue is here: github.com/lambdalice/MacroBF
and the Nemerle compiler is available at: nemerle.org
The my unofficial APT repo which contains the latest Nemerle compiler:
lambdalice.github.io/repo/

Please see also the discussion in the Nemerle forum:
groups.google.com/forum/#!topic/nemerle-en/xNrjBBqtoYE
and any help please. thanks



--
View this message in context: http://mono.1490590.n4.nabble.com/StackOverflow-in-System-Array-Clear-tp4661836.html
Sent from the Mono - Dev mailing list archive at Nabble.com.


More information about the Mono-devel-list mailing list