Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures in hashing on Browser #69806

Closed
Tracked by #40074
bartonjs opened this issue May 25, 2022 · 16 comments · Fixed by #70185
Closed
Tracked by #40074

Test failures in hashing on Browser #69806

bartonjs opened this issue May 25, 2022 · 16 comments · Fixed by #70185
Assignees
Labels
arch-wasm WebAssembly architecture area-System.Security blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Milestone

Comments

@bartonjs
Copy link
Member

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-69668-merge-9dd411182c95433daa/WasmTestOnBrowser-System.Security.Cryptography.Tests/1/console.fdc2faf5.log?helixlogtype=result

[08:20:42] info: Starting:    System.Security.Cryptography.Tests.dll
[08:20:46] fail: [FAIL] System.Security.Cryptography.Tests.Sha1ManagedTests.Sha1_Rfc3174_3_Async
[08:20:46] info: Showing first 10 differences
[08:20:46] info:   Position 0: Expected: 52, Actual: 217
[08:20:46] info:   Position 1: Expected: 170, Actual: 73
[08:20:46] info:   Position 2: Expected: 151, Actual: 231
[08:20:46] info:   Position 3: Expected: 60, Actual: 108
[08:20:46] info:   Position 4: Expected: 212, Actual: 115
[08:20:46] info:   Position 5: Expected: 196, Actual: 7
[08:20:46] info:   Position 6: Expected: 218, Actual: 236
[08:20:46] info:   Position 7: Expected: 164, Actual: 195
[08:20:46] info:   Position 8: Expected: 246, Actual: 62
[08:20:46] info:   Position 9: Expected: 30, Actual: 42
[08:20:46] info: Total number of differences: 20 out of 20
[08:20:46] info:    at System.AssertExtensions.SequenceEqual[Byte](ReadOnlySpan`1 expected, ReadOnlySpan`1 actual)
[08:20:46] info:    at System.AssertExtensions.SequenceEqual[Byte](Span`1 expected, Span`1 actual)
[08:20:46] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyOneShotStreamAsync(Stream input, String output)
[08:20:46] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyRepeatingAsync(String input, Int32 repeatCount, String output)
[08:20:46] info:    at System.Security.Cryptography.Tests.Sha1Tests.Sha1_Rfc3174_3_Async()
[08:20:46] info: --- End of stack trace from previous location ---
[08:21:07] info: Finished:    System.Security.Cryptography.Tests.dll
[08:21:07] info: 
[08:21:07] info: === TEST EXECUTION SUMMARY ===
[08:21:07] info: Total: 1163, Errors: 0, Failed: 1, Skipped: 1, Time: 24.820985s

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-69786-merge-4202b33d23d54c99bd/WasmTestOnBrowser-System.Security.Cryptography.Tests/1/console.99f7714c.log?helixlogtype=result

[10:47:51] info: Starting:    System.Security.Cryptography.Tests.dll
[10:47:55] fail: [FAIL] System.Security.Cryptography.Tests.Sha256Tests.Sha256_Fips180_3
[10:47:55] info: Assert.Equal() Failure
[10:47:55] info:            ↓ (pos 0)
[10:47:55] info: Expected: [205, 199, 110, 92, 153, ...]
[10:47:55] info: Actual:   [156, 156, 59, 215, 224, ...]
[10:47:55] info:            ↑ (pos 0)
[10:47:55] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyOneShotAllocatingStream(Stream input, String output)
[10:47:55] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyRepeating(String input, Int32 repeatCount, String output)
[10:47:55] info:    at System.Security.Cryptography.Tests.Sha256Tests.Sha256_Fips180_3()
[10:47:55] info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
[10:48:00] fail: [out of order message from the browser]: http://127.0.0.1:35197/dotnet.js 2:70309 Uncaught
[11:02:46] fail: Application has finished with exit code TIMED_OUT but 0 was expected
XHarness exit code: 71 (GENERAL_FAILURE)
/datadisks/disk1/work/A6E90937/w/A157086B/e /datadisks/disk1/work/A6E90937/w/A157086B/e
----- end Wed May 25 11:02:46 UTC 2022 ----- exit code 71 ----------------------------------------------------------

Both of these tests are testing the hash of one million ASCII lowercase a characters.

Having run through hashes of {}, {'a'}, {'a', 'a'}, all the way up to 5 million, for both SHA-1 and SHA-2-256, I can't reproduce either of these error values.

It seems like, somehow, bad data got into the pipeline... it's not a case of too much, or too little.

Also noteworthy is that each of these failed in the allocating one-shots over streams (public static byte[] HashData(Stream), and the async variant), after successfully doing it via other methods.

@ghost
Copy link

ghost commented May 25, 2022

Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones
See info in area-owners.md if you want to be subscribed.

Issue Details

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-69668-merge-9dd411182c95433daa/WasmTestOnBrowser-System.Security.Cryptography.Tests/1/console.fdc2faf5.log?helixlogtype=result

[08:20:42] info: Starting:    System.Security.Cryptography.Tests.dll
[08:20:46] fail: [FAIL] System.Security.Cryptography.Tests.Sha1ManagedTests.Sha1_Rfc3174_3_Async
[08:20:46] info: Showing first 10 differences
[08:20:46] info:   Position 0: Expected: 52, Actual: 217
[08:20:46] info:   Position 1: Expected: 170, Actual: 73
[08:20:46] info:   Position 2: Expected: 151, Actual: 231
[08:20:46] info:   Position 3: Expected: 60, Actual: 108
[08:20:46] info:   Position 4: Expected: 212, Actual: 115
[08:20:46] info:   Position 5: Expected: 196, Actual: 7
[08:20:46] info:   Position 6: Expected: 218, Actual: 236
[08:20:46] info:   Position 7: Expected: 164, Actual: 195
[08:20:46] info:   Position 8: Expected: 246, Actual: 62
[08:20:46] info:   Position 9: Expected: 30, Actual: 42
[08:20:46] info: Total number of differences: 20 out of 20
[08:20:46] info:    at System.AssertExtensions.SequenceEqual[Byte](ReadOnlySpan`1 expected, ReadOnlySpan`1 actual)
[08:20:46] info:    at System.AssertExtensions.SequenceEqual[Byte](Span`1 expected, Span`1 actual)
[08:20:46] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyOneShotStreamAsync(Stream input, String output)
[08:20:46] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyRepeatingAsync(String input, Int32 repeatCount, String output)
[08:20:46] info:    at System.Security.Cryptography.Tests.Sha1Tests.Sha1_Rfc3174_3_Async()
[08:20:46] info: --- End of stack trace from previous location ---
[08:21:07] info: Finished:    System.Security.Cryptography.Tests.dll
[08:21:07] info: 
[08:21:07] info: === TEST EXECUTION SUMMARY ===
[08:21:07] info: Total: 1163, Errors: 0, Failed: 1, Skipped: 1, Time: 24.820985s

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-69786-merge-4202b33d23d54c99bd/WasmTestOnBrowser-System.Security.Cryptography.Tests/1/console.99f7714c.log?helixlogtype=result

[10:47:51] info: Starting:    System.Security.Cryptography.Tests.dll
[10:47:55] fail: [FAIL] System.Security.Cryptography.Tests.Sha256Tests.Sha256_Fips180_3
[10:47:55] info: Assert.Equal() Failure
[10:47:55] info:            ↓ (pos 0)
[10:47:55] info: Expected: [205, 199, 110, 92, 153, ...]
[10:47:55] info: Actual:   [156, 156, 59, 215, 224, ...]
[10:47:55] info:            ↑ (pos 0)
[10:47:55] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyOneShotAllocatingStream(Stream input, String output)
[10:47:55] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyRepeating(String input, Int32 repeatCount, String output)
[10:47:55] info:    at System.Security.Cryptography.Tests.Sha256Tests.Sha256_Fips180_3()
[10:47:55] info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
[10:48:00] fail: [out of order message from the browser]: http://127.0.0.1:35197/dotnet.js 2:70309 Uncaught
[11:02:46] fail: Application has finished with exit code TIMED_OUT but 0 was expected
XHarness exit code: 71 (GENERAL_FAILURE)
/datadisks/disk1/work/A6E90937/w/A157086B/e /datadisks/disk1/work/A6E90937/w/A157086B/e
----- end Wed May 25 11:02:46 UTC 2022 ----- exit code 71 ----------------------------------------------------------

Both of these tests are testing the hash of one million ASCII lowercase a characters.

Having run through hashes of {}, {'a'}, {'a', 'a'}, all the way up to 5 million, for both SHA-1 and SHA-2-256, I can't reproduce either of these error values.

It seems like, somehow, bad data got into the pipeline... it's not a case of too much, or too little.

Also noteworthy is that each of these failed in the allocating one-shots over streams (public static byte[] HashData(Stream), and the async variant), after successfully doing it via other methods.

Author: bartonjs
Assignees: -
Labels:

area-System.Security, blazor-wasm

Milestone: 7.0.0

@ericstj
Copy link
Member

ericstj commented May 25, 2022

@bartonjs were you testing in the exact same environment as the test? Ubuntu, amd64, WasmTestOnNodeJs?

@vcsjones
Copy link
Member

Any chance it's concurrency related? Concurrent test execution?

@radical radical added arch-wasm WebAssembly architecture and removed blazor-wasm labels May 25, 2022
@ghost
Copy link

ghost commented May 25, 2022

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-69668-merge-9dd411182c95433daa/WasmTestOnBrowser-System.Security.Cryptography.Tests/1/console.fdc2faf5.log?helixlogtype=result

[08:20:42] info: Starting:    System.Security.Cryptography.Tests.dll
[08:20:46] fail: [FAIL] System.Security.Cryptography.Tests.Sha1ManagedTests.Sha1_Rfc3174_3_Async
[08:20:46] info: Showing first 10 differences
[08:20:46] info:   Position 0: Expected: 52, Actual: 217
[08:20:46] info:   Position 1: Expected: 170, Actual: 73
[08:20:46] info:   Position 2: Expected: 151, Actual: 231
[08:20:46] info:   Position 3: Expected: 60, Actual: 108
[08:20:46] info:   Position 4: Expected: 212, Actual: 115
[08:20:46] info:   Position 5: Expected: 196, Actual: 7
[08:20:46] info:   Position 6: Expected: 218, Actual: 236
[08:20:46] info:   Position 7: Expected: 164, Actual: 195
[08:20:46] info:   Position 8: Expected: 246, Actual: 62
[08:20:46] info:   Position 9: Expected: 30, Actual: 42
[08:20:46] info: Total number of differences: 20 out of 20
[08:20:46] info:    at System.AssertExtensions.SequenceEqual[Byte](ReadOnlySpan`1 expected, ReadOnlySpan`1 actual)
[08:20:46] info:    at System.AssertExtensions.SequenceEqual[Byte](Span`1 expected, Span`1 actual)
[08:20:46] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyOneShotStreamAsync(Stream input, String output)
[08:20:46] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyRepeatingAsync(String input, Int32 repeatCount, String output)
[08:20:46] info:    at System.Security.Cryptography.Tests.Sha1Tests.Sha1_Rfc3174_3_Async()
[08:20:46] info: --- End of stack trace from previous location ---
[08:21:07] info: Finished:    System.Security.Cryptography.Tests.dll
[08:21:07] info: 
[08:21:07] info: === TEST EXECUTION SUMMARY ===
[08:21:07] info: Total: 1163, Errors: 0, Failed: 1, Skipped: 1, Time: 24.820985s

https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-69786-merge-4202b33d23d54c99bd/WasmTestOnBrowser-System.Security.Cryptography.Tests/1/console.99f7714c.log?helixlogtype=result

[10:47:51] info: Starting:    System.Security.Cryptography.Tests.dll
[10:47:55] fail: [FAIL] System.Security.Cryptography.Tests.Sha256Tests.Sha256_Fips180_3
[10:47:55] info: Assert.Equal() Failure
[10:47:55] info:            ↓ (pos 0)
[10:47:55] info: Expected: [205, 199, 110, 92, 153, ...]
[10:47:55] info: Actual:   [156, 156, 59, 215, 224, ...]
[10:47:55] info:            ↑ (pos 0)
[10:47:55] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyOneShotAllocatingStream(Stream input, String output)
[10:47:55] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyRepeating(String input, Int32 repeatCount, String output)
[10:47:55] info:    at System.Security.Cryptography.Tests.Sha256Tests.Sha256_Fips180_3()
[10:47:55] info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)
[10:48:00] fail: [out of order message from the browser]: http://127.0.0.1:35197/dotnet.js 2:70309 Uncaught
[11:02:46] fail: Application has finished with exit code TIMED_OUT but 0 was expected
XHarness exit code: 71 (GENERAL_FAILURE)
/datadisks/disk1/work/A6E90937/w/A157086B/e /datadisks/disk1/work/A6E90937/w/A157086B/e
----- end Wed May 25 11:02:46 UTC 2022 ----- exit code 71 ----------------------------------------------------------

Both of these tests are testing the hash of one million ASCII lowercase a characters.

Having run through hashes of {}, {'a'}, {'a', 'a'}, all the way up to 5 million, for both SHA-1 and SHA-2-256, I can't reproduce either of these error values.

It seems like, somehow, bad data got into the pipeline... it's not a case of too much, or too little.

Also noteworthy is that each of these failed in the allocating one-shots over streams (public static byte[] HashData(Stream), and the async variant), after successfully doing it via other methods.

Author: bartonjs
Assignees: -
Labels:

arch-wasm, area-System.Security

Milestone: 7.0.0

@lewing
Copy link
Member

lewing commented May 25, 2022

@radical can you also keep an eye on any failures in the hashing tests to make sure we know the status here

@bartonjs
Copy link
Member Author

were you testing in the exact same environment as the test? Ubuntu, amd64, WasmTestOnNodeJs?

No. Windows/amd64/Console, as an attempt to reproduce the values reported as 'actual' by the failures. (Crack the hash... crypto mining for flyweights)

private static void Main()
{
    IncrementalHash hash = IncrementalHash.CreateHash(HashAlgorithmName.SHA1);
    byte[] buf = new byte[1024];
    buf.AsSpan().Fill((byte)'a');

    int count = 0;
    const int Target1 = 0;

    while (count < Target1)
    {
        int len = Math.Min(Target1 - count, buf.Length);
        hash.AppendData(buf.AsSpan(0, len));
        count += len;
    }

    const int Target2 = 5_000_000;
    //ReadOnlySpan<byte> matchSHA256 = stackalloc byte[] { 156, 156, 59 };//, 215, 224 };
    //ReadOnlySpan<byte> matchSHA1 = stackalloc byte[] { 217, 73, 231 };//, 108, 115, 7, 236, 194, 62, 42 };
    // This is the right answer, to test that it reports a hit at i=1_000_000
    ReadOnlySpan<byte> matchSHA1 = stackalloc byte[] { 52, 170, 151, 60, 212, 196, 218, 164, 246, 30 };
    ReadOnlySpan<byte> match = matchSHA1;
    ReadOnlySpan<byte> oneA = buf.AsSpan(0, 1);
    Span<byte> hashOut = stackalloc byte[128];

    for (int i = count; i < Target2; i++)
    {
        hash.TryGetCurrentHash(hashOut, out int written);

        if (hashOut.Slice(0, match.Length).SequenceEqual(match))
        {
            Console.WriteLine($"Partial hit at i={i}");
        }

        hash.AppendData(oneA);
    }
}

@bartonjs
Copy link
Member Author

Any chance it's concurrency related? Concurrent test execution?

I didn't think wasm had concurrency...

@radical
Copy link
Member

radical commented May 26, 2022

@bartonjs were you testing in the exact same environment as the test? Ubuntu, amd64, WasmTestOnNodeJs?

The test is running on chrome, and not nodejs.

@buyaa-n
Copy link
Contributor

buyaa-n commented May 26, 2022

https://github.com/dotnet/runtime/pull/69815/checks?check_run_id=6615945253 probably related to this

[19:57:03] info: Starting:    System.Security.Cryptography.Tests.dll
[19:57:15] fail: [out of order message from the browser]: http://127.0.0.1:37699/dotnet.js 2:70388 Uncaught
[20:11:56] fail: Application has finished with exit code TIMED_OUT but 0 was expected
XHarness exit code: 71 (GENERAL_FAILURE)

Log: https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-69815-merge-5dc2e2518ad14b9dbc/WasmTestOnBrowser-System.Security.Cryptography.Tests/1/console.6a6c9876.log?helixlogtype=result

@radical
Copy link
Member

radical commented May 26, 2022

this is very odd:
[19:57:15] fail: [out of order message from the browser]: http://127.0.0.1:37699/dotnet.js 2:70388 Uncaught

  • no other messages at all. And then the test times out after ~15mins.
  • It would be helpful to run tests with WasmXHarnessArgs=--no-headless, and check the js console.

@radical
Copy link
Member

radical commented May 26, 2022

Hm at column 70388:
send_msg(e){if(Atomics.load(this.comm,this.STATE_IDX)!==this.STATE_IDLE)throw"OWNER: Invalid sync communication channel state. "+Atomics.load(this.comm,this.STATE_IDX);return this.send_request(e),this.read_response()}

I tried to always throw an exception in send_msg, and that does show up correctly:

  fail: OWNER: Invalid sync communication channel state. 0
  info: WASM EXIT 1

I tried a little patch, in case it seems useful in general:
https://gist.github.com/radical/99689f9467f50b5af254b88081521bca

@radical
Copy link
Member

radical commented May 28, 2022

Another instance, build:

[01:38:04] fail: [FAIL] System.Security.Cryptography.Tests.Sha1Tests.Sha1_VerifyLargeStream_NotMultipleOf4096_Async
[01:38:04] info: Assert.Equal() Failure
[01:38:04] info:            ↓ (pos 0)
[01:38:04] info: Expected: [24, 198, 170, 141, 37, ...]
[01:38:04] info: Actual:   [142, 30, 218, 217, 154, ...]
[01:38:04] info:            ↑ (pos 0)
[01:38:04] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyComputeHashStreamAsync(Stream input, String output)
[01:38:04] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyRepeatingAsync(String input, Int32 repeatCount, String output)
[01:38:04] info:    at System.Security.Cryptography.Tests.Sha1Tests.Sha1_VerifyLargeStream_NotMultipleOf4096_Async()
[01:38:04] info: --- End of stack trace from previous location ---

@maraf
Copy link
Member

maraf commented May 31, 2022

Another hit on today's rolling build #20220531.2.

[09:03:34] info: Using random seed for test cases: 1600464845
[09:03:34] info: Using random seed for collections: 1600464845
[09:03:34] info: Starting:    System.Security.Cryptography.Tests.dll
[09:03:57] fail: [FAIL] System.Security.Cryptography.Tests.Sha512ManagedTests.Sha512_Fips180_3_Async
[09:03:57] info: Showing first 10 differences
[09:03:57] info:   Position 0: Expected: 231, Actual: 28
[09:03:57] info:   Position 1: Expected: 24, Actual: 40
[09:03:57] info:   Position 2: Expected: 72, Actual: 111
[09:03:57] info:   Position 3: Expected: 61, Actual: 3
[09:03:57] info:   Position 4: Expected: 12, Actual: 7
[09:03:57] info:   Position 5: Expected: 231, Actual: 153
[09:03:57] info:   Position 6: Expected: 105, Actual: 79
[09:03:57] info:   Position 7: Expected: 100, Actual: 143
[09:03:57] info:   Position 8: Expected: 78, Actual: 91
[09:03:57] info:   Position 9: Expected: 46, Actual: 56
[09:03:57] info: Total number of differences: 64 out of 64
[09:03:57] info:    at System.AssertExtensions.SequenceEqual[Byte](ReadOnlySpan`1 expected, ReadOnlySpan`1 actual)
[09:03:57] info:    at System.AssertExtensions.SequenceEqual[Byte](Span`1 expected, Span`1 actual)
[09:03:57] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyOneShotStreamAsync(Stream input, String output)
[09:03:57] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyRepeatingAsync(String input, Int32 repeatCount, String output)
[09:03:57] info:    at System.Security.Cryptography.Tests.Sha512Tests.Sha512_Fips180_3_Async()
[09:03:57] info: --- End of stack trace from previous location ---
[09:04:02] info: Finished:    System.Security.Cryptography.Tests.dll
[09:04:02] info: 
[09:04:02] info: === TEST EXECUTION SUMMARY ===
[09:04:02] info: Total: 1159, Errors: 0, Failed: 1, Skipped: 1, Time: 27.912s

@agocke agocke added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jun 1, 2022
@agocke
Copy link
Member

agocke commented Jun 1, 2022

This is failing regularly in CI -- can we add test retries or disable the test, assuming there's no fix at the moment?

@buyaa-n
Copy link
Contributor

buyaa-n commented Jun 2, 2022

Another failure on: https://github.com/dotnet/runtime/pull/70065/checks?check_run_id=6699909171

[23:38:03] fail: [FAIL] System.Security.Cryptography.Tests.Sha256ManagedTests.Sha256_Fips180_3_Async
[23:38:03] info: Showing first 10 differences
[23:38:03] info:   Position 0: Expected: 205, Actual: 156
[23:38:03] info:   Position 1: Expected: 199, Actual: 224
[23:38:03] info:   Position 2: Expected: 110, Actual: 196
[23:38:03] info:   Position 3: Expected: 92, Actual: 198
[23:38:03] info:   Position 4: Expected: 153, Actual: 35
[23:38:03] info:   Position 5: Expected: 20, Actual: 7
[23:38:03] info:   Position 6: Expected: 251, Actual: 248
[23:38:03] info:   Position 7: Expected: 146, Actual: 83
[23:38:03] info:   Position 8: Expected: 129, Actual: 99
[23:38:03] info:   Position 9: Expected: 161, Actual: 38
[23:38:03] info: Total number of differences: 32 out of 32
[23:38:03] info:    at System.AssertExtensions.SequenceEqual[Byte](ReadOnlySpan`1 expected, ReadOnlySpan`1 actual)
[23:38:03] info:    at System.AssertExtensions.SequenceEqual[Byte](Span`1 expected, Span`1 actual)
[23:38:03] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyOneShotStreamAsync(Stream input, String output)
[23:38:03] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyRepeatingAsync(String input, Int32 repeatCount, String output)
[23:38:03] info:    at System.Security.Cryptography.Tests.Sha256Tests.Sha256_Fips180_3_Async()
[23:38:03] info: --- End of stack trace from previous location ---

https://helixre107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-70065-merge-98fea3a4daa64d8eac/WasmTestOnBrowser-System.Security.Cryptography.Tests/1/console.a690da3d.log?helixlogtype=result

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jun 2, 2022
eerhardt added a commit to eerhardt/runtime that referenced this issue Jun 3, 2022
When sending a message between LibraryChannel and ChannelWorker, there is a race condition where both threads are reading/writing to shared memory at the same time. This can cause message pages to be skipped.

To fix this, add a shared mutex lock so only one side is reading/writing to shared memory at the same time.

Fix dotnet#69806
@maraf
Copy link
Member

maraf commented Jun 7, 2022

Another hit on #20220606.48

[20:56:27] fail: [FAIL] System.Security.Cryptography.Tests.Sha1ManagedTests.Sha1_Rfc3174_3
[20:56:27] info: Assert.Equal() Failure
[20:56:27] info:            ↓ (pos 0)
[20:56:27] info: Expected: [52, 170, 151, 60, 212, ...]
[20:56:27] info: Actual:   [183, 139, 13, 2, 30, ...]
[20:56:27] info:            ↑ (pos 0)
[20:56:27] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyOneShotAllocatingStream(Stream input, String output)
[20:56:27] info:    at System.Security.Cryptography.Tests.HashAlgorithmTestDriver.VerifyRepeating(String input, Int32 repeatCount, String output)
[20:56:27] info:    at System.Security.Cryptography.Tests.Sha1Tests.Sha1_Rfc3174_3()
[20:56:27] info:    at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, Span`1 args, BindingFlags invokeAttr)

eerhardt added a commit that referenced this issue Jun 7, 2022
When sending a message between LibraryChannel and ChannelWorker, there is a race condition where both threads are reading/writing to shared memory at the same time. This can cause message pages to be skipped.

To fix this, add a shared mutex lock so only one side is reading/writing to shared memory at the same time.

Fix #69806
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jun 7, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Security blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms'
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants