[Mono-dev] WeakReference problem

2014-01-29 Thread Tobias Käs
Hi, the generic WeakReferenceT for .NET 4.5 sometimes returns true 
from TryGetTarget even though the target has been collected (the 
out-value is correctly set to null). All my WeakReferences have been 
initialized with non-null values.


Looking at the source at github I can imagine that there is a race 
between the handle.IsAllocated check and the handle.Target retrieval, 
but I'm no expert. Should I file a bug on that one? I'm not sure what 
the expected behavior is since MSDN documentation of that method isn't 
so great, but if the caller has to check the out-value against null 
anyways, then the return value becomes kinda pointless in my opinion.


Regards,
Tobias
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] WeakReference problem

2014-01-29 Thread Rodrigo Kumpera
Please provide a test case that shows this behavior


On Wed, Jan 29, 2014 at 5:00 PM, Tobias Käs tobias.k...@gmx.de wrote:

 Hi, the generic WeakReferenceT for .NET 4.5 sometimes returns true from
 TryGetTarget even though the target has been collected (the out-value is
 correctly set to null). All my WeakReferences have been initialized with
 non-null values.

 Looking at the source at github I can imagine that there is a race between
 the handle.IsAllocated check and the handle.Target retrieval, but I'm no
 expert. Should I file a bug on that one? I'm not sure what the expected
 behavior is since MSDN documentation of that method isn't so great, but if
 the caller has to check the out-value against null anyways, then the return
 value becomes kinda pointless in my opinion.

 Regards,
 Tobias
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Array.Copy endian issue?

2014-01-29 Thread Bassam Tabbara
Hello,

I’m chasing a bug while parsing the machine.config XML file, and I’ve narrowed 
it down to Array.Copy performing the wrong copy. Here’s an example:

before copy 'descript'
after copy ' edcsirt'

The buffer is altered after its copied. This seems to happen only on newer 
versions of linux (3.4.6) on an armv5tel device. When running linux 2.6 I don’t 
see this.

Any thoughts on what might be causing this?

Thanks!
Bassam
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Array.Copy endian issue?

2014-01-29 Thread Bassam Tabbara
A little more details. If I remove the FastCopy call in Array.Copy I am unable 
to reproduce this.

// if (FastCopy (sourceArray, sourceIndex, 
destinationArray, destinationIndex, length))
//   return;

Attached is a test case but it needs to be run on a ARM device with the same 
version of Linux. Happy to provide access to a box if needed.

I’ll open a Xamarin bug too.



Thanks!
Bassam

On Jan 29, 2014, at 3:53 PM, Bassam Tabbara bas...@symform.com wrote:

 Hello,

 I’m chasing a bug while parsing the machine.config XML file, and I’ve 
 narrowed it down to Array.Copy performing the wrong copy. Here’s an example:

 before copy 'descript'
 after copy ' edcsirt'

 The buffer is altered after its copied. This seems to happen only on newer 
 versions of linux (3.4.6) on an armv5tel device. When running linux 2.6 I 
 don’t see this.

 Any thoughts on what might be causing this?

 Thanks!
 Bassam
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list



Program.cs
Description: Program.cs
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list