Skip to content

fix pooled array leak - #88810

Merged
stephentoub merged 14 commits into
dotnet:mainfrom
danmoseley:vsb.leak.copy
Jul 18, 2023
Merged

fix pooled array leak#88810
stephentoub merged 14 commits into
dotnet:mainfrom
danmoseley:vsb.leak.copy

Conversation

@danmoseley

Copy link
Copy Markdown
Contributor

I ran the tests with some rudimentary tracing on the array pool and found one leak.

  1. fix leak in FileSystemName.cs
  2. fix some of the leaks in tests that were particularly noisy in the logs. Happy to revert some or all of these.

@ghostghost assigned danmoseleyJul 13, 2023
@ghostghost added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 13, 2023
Comment threadsrc/libraries/Common/tests/System/Net/Security/FakeNtlmServer.cs Outdated
@danmoseleydanmoseley added area-System.IO and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jul 13, 2023
@ghost

Copy link
Copy Markdown

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

Issue Details

I ran the tests with some rudimentary tracing on the array pool and found one leak.

  1. fix leak in FileSystemName.cs
  2. fix some of the leaks in tests that were particularly noisy in the logs. Happy to revert some or all of these.
Author:danmoseley
Assignees:danmoseley
Labels:

area-System.IO

Milestone:-

@danmoseley

Copy link
Copy Markdown
ContributorAuthor

I'll close until I've finished.

@danmoseley

Copy link
Copy Markdown
ContributorAuthor

OK hopefully ready for review now.

@danmoseley

Copy link
Copy Markdown
ContributorAuthor

03:19:50] info: Starting: managed/System.Collections.Tests.dll
[03:21:00] info: Error: failed to run main module `dotnet.wasm`
[03:21:00] info: [03:21:00] info: Caused by:
[03:21:00] info: 0: failed to invoke command default
[03:21:00] info: 1: error while executing at wasm backtrace:
[03:21:00] info: 0: 0x56e9c - <unknown>!drain_gray_stack
[03:21:00] info: 1: 0x4cc5a - <unknown>!sgen_drain_gray_stack
[03:21:00] info: 2: 0x10e3b1 - <unknown>!sgen_client_mark_togglerefs
[03:21:00] info: 3: 0x50ffb - <unknown>!finish_gray_stack
[03:21:00] info: 4: 0x4df21 - <unknown>!major_do_collection
[03:21:00] info: 5: 0x4d322 - <unknown>!sgen_perform_collection
[03:21:00] info: 6: 0x4d186 - <unknown>!sgen_ensure_free_space
[03:21:00] info: 7: 0x53eea - <unknown>!sgen_los_alloc_large_inner
[03:21:00] info: 8: 0x4be31 - <unknown>!sgen_alloc_obj_nolock
[03:21:00] info: 9: 0x10ffda - <unknown>!mono_gc_alloc_vector
[03:21:00] info: 10: 0xe9c6a - <unknown>!mono_array_new_specific_internal
[03:21:00] info: 11: 0xe9caf - <unknown>!mono_array_new_specific_checked
[03:21:00] info: 12: 0x10dbd - <unknown>!mono_interp_exec_method
[03:21:00] info: 13: 0x7f21 - <unknown>!interp_runtime_invoke
[03:21:00] info: 14: 0x11e6e3 - <unknown>!mono_jit_runtime_invoke
[03:21:00] info: 15: 0xe286b - <unknown>!do_runtime_invoke
[03:21:00] info: 16: 0xe2812 - <unknown>!mono_runtime_invoke_checked
[03:21:00] info: 17: 0xe91e7 - <unknown>!mono_runtime_try_invoke_byrefs
[03:21:00] info: 18: 0xafbe4 - <unknown>!ves_icall_InternalInvoke
[03:21:00] info: 19: 0xb8413 - <unknown>!ves_icall_InternalInvoke_raw
[03:21:00] info: 20: 0x19bf1 - <unknown>!do_icall
[03:21:00] info: 21: 0x188d0 - <unknown>!do_icall_wrapper
[03:21:00] info: 22: 0x9283 - <unknown>!mono_interp_exec_method
[03:21:00] info: 23: 0x7f21 - <unknown>!interp_runtime_invoke
[03:21:00] info: 24: 0x11e6e3 - <unknown>!mono_jit_runtime_invoke
[03:21:00] info: 25: 0xe286b - <unknown>!do_runtime_invoke
[03:21:00] info: 26: 0xe3205 - <unknown>!mono_runtime_try_invoke
[03:21:00] info: 27: 0xe7a48 - <unknown>!do_try_exec_main
[03:21:00] info: 28: 0xe74e7 - <unknown>!mono_runtime_run_main
[03:21:00] info: 29: 0x694d - <unknown>!main
[03:21:00] info: 30: 0x27375c - <unknown>!__main_void
[03:21:00] info: 31: 0x59b2 - <unknown>!_start
[03:21:00] info: 32: 0x28693e - <unknown>!_start.command_export
[03:21:00] info: note: using the `WASMTIME_BACKTRACE_DETAILS=1` 

Comment threadsrc/libraries/Common/tests/System/Net/Security/FakeNtlmServer.cs Outdated
Comment threadsrc/libraries/Common/tests/TestUtilities/System/IO/FileCleanupTestBase.cs Outdated
Comment threadsrc/libraries/Common/tests/Tests/System/Text/ValueStringBuilderTests.cs Outdated
Comment threadsrc/libraries/Common/tests/Tests/System/Text/ValueStringBuilderTests.cs Outdated
Comment threadsrc/libraries/Common/tests/Tests/System/Text/ValueStringBuilderTests.cs Outdated
Comment threadsrc/libraries/System.Memory/tests/MemoryPool/MemoryPool.cs Outdated
Comment threadsrc/libraries/System.Memory/tests/MemoryPool/MemoryPool.cs Outdated
@danmoseley

Copy link
Copy Markdown
ContributorAuthor

Any other feedback @stephentoub

@stephentoub
stephentoub merged commit 68242c7 into dotnet:mainJul 18, 2023
@ghostghost locked as resolved and limited conversation to collaborators Aug 17, 2023
@danmoseley
danmoseley deleted the vsb.leak.copy branch March 27, 2026 03:36
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@danmoseley@filipnavara@stephentoub