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

System.Xml.Tests.CNameTableTestModule.RunTests failure on Windows Server 2022 #65235

Closed
runfoapp bot opened this issue Feb 12, 2022 · 7 comments · Fixed by #65290
Closed

System.Xml.Tests.CNameTableTestModule.RunTests failure on Windows Server 2022 #65235

runfoapp bot opened this issue Feb 12, 2022 · 7 comments · Fixed by #65290
Labels
area-System.Xml untriaged New issue has not been triaged by the area owner

Comments

@runfoapp
Copy link

runfoapp bot commented Feb 12, 2022

System.Xml.Tests.CNameTableTestModule.RunTests(testCase: Get Valid Super String) [FAIL]
    OLEDB.Test.ModuleCore.CTestException : objTest2 is null
    Expected: `True`
    Actual: `False`
    Result: 0
    
    Stack Trace:
    /_/src/libraries/System.Private.Xml/tests/Readers/NameTable/XmlNameTable.cs(346,0): at System.Xml.Tests.TCRecordNameTableGet.Variation_10()
    /_/src/libraries/Common/tests/System/Xml/ModuleCore/cvariation.cs(80,0): at OLEDB.Test.ModuleCore.CVariation.Execute()
    /_/src/libraries/Common/tests/System/Xml/ModuleCore/ctestcase.cs(131,0): at OLEDB.Test.ModuleCore.CTestCase.<>c__DisplayClass7_1.<TestCases>b__0()
    /_/src/libraries/Common/tests/System/Xml/ModuleCore/XunitTestCase.cs(37,0): at OLEDB.Test.ModuleCore.XunitTestCase.Run()
    /_/src/libraries/System.Private.Xml/tests/Readers/NameTable/CNameTableTestModule.cs(16,0): at System.Xml.Tests.CNameTableTestModule.RunTests(XunitTestCase testCase)

XmlReader rDataReader = XmlReader.Create(FilePathUtil.getStream(filename));
while (rDataReader.Read() == true) ;
XmlNameTable nt = rDataReader.NameTable;
object objTest1 = nt.Get(BigStr + "Z");
object objTest2 = nt.Get(BigStr + "X");
object objTest3 = nt.Get(BigStr + "Y");
if (objTest1 != null)
{
throw new CTestException(CTestBase.TEST_FAIL, "objTest1 is not null");
}
if (objTest2 == null)
{
throw new CTestException(CTestBase.TEST_FAIL, "objTest2 is null");
}

Runfo Tracking Issue: system.xml.tests.cnametabletestmodule.runtests

Build Definition Kind Run Name Console Core Dump Test Results Run Client
1612202 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1612202 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1611370 runtime-extra-platforms PR 64452 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1611370 runtime-extra-platforms PR 64452 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1610942 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1610942 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1609873 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1609873 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1608296 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1608296 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1606693 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1606693 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1605694 runtime-extra-platforms PR 60905 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1605694 runtime-extra-platforms PR 60905 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1603058 runtime-extra-platforms PR 64452 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1603058 runtime-extra-platforms PR 64452 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1602227 runtime-extra-platforms PR 64452 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1602227 runtime-extra-platforms PR 64452 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py

Build Result Summary

Day Hit Count Week Hit Count Month Hit Count
3 9 9
@dotnet-issue-labeler dotnet-issue-labeler bot added area-Diagnostics-coreclr untriaged New issue has not been triaged by the area owner labels Feb 12, 2022
@ghost
Copy link

ghost commented Feb 12, 2022

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

Runfo Creating Tracking Issue (data being generated)

Author: runfoapp[bot]
Assignees: -
Labels:

area-Diagnostics-coreclr, untriaged

Milestone: -

@elinor-fung elinor-fung changed the title system.xml.tests.cnametabletestmodule.runtests System.Xml.Tests.CNameTableTestModule.RunTests failure on Windows Server 2022 Feb 12, 2022
@ghost
Copy link

ghost commented Feb 12, 2022

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

Issue Details
System.Xml.Tests.CNameTableTestModule.RunTests(testCase: Get Valid Super String) [FAIL]
    OLEDB.Test.ModuleCore.CTestException : objTest2 is null
    Expected: `True`
    Actual: `False`
    Result: 0
    
    Stack Trace:
    /_/src/libraries/System.Private.Xml/tests/Readers/NameTable/XmlNameTable.cs(346,0): at System.Xml.Tests.TCRecordNameTableGet.Variation_10()
    /_/src/libraries/Common/tests/System/Xml/ModuleCore/cvariation.cs(80,0): at OLEDB.Test.ModuleCore.CVariation.Execute()
    /_/src/libraries/Common/tests/System/Xml/ModuleCore/ctestcase.cs(131,0): at OLEDB.Test.ModuleCore.CTestCase.<>c__DisplayClass7_1.<TestCases>b__0()
    /_/src/libraries/Common/tests/System/Xml/ModuleCore/XunitTestCase.cs(37,0): at OLEDB.Test.ModuleCore.XunitTestCase.Run()
    /_/src/libraries/System.Private.Xml/tests/Readers/NameTable/CNameTableTestModule.cs(16,0): at System.Xml.Tests.CNameTableTestModule.RunTests(XunitTestCase testCase)

XmlReader rDataReader = XmlReader.Create(FilePathUtil.getStream(filename));
while (rDataReader.Read() == true) ;
XmlNameTable nt = rDataReader.NameTable;
object objTest1 = nt.Get(BigStr + "Z");
object objTest2 = nt.Get(BigStr + "X");
object objTest3 = nt.Get(BigStr + "Y");
if (objTest1 != null)
{
throw new CTestException(CTestBase.TEST_FAIL, "objTest1 is not null");
}
if (objTest2 == null)
{
throw new CTestException(CTestBase.TEST_FAIL, "objTest2 is null");
}

Runfo Tracking Issue: system.xml.tests.cnametabletestmodule.runtests

Build Definition Kind Run Name Console Core Dump Test Results Run Client
1608296 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1608296 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1606693 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1606693 runtime-extra-platforms Rolling net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1605694 runtime-extra-platforms PR 60905 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1605694 runtime-extra-platforms PR 60905 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1603058 runtime-extra-platforms PR 64452 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1603058 runtime-extra-platforms PR 64452 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1602227 runtime-extra-platforms PR 64452 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py
1602227 runtime-extra-platforms PR 64452 net7.0-windows-Release-x86-CoreCLR_release-Windows.Amd64.Server2022.Open console.log runclient.py

Build Result Summary

Day Hit Count Week Hit Count Month Hit Count
2 5 5
Author: runfoapp[bot]
Assignees: -
Labels:

area-System.Xml, untriaged

Milestone: -

@danmoseley
Copy link
Member

One of these is not like the others

  Starting:    System.Xml.RW.NameTable.Tests (parallel test collections = on, max threads = 2)
    System.Xml.Tests.CNameTableTestModule.RunTests(testCase: Add an existing atomized string (with Max string for test: 1-2M), valid offset and valid length) [FAIL]
      System.Xml.XmlException : The '.' character, hexadecimal value 0x00, cannot be included in a name. Line 2, position 860041.
      Stack Trace:
        /_/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs(2813,0): at System.Xml.XmlTextReaderImpl.Throw(Exception e)
        /_/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs(2787,0): at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
        /_/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs(4544,0): at System.Xml.XmlTextReaderImpl.ParseElement()
        /_/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs(4312,0): at System.Xml.XmlTextReaderImpl.ParseElementContent()
        /_/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs(1236,0): at System.Xml.XmlTextReaderImpl.Read()
        /_/src/libraries/System.Private.Xml/tests/Readers/NameTable/XmlNameTable.cs(778,0): at System.Xml.Tests.TCRecordNameTableAdd.Variation_8()
        /_/src/libraries/Common/tests/System/Xml/ModuleCore/cvariation.cs(80,0): at OLEDB.Test.ModuleCore.CVariation.Execute()
        /_/src/libraries/Common/tests/System/Xml/ModuleCore/ctestcase.cs(131,0): at OLEDB.Test.ModuleCore.CTestCase.<>c__DisplayClass7_1.<TestCases>b__0()
        /_/src/libraries/Common/tests/System/Xml/ModuleCore/XunitTestCase.cs(37,0): at OLEDB.Test.ModuleCore.XunitTestCase.Run()
        /_/src/libraries/System.Private.Xml/tests/Readers/NameTable/CNameTableTestModule.cs(16,0): at System.Xml.Tests.CNameTableTestModule.RunTests(XunitTestCase testCase)
  Finished:    System.Xml.RW.NameTable.Tests

but it seems the same root cause -- in both cases, the element name being read is not exactly equal to new string('Z', (1 << 20) - 1); as it's expected to be.

It's not just server 2022, also Windows 7 at least.

@danmoseley
Copy link
Member

could this be related to #63459? Having trouble querying to find out when it started.

@danmoseley
Copy link
Member

Looped this test library 600 times on Windows 10 x64, no failures, now I'll try 32 bit

@danmoseley
Copy link
Member

I ran the whole library 9500 times on x86, no failures.

@danmoseley
Copy link
Member

danmoseley commented Feb 13, 2022

This seems like a relevant bug. It wraps a MemoryStream with a StreamWriter, flushes the StreamWriter, then leaves it dangling and returns the MemoryStream

MemoryStream ms = new MemoryStream();
TextWriter tw = new StreamWriter(ms);
string str = new string('Z', (1 << 20) - 1);
tw.WriteLine("<Root>");
tw.Write("<");
tw.Write(str);
tw.WriteLine("X />");
tw.Flush();
tw.Write("<");
tw.Write(str);
tw.WriteLine("Y />");
tw.WriteLine("</Root>");
tw.Flush();
FilePathUtil.addStream(strFileName, ms);

That would cause a random ODE when the StreamWriter is finalized, not the error we're seeing here.

There may also be some issues with a memory stream getting used concurrently. It copies MemoryStream's to fresh ones -- if this is happening concurrently with use, that could cause a torn copy leaving nulls in it causing this symptom. Let me see whether I can clean this up.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Feb 14, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Feb 15, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Mar 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Xml untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants