Bug 11184 - [master-3.0] Array.Clear does not clear the request length
Summary: [master-3.0] Array.Clear does not clear the request length
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime ()
Version: 6.3.x
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Rodrigo Kumpera
Depends on:
Reported: 2013-03-15 10:59 UTC by Sebastien Pouliot
Modified: 2013-03-15 16:33 UTC (History)
2 users (show)

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 Developer Community or GitHub 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:

Description Sebastien Pouliot 2013-03-15 10:59:36 UTC
That's a recent regression. Bots started failing a unit tests in Mono.Security. It affects both the simulator (x86) and devices.

Debugging the issue shows that Array.Clear misbehave while clearing part of a byte buffer.

> ? BitConverter.ToString (key)

  				Array.Clear (key, 5, 11);

> ? BitConverter.ToString (key)

The last 3 bytes should be 0x00.

Things were fine in 6fc1c8daee5907613a3ca3318bafcfde4c4e045b
and started to fail when bumped to 68ebec2787a993f1b4df81acc3f388050e449eba

There's not many commits between them and none related to the Mono.Security code itself.

c.c. kumpera wrt 8a6a647e00b2db4235cc0d3c49e36944a52caf52
Comment 1 Sebastien Pouliot 2013-03-15 11:41:20 UTC
If I revert (locally) that commit then it works again

> ? BitConverter.ToString (key)

                 Array.Clear (key, 5, 11);

> ? BitConverter.ToString (key)

Assigning to Rodrigo
Comment 2 Sebastien Pouliot 2013-03-15 12:52:17 UTC
Easier to duplicate/debug test case added (disabled) in 47a23d99983ed4d984ce10e559559e4528527b86
Comment 3 Rodrigo Kumpera 2013-03-15 15:36:50 UTC
Working on it.
Comment 4 Rodrigo Kumpera 2013-03-15 16:33:03 UTC
Fixed on master.