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

[wasm] Out of memory exception in System.Xml.XmlWriterApiTests.TCFullEndElement tests #110090

Open
carlossanlop opened this issue Nov 22, 2024 · 5 comments
Assignees
Labels
arch-wasm WebAssembly architecture area-System.Xml Known Build Error Use this to report build issues in the .NET Helix tab os-browser Browser variant of arch-wasm os-linux Linux OS (any supported distro) test-failure untriaged New issue has not been triaged by the area owner

Comments

@carlossanlop
Copy link
Member

carlossanlop commented Nov 22, 2024

Build Information

Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=876444
Build error leg or test failing: System.Xml.XmlWriterApiTests.TCFullEndElement

Error Message

{
  "ErrorMessage" : [ "[FAIL] System.Xml.XmlWriterApiTests.TCFullEndElement", "System.OutOfMemoryException : Out of memory" ],
  "BuildRetry" : false,
  "ExcludeConsoleLog" : false
}
[16:01:27] info: Initializing dotnet version 10.0.0-ci commit hash da69f3e465c6f3e140856405ae3016aec94b63af
[16:01:28] info: Using threadless Xunit runner
[16:01:28] info: Discovering: System.Private.Xml.Tests.dll (method display = ClassAndMethod, method display options = None)
[16:01:31] info: Discovered:  System.Private.Xml.Tests.dll (found 4763 of 4823 test cases)
[16:01:31] info: Starting:    System.Private.Xml.Tests.dll
[16:03:45] info: [FAIL] System.Xml.XmlWriterApiTests.TCFullEndElement+TCWriteValue+TCGlobalization.var_1(utils: XmlWriterUtils { Async = True, WriterType = UTF8Writer })
[16:03:45] info: System.OutOfMemoryException : Out of memory
[16:03:45] info:    at System.String.Concat(ReadOnlySpan`1 str0, ReadOnlySpan`1 str1)
[16:03:45] info:    at System.Xml.XmlWriterApiTests.TCFullEndElement.TCWriteValue.TCGlobalization.var_1(XmlWriterUtils utils)
[16:03:45] info:    at System.Object.InvokeStub_TCGlobalization.var_1(Object , Span`1 )
[16:03:45] info:    at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
[16:03:45] info: [FAIL] System.Xml.XmlWriterApiTests.TCFullEndElement+TCWriteValue+TCGlobalization.var_1(utils: XmlWriterUtils { Async = False, WriterType = UnicodeWriter })
[16:03:45] info: System.OutOfMemoryException : Out of memory
[16:03:45] info:    at System.Xml.XmlEncodedRawTextWriter..ctor(Stream stream, XmlWriterSettings settings)
[16:03:45] info:    at System.Xml.XmlWriterSettings.CreateWriter(Stream output)
[16:03:45] info:    at XmlCoreTest.Common.WriterFactory.CreateWriterImpl()
[16:03:45] info:    at XmlCoreTest.Common.WriterFactory.CreateWriter(String fileName)
[16:03:45] info:    at System.Xml.XmlWriterApiTests.XmlWriterUtils.CreateWriter()
[16:03:45] info:    at System.Xml.XmlWriterApiTests.TCFullEndElement.TCWriteValue.TCGlobalization.var_1(XmlWriterUtils utils)
[16:03:45] info:    at System.Object.InvokeStub_TCGlobalization.var_1(Object , Span`1 )
[16:03:45] info:    at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
[16:03:45] info: [FAIL] System.Xml.XmlWriterApiTests.TCFullEndElement+TCWriteValue+TCGlobalization.var_1(utils: XmlWriterUtils { Async = True, WriterType = UnicodeWriter })
[16:03:45] info: System.OutOfMemoryException : Out of memory
[16:03:45] info:    at System.Xml.XmlEncodedRawTextWriter..ctor(Stream stream, XmlWriterSettings settings)
[16:03:45] info:    at System.Xml.XmlWriterSettings.CreateWriter(Stream output)
[16:03:45] info:    at XmlCoreTest.Common.XmlWriterAsync.Create(Stream output, XmlWriterSettings settings)
[16:03:45] info:    at XmlCoreTest.Common.WriterFactory.CreateWriterImpl()
[16:03:45] info:    at XmlCoreTest.Common.WriterFactory.CreateWriter(String fileName)
[16:03:45] info:    at System.Xml.XmlWriterApiTests.XmlWriterUtils.CreateWriter()
[16:03:45] info:    at System.Xml.XmlWriterApiTests.TCFullEndElement.TCWriteValue.TCGlobalization.var_1(XmlWriterUtils utils)
[16:03:45] info:    at System.Object.InvokeStub_TCGlobalization.var_1(Object , Span`1 )
[16:03:45] info:    at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
[16:03:45] info: [FAIL] System.Xml.XmlWriterApiTests.TCFullEndElement+TCWriteValue+TCGlobalization.var_1(utils: XmlWriterUtils { Async = False, WriterType = CustomWriter })
[16:03:45] info: System.OutOfMemoryException : Out of memory
[16:03:45] info:    at System.String.Concat(ReadOnlySpan`1 str0, ReadOnlySpan`1 str1)
[16:03:45] info:    at System.Xml.XmlWriterApiTests.TCFullEndElement.TCWriteValue.TCGlobalization.var_1(XmlWriterUtils utils)
[16:03:45] info:    at System.Object.InvokeStub_TCGlobalization.var_1(Object , Span`1 )
[16:03:45] info:    at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=876444
Error message validated: [[FAIL] System.Xml.XmlWriterApiTests.TCFullEndElement System.OutOfMemoryException : Out of memory]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 11/22/2024 7:17:35 PM UTC

Report

Build Definition Test Pull Request
955535 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112661
955558 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112642
955508 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #111791
955212 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112404
955023 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112647
954896 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112513
954840 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112642
954758 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112625
954739 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112638
954715 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #111505
954697 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #111791
954672 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112637
954626 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #111706
954607 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112567
954430 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112567
954370 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112632
954215 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112624
954009 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution
953855 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112606
953704 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112606
953693 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112604
953676 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution
953489 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution
953425 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112513
953196 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112590
953143 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112404
953058 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112547
952940 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112352
952693 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #110622
952576 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112357
952457 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112404
951697 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #111910
952341 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution
952098 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112547
951967 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #110622
951942 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #111759
951805 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112372
951635 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112263
951510 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112496
951332 dotnet/runtime WasmTestOnChrome-MT-System.Private.Xml.Tests.WorkItemExecution #112295
951286 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #110622
951018 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112496
950206 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112440
950270 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112372
949904 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112352
949384 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112345
949175 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112391
949094 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112384
948979 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #111564
948832 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112450
948349 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112417
948693 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution
948649 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #111934
948462 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #110416
948253 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112383
948145 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112345
947934 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112357
947912 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112350
947911 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution
947838 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #98643
947753 dotnet/runtime WasmTestOnChrome-MT-System.Private.Xml.Tests.WorkItemExecution #112337
947411 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #111759
947282 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112345
947182 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112256
946748 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #111706
946582 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #111539
946513 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112034
946410 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112345
946389 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution
946332 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112342
946244 dotnet/runtime WasmTestOnChrome-MT-System.Private.Xml.Tests.WorkItemExecution #112338
946326 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #111610
945947 dotnet/runtime WasmTestOnChrome-MT-System.Private.Xml.Tests.WorkItemExecution
945677 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112313
945663 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #111598
945627 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112309
945565 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112295
945541 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112256
945512 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112307
945455 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112302
945459 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112306
945391 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112298
945281 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution
945250 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #111723
945210 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112260
944895 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112256
944842 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #107819
944584 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #111759
944650 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution
944503 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112263
944497 dotnet/runtime WasmTestOnChrome-MT-System.Private.Xml.Tests.WorkItemExecution #112206
944491 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112282
943160 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #110622
944315 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112232
944205 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112199
944114 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #112232
943896 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112260
943519 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112223
943428 dotnet/runtime WasmTestOnChrome-ST-System.Private.Xml.Tests.WorkItemExecution #112209
943321 dotnet/runtime WasmTestOnFirefox-ST-System.Private.Xml.Tests.WorkItemExecution #111642
Displaying 100 of 252 results

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
8 50 252
@carlossanlop carlossanlop added arch-wasm WebAssembly architecture area-System.Xml Known Build Error Use this to report build issues in the .NET Helix tab os-browser Browser variant of arch-wasm os-linux Linux OS (any supported distro) test-failure labels Nov 22, 2024
Copy link
Contributor

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

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Nov 22, 2024
Copy link
Contributor

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

@akoeplinger
Copy link
Member

FWIW I've also seen this test OOM on Android:

 02-18 08:52:43.243 22483 22563 I DOTNET  : 	[FAIL] System.Xml.XmlWriterApiTests.TCFullEndElement+TCWriteValue+TCGlobalization.var_1(utils: XmlWriterUtils { Async = False, WriterType = UnicodeWriter })
 02-18 08:52:43.243 22483 22563 I DOTNET  : System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
 02-18 08:52:43.243 22483 22563 I DOTNET  :    at System.String.Concat(ReadOnlySpan`1 str0, ReadOnlySpan`1 str1)
 02-18 08:52:43.243 22483 22563 I DOTNET  :    at System.Xml.XmlWriterApiTests.TCFullEndElement.TCWriteValue.TCGlobalization.var_1(XmlWriterUtils utils) in /_/src/libraries/System.Private.Xml/tests/Writers/XmlWriterApi/TCFullEndElement.cs:line 6313
 02-18 08:52:43.243 22483 22563 I DOTNET  :    at System.Object.InvokeStub_TCGlobalization.var_1(Object , Span`1 )
 02-18 08:52:43.243 22483 22563 I DOTNET  :    at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

The code looks suspect:

string UniStr = "";
using (XmlWriter w = utils.CreateWriter())
{
for (char ch = '\ue000'; ch < '\ufffe'; ch++)
UniStr += ch;

The loop iterates 8190 times and will create a new (longer) string each time...

@oroztocil
Copy link
Member

@akoeplinger Thanks for the heads up. This test is clearly written inefficiently. However, it should still allocate less than 100 megabytes which I would not expect to cause OOM exception by itself, no?

@akoeplinger
Copy link
Member

the test is an xunit Theory using XmlWriterInlineData for the data so it's probably executed multiple times.

I also saw that e.g. the Base64_1 test has a similar issue so it might add up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly architecture area-System.Xml Known Build Error Use this to report build issues in the .NET Helix tab os-browser Browser variant of arch-wasm os-linux Linux OS (any supported distro) test-failure untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

3 participants