Bug 12619 - Writing to MemoryStream sometimes fails in BlockCopyInternal
Summary: Writing to MemoryStream sometimes fails in BlockCopyInternal
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 2.10.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-06-10 05:53 UTC by Rebex.NET
Modified: 2013-06-13 10:04 UTC (History)
2 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 NOT_REPRODUCIBLE

Description Rebex.NET 2013-06-10 05:53:51 UTC
I'm executing our unit test using NUnit. While on Windows or Debian all tests pass, they sometimes fail with the stacktrace shown below. 
I have not been able to reproduce this issue isolated (without NUnit) yet. I have not been able to catch the exception message as well. 

Stacktrace:

  at (wrapper managed-to-native) System.Buffer.BlockCopyInternal (System.Array,int,System.Array,int,int) <0xffffffff>
  at System.Buffer.BlockCopy (System.Array,int,System.Array,int,int) <0x0004f>
  at System.IO.MemoryStream.Write (byte[],int,int) <0x0008f>
  at System.IO.BinaryWriter.Write (int) <0x0007b>
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject (System.IO.BinaryWriter,long,object) <0x0021b>
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance (System.IO.BinaryWriter,object,bool) <0x00193>
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteValue (System.IO.BinaryWriter,System.Type,object) <0x000f3>
  at TestOutput__TypeMetadata.WriteObjectData (System.Runtime.Serialization.Formatters.Binary.ObjectWriter,System.IO.BinaryWriter,object) <0x0006f>
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObject (System.IO.BinaryWriter,long,object) <0x00268>
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectInstance (System.IO.BinaryWriter,object,bool) <0x00193>
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteQueuedObjects (System.IO.BinaryWriter) <0x0002b>
  at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteObjectGraph (System.IO.BinaryWriter,object,System.Runtime.Remoting.Messaging.Header[]) <0x0004b>
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream,object,System.Runtime.Remoting.Messaging.Header[]) <0x0020b>
  at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize (System.IO.Stream,object) <0x00017>
  at System.Runtime.Remoting.RemotingServices.SerializeCallData (object) <0x0008b>
  at (wrapper xdomain-invoke) NUnit.ConsoleRunner.EventCollector.TestOutput (NUnit.Core.TestOutput) <0xffffffff>
  at NUnit.Core.OutputEvent.Send (NUnit.Core.EventListener) <0x0001f>
  at NUnit.Core.EventPump.PumpThreadProc () <0x000a3>
  at System.Threading.Thread.StartInternal () <0x00059>
  at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <0xffffffff>

Native stacktrace:

        0  mono                                0x000959dc mono_handle_native_sigsegv + 284
        1  mono                                0x00004a48 mono_sigsegv_signal_handler + 248
        2  libsystem_c.dylib                  0x99ae38cb _sigtramp + 43
        3  ???                                0xffffffff 0x0 + 4294967295
        4  mono                                0x00137d20 ves_icall_System_Buffer_BlockCopyInternal + 160
        5  ???                                0x04801d30 0x0 + 75504944
        6  ???                                0x04801b30 0x0 + 75504432
        7  ???                                0x0480c438 0x0 + 75547704
        8  ???                                0x0480c334 0x0 + 75547444
        9  ???                                0x0480d3fc 0x0 + 75551740
        10  ???                                0x0480d03c 0x0 + 75550780
        11  ???                                0x048111f4 0x0 + 75567604
        12  ???                                0x04ef88d8 0x0 + 82807000
        13  ???                                0x0480d449 0x0 + 75551817
        14  ???                                0x0480d03c 0x0 + 75550780
        15  ???                                0x0480cdcc 0x0 + 75550156
        16  ???                                0x0480cc4c 0x0 + 75549772
        17  ???                                0x0480b944 0x0 + 75544900
        18  ???                                0x0480b720 0x0 + 75544352
        19  ???                                0x048df274 0x0 + 76411508
        20  ???                                0x04ed8b28 0x0 + 82676520
        21  ???                                0x04ef8398 0x0 + 82805656
        22  ???                                0x04ed98cc 0x0 + 82680012
        23  ???                                0x048e3ea2 0x0 + 76431010
        24  ???                                0x04807ab9 0x0 + 75528889
        25  mono                                0x0000ce02 mono_jit_runtime_invoke + 722
        26  mono                                0x001a849a mono_runtime_invoke + 170
        27  mono                                0x001a9d12 mono_runtime_delegate_invoke + 146
        28  mono                                0x001eefb6 start_wrapper_internal + 726
        29  mono                                0x001ef057 start_wrapper + 23
        30  mono                                0x0023599e thread_start_routine + 206
        31  mono                                0x0026fd68 GC_start_routine + 120
        32  libsystem_c.dylib                  0x99af75b7 _pthread_start + 344
        33  libsystem_c.dylib                  0x99ae1d4e thread_start + 34
Comment 1 Rodrigo Kumpera 2013-06-11 09:42:50 UTC
Please provide a test case that shows this behavior.
Comment 2 Rebex.NET 2013-06-13 10:04:59 UTC
I'm sorry, we cannot reproduce it reliably. The exception occurs irregularly and we were not able to determine condition for deterministic repro.

Initially I thought the stacktrace may look familiar for someone and you can send us some hint, what would be cause of the exception.