Bug 8042 - mono StackOverflowExceptions thrown with ikvm + NetalyzrCLI.jar
Summary: mono StackOverflowExceptions thrown with ikvm + NetalyzrCLI.jar
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-10-29 08:13 UTC by Brian Reiter
Modified: 2017-07-13 00:21 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Brian Reiter 2012-10-29 08:13:26 UTC
I'm attempting to use Mono 3.0 beta on OS X with ikvm-7.1.4532.2 to run Berkely Netalyzr: http://netalyzr.icsi.berkeley.edu/cli.html. This is the 32-bit distribution binary from mono-project.com. I am getting StackOverflowExceptions being thrown when allocating new arrays by __icall_wrapper_mono_array_new_specific (intptr,int) with the Boem GC. I am getting a StackOverflowExcpetion at System.Diagnostics.StackFrame:get_frame_info (int,bool,System.Reflection.MethodBase&,int&,int&,string&,int&,int&) with the SGen GC. 

The exceptions aren't thrown deterministically in the code of Netalyzr but instead almost exactly after about 2min 6sec of execution.

In order to avoid an IPV6 exception, I enabled ipv6 in machine.config. I also ran this on Windows Server 2012 with the default .NET install and it successfully runs to completion.


$ mono --debug ikvm.exe -jar ../../NetalyzrCLI.jar 
====      ICSI Netalyzr CLI, build 48426       ====
====          29-10-2012 10:47:04 UTC          ====
==== ID ae81b058-14467-3bb758b8-1923-4b96-825e ====

02:07 30/108  Checking DNS lookup performance...Stack overflow in unmanaged: IP: 0x27bd5f, fault addr: 0xb0619ff0

Unhandled Exception:
System.StackOverflowException: The requested operation caused a stack overflow.
  at (wrapper managed-to-native) object:__icall_wrapper_mono_array_new_specific (intptr,int)
  at System.Collections.ArrayList..ctor (System.Object[] array, Int32 index, Int32 count) [0x0001d] in /private/tmp/source/bockbuild/profiles/mono-mac-release/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/corlib/System.Collections/ArrayList.cs:2611 
  at System.Collections.ArrayList.Clone () [0x00000] in /private/tmp/source/bockbuild/profiles/mono-mac-release/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/corlib/System.Collections/ArrayList.cs:3209 
  at ikvm.internal.Winsock.copy (ikvm.internal.Winsock$fd_set ) [0x00000] in <filename unknown>:0 
  at ikvm.internal.Winsock.select (ikvm.internal.Winsock$fd_set , ikvm.internal.Winsock$fd_set , ikvm.internal.Winsock$fd_set , ikvm.internal.Winsock$timeval ) [0x00000] in <filename unknown>:0 
  at java.net.net_util_md.NET_Timeout (System.Net.Sockets.Socket , Int64 ) [0x00000] in <filename unknown>:0 
  at java.net.TwoStacksPlainDatagramSocketImpl_c.receive0 (ikvm.internal.JNI$JNIEnv , java.net.TwoStacksPlainDatagramSocketImpl , java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at java.net.TwoStacksPlainDatagramSocketImpl.receive0 (java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.TwoStacksPlainDatagramSocketImpl:receive0 (java.net.DatagramPacket)
  at java.net.TwoStacksPlainDatagramSocketImpl.receive (java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.TwoStacksPlainDatagramSocketImpl:receive (java.net.DatagramPacket)
  at java.net.DatagramSocket.receive (java.net.DatagramPacket p) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.DatagramSocket:receive (java.net.DatagramPacket)
  at Netalyzr$NetProbeStats.run () [0x00000] in <filename unknown>:0 
  at Netalyzr$8.runImpl () [0x00000] in <filename unknown>:0 
  at Netalyzr$Test.run () [0x00000] in <filename unknown>:0 


$ mono ikvm.exe -jar ../../NetalyzrCLI.jar 
====      ICSI Netalyzr CLI, build 48426       ====
====          29-10-2012 10:31:43 UTC          ====
==== ID ae81b058-14467-86ba830b-9c73-4727-9dcc ====

02:06 26/108  Checking DNS usage of EDNS and DNSSEC...Stack overflow in unmanaged: IP: 0x27bd5f, fault addr: 0xb0597f10

Unhandled Exception:
System.StackOverflowException: The requested operation caused a stack overflow.
  at (wrapper managed-to-native) object:__icall_wrapper_mono_array_new_specific (intptr,int)
  at System.Array.Resize[StackFrame] (System.Diagnostics.StackFrame[]& array, Int32 newSize) [0x00000] in <filename unknown>:0 
  at System.Collections.Generic.List`1[System.Diagnostics.StackFrame].set_Capacity (Int32 value) [0x00000] in <filename unknown>:0 
  at System.Collections.Generic.List`1[System.Diagnostics.StackFrame].GrowIfNeeded (Int32 newCount) [0x00000] in <filename unknown>:0 
  at System.Collections.Generic.List`1[System.Diagnostics.StackFrame].Add (System.Diagnostics.StackFrame item) [0x00000] in <filename unknown>:0 
  at System.Diagnostics.StackTrace.init_frames (Int32 skipFrames, Boolean fNeedFileInfo) [0x00000] in <filename unknown>:0 
  at System.Diagnostics.StackTrace..ctor (Boolean fNeedFileInfo) [0x00000] in <filename unknown>:0 
  at java.lang.Throwable.fillInStackTrace () [0x00000] in <filename unknown>:0 
  at java.lang.Throwable.instancehelper_fillInStackTrace (System.Exception this) [0x00000] in <filename unknown>:0 
  at java.lang.Throwable..ctor (System.String message) [0x00000] in <filename unknown>:0 
  at java.lang.Exception..ctor (System.String message) [0x00000] in <filename unknown>:0 
  at java.io.IOException..ctor (System.String message) [0x00000] in <filename unknown>:0 
  at java.io.InterruptedIOException..ctor (System.String s) [0x00000] in <filename unknown>:0 
  at java.net.SocketTimeoutException..ctor (System.String msg) [0x00000] in <filename unknown>:0 
  at ikvm.internal.JNI.JNU_ThrowByName (ikvm.internal.JNI$JNIEnv , System.String , System.String ) [0x00000] in <filename unknown>:0 
  at java.net.TwoStacksPlainDatagramSocketImpl_c.receive0 (ikvm.internal.JNI$JNIEnv , java.net.TwoStacksPlainDatagramSocketImpl , java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at java.net.TwoStacksPlainDatagramSocketImpl.receive0 (java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.TwoStacksPlainDatagramSocketImpl:receive0 (java.net.DatagramPacket)
  at java.net.TwoStacksPlainDatagramSocketImpl.receive (java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.TwoStacksPlainDatagramSocketImpl:receive (java.net.DatagramPacket)
  at java.net.DatagramSocket.receive (java.net.DatagramPacket p) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.DatagramSocket:receive (java.net.DatagramPacket)
  at Netalyzr$NetProbeStats.run () [0x00000] in <filename unknown>:0 
  at Netalyzr$8.runImpl () [0x00000] in <filename unknown>:0 
  at Netalyzr$Test.run () [0x00000] in <filename unknown>:0 


$ mono-sgen --debug ikvm.exe -jar ../../NetalyzrCLI.jar 
====      ICSI Netalyzr CLI, build 48426      ====
====         29-10-2012 11:45:59 UTC          ====
==== ID 43ca208a-7367-fd7358ce-0e4e-4da1-8f98 ====

02:06 27/108  Checking for DNS support for TCP...Stack overflow in unmanaged: IP: 0x9615a5e4, fault addr: 0xb0619ffc

Unhandled Exception:
System.StackOverflowException: The requested operation caused a stack overflow.
  at (wrapper managed-to-native) System.Diagnostics.StackFrame:get_frame_info (int,bool,System.Reflection.MethodBase&,int&,int&,string&,int&,int&)
  at System.Diagnostics.StackFrame..ctor (Int32 skipFrames, Boolean fNeedFileInfo) [0x00014] in /private/tmp/source/bockbuild/profiles/mono-mac-release/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/corlib/System.Diagnostics/StackFrame.cs:89 
  at System.Diagnostics.StackTrace.init_frames (Int32 skipFrames, Boolean fNeedFileInfo) [0x00033] in /private/tmp/source/bockbuild/profiles/mono-mac-release/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/corlib/System.Diagnostics/StackTrace.cs:83 
  at System.Diagnostics.StackTrace..ctor (Boolean fNeedFileInfo) [0x00006] in /private/tmp/source/bockbuild/profiles/mono-mac-release/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/corlib/System.Diagnostics/StackTrace.cs:60 
  at java.lang.Throwable.fillInStackTrace () [0x00000] in <filename unknown>:0 
  at java.lang.Throwable.instancehelper_fillInStackTrace (System.Exception this) [0x00000] in <filename unknown>:0 
  at java.lang.Throwable..ctor (System.String message) [0x00000] in <filename unknown>:0 
  at java.lang.Exception..ctor (System.String message) [0x00000] in <filename unknown>:0 
  at java.io.IOException..ctor (System.String message) [0x00000] in <filename unknown>:0 
  at java.io.InterruptedIOException..ctor (System.String s) [0x00000] in <filename unknown>:0 
  at java.net.SocketTimeoutException..ctor (System.String msg) [0x00000] in <filename unknown>:0 
  at ikvm.internal.JNI.JNU_ThrowByName (ikvm.internal.JNI$JNIEnv , System.String , System.String ) [0x00000] in <filename unknown>:0 
  at java.net.TwoStacksPlainDatagramSocketImpl_c.receive0 (ikvm.internal.JNI$JNIEnv , java.net.TwoStacksPlainDatagramSocketImpl , java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at java.net.TwoStacksPlainDatagramSocketImpl.receive0 (java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.TwoStacksPlainDatagramSocketImpl:receive0 (java.net.DatagramPacket)
  at java.net.TwoStacksPlainDatagramSocketImpl.receive (java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.TwoStacksPlainDatagramSocketImpl:receive (java.net.DatagramPacket)
  at java.net.DatagramSocket.receive (java.net.DatagramPacket p) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.DatagramSocket:receive (java.net.DatagramPacket)
  at Netalyzr$NetProbeStats.run () [0x00000] in <filename unknown>:0 
  at Netalyzr$8.runImpl () [0x00000] in <filename unknown>:0 
  at Netalyzr$Test.run () [0x00000] in <filename unknown>:0 


 mono-sgen --debug ikvm.exe -jar ../../NetalyzrCLI.jar 
====      ICSI Netalyzr CLI, build 48426       ====
====          29-10-2012 11:52:20 UTC          ====
==== ID 43ca253f-11537-ec8e8e2e-667a-4482-ab90 ====

02:06 24/108  Checking local DNS IPv6 support...Stack overflow in unmanaged: IP: 0x9615d961, fault addr: 0xb0619ffc

Unhandled Exception:
System.StackOverflowException: The requested operation caused a stack overflow.
  at (wrapper managed-to-native) System.Diagnostics.StackFrame:get_frame_info (int,bool,System.Reflection.MethodBase&,int&,int&,string&,int&,int&)
  at System.Diagnostics.StackFrame..ctor (Int32 skipFrames, Boolean fNeedFileInfo) [0x00014] in /private/tmp/source/bockbuild/profiles/mono-mac-release/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/corlib/System.Diagnostics/StackFrame.cs:89 
  at System.Diagnostics.StackTrace.init_frames (Int32 skipFrames, Boolean fNeedFileInfo) [0x00033] in /private/tmp/source/bockbuild/profiles/mono-mac-release/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/corlib/System.Diagnostics/StackTrace.cs:83 
  at System.Diagnostics.StackTrace..ctor (Boolean fNeedFileInfo) [0x00006] in /private/tmp/source/bockbuild/profiles/mono-mac-release/build-root/mono-2.11/_build/mono-2.11.git/mcs/class/corlib/System.Diagnostics/StackTrace.cs:60 
  at java.lang.Throwable.fillInStackTrace () [0x00000] in <filename unknown>:0 
  at java.lang.Throwable.instancehelper_fillInStackTrace (System.Exception this) [0x00000] in <filename unknown>:0 
  at java.lang.Throwable..ctor (System.String message) [0x00000] in <filename unknown>:0 
  at java.lang.Exception..ctor (System.String message) [0x00000] in <filename unknown>:0 
  at java.io.IOException..ctor (System.String message) [0x00000] in <filename unknown>:0 
  at java.io.InterruptedIOException..ctor (System.String s) [0x00000] in <filename unknown>:0 
  at java.net.SocketTimeoutException..ctor (System.String msg) [0x00000] in <filename unknown>:0 
  at ikvm.internal.JNI.JNU_ThrowByName (ikvm.internal.JNI$JNIEnv , System.String , System.String ) [0x00000] in <filename unknown>:0 
  at java.net.TwoStacksPlainDatagramSocketImpl_c.receive0 (ikvm.internal.JNI$JNIEnv , java.net.TwoStacksPlainDatagramSocketImpl , java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at java.net.TwoStacksPlainDatagramSocketImpl.receive0 (java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.TwoStacksPlainDatagramSocketImpl:receive0 (java.net.DatagramPacket)
  at java.net.TwoStacksPlainDatagramSocketImpl.receive (java.net.DatagramPacket ) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.TwoStacksPlainDatagramSocketImpl:receive (java.net.DatagramPacket)
  at java.net.DatagramSocket.receive (java.net.DatagramPacket p) [0x00000] in <filename unknown>:0 
  at (wrapper synchronized) java.net.DatagramSocket:receive (java.net.DatagramPacket)
  at Netalyzr$NetProbeStats.run () [0x00000] in <filename unknown>:0 
  at Netalyzr$8.runImpl () [0x00000] in <filename unknown>:0 
  at Netalyzr$Test.run () [0x00000] in <filename unknown>:0
Comment 1 Rodrigo Kumpera 2013-05-18 23:25:48 UTC
Probably related to bug #8517. Zoltan, we need to solve this at some point.
Comment 2 Rodrigo Kumpera 2017-07-13 00:21:30 UTC
async stack unwind was fixed.